Commit Graph

1459 Commits (9d6c96324a0f4cbe69ca735ad3bc4f977d3c9677)

Author SHA1 Message Date
Daniel Kolesa 9d6c96324a portability, fetch: drop static_deps dependencies
This is not actually needed, and it results in both static and
shared versions of zlib and openssl linked into libapk otherwise,
which is bad.
2022-03-07 13:04:05 +01:00
Daniel Kolesa c5d9aaa1ee adb: fix handling of conflicts
Ensure not to mask away previously set APK_VERSION_CONFLICT when
serializing.

When deserializing, make sure to actually write out the conflict
flag when no version part is set.

When creating apk_dependency, ensure to set the conflict bit
correctly and mask it off result_mask.

Fixes https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10824
2022-03-07 08:26:07 +00:00
Timo Teräs fa913aba4b test: fix tests by setting sane active_layers without state
finally fixes #10821
2022-03-07 10:15:06 +02:00
Daniel Kolesa 1be55db3d0 db: fix APK_OPENF_NO_STATE check
fixes #10821
2022-03-06 18:28:10 +02:00
Timo Teräs 296647e3f9 mkpkg: use -I for --info
-i is already global option

fixes #10822
2022-03-06 16:18:11 +02:00
Timo Teräs b5da1ccf4c mkpkg: check apk_ostream_to_file/adb_compress error
fixes #10823
2022-03-06 16:15:53 +02:00
Timo Teräs 00e397d564 db: honor APK_OPENF_NO_STATE again
Do not call apk_db_read_layer() or try to process the layer
if APK_OPENF_NO_STATE is specified. It might fail because of
non-existing database directory. Based on patch by Daniel.

fixes commit 9e4dd29f "db: prepare database reading for layers"

Fixes #10821

Reported-and-analyzed-by: Daniel Kolesa <daniel@octaforge.org>
2022-03-06 16:07:42 +02:00
Timo Teräs 62bc43d2a4 pkg: use lib/apk/exec as the package script execution directory
var/cache is also reported to be mounted noexec on hardened
systems. Document some of the issues, and use lib/apk/exec
for the time being. Keep the scripts still in separate directory
from lib/apk so we can just delete directory if needed.

fixes #6591
2022-02-24 14:29:38 +02:00
Timo Teräs e4dc2373d6 solver: do not auto select virtual-only package with one provider
This reverts most of 0dcbd933 which allowed automatic selection
of package with a "virtual provides" having only one provider.
While convenient, it creates problems if multiple versions of the
same package exist, or if in future other providers would be added
to one of the repositories. This restore the original behaviour,
and improve the error message to tell the user to mention one of
the providers explicitly.

fixes #10810
2022-02-24 14:18:41 +02:00
Timo Teräs 86d75e10f5 db, uvol: commit regular files before uvol volumes
add priority to order fsdir commit sequence
2022-02-22 14:03:47 +02:00
Timo Teräs 3a194ea5d7 db: fix apkindex path generation
remove the left over apk_blob_push_fmt() call that corrupted uri and
trim the path end from trailing slashes to get original functionality.

fixes commit be4ce407 "support new index format without attaching arch"
2022-02-22 14:02:44 +02:00
Timo Teräs fedaa44546 io_gunzip: fix handling short reads near end-of-file
The gzip library can drain all of the input to internal buffers
and still keep providing data even if avail_in is zero. Previously
it was assumed that avail_in != 0 if there is still data expected out,
but this logic breaks near end-of-file for multiple short reads.

Adjust logic to not process end-of-file event too early.

fixes #10809
2022-02-21 12:36:46 +02:00
Timo Teräs 17f22530a5 fs_fsys: ignore mkdir EEXIST
Be happy if the directory already exists.
2022-02-21 12:10:52 +02:00
ptrcnull b576f08284 tar: allow for space as numeric field terminator 2022-02-21 08:26:20 +00:00
Timo Teräs 3ad4d6bed1 solver: require package layer to be enabled for install 2022-02-21 10:24:05 +02:00
Timo Teräs 21519221c2 adb: add layer to pkginfo 2022-02-21 10:24:05 +02:00
Timo Teräs f69ae30272 db: sort world dependencies to layers 2022-02-21 10:24:05 +02:00
Timo Teräs 9089edcc44 db: prepare database writing for layers 2022-02-21 10:24:05 +02:00
Timo Teräs 9e4dd29f54 db: prepare database reading for layers 2022-02-21 10:24:05 +02:00
Paul Spooren be4ce40797 support new index format without attaching arch
By default the package architecture is attached to the repository url.
With this commit it is possible to define new indexes ending on `.adb`.
If such index file is detected the packages must be in the same folder
as the index.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2022-02-14 17:21:51 +00:00
Daniel Golle aa4880bc04 fs_uvol: take down volume before removal
Make sure volume is in 'down' state before attempting to remove it.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-02-14 17:18:54 +00:00
Daniel Golle 4c568416e3 context: fix 'uvol' default path
'uvol' is installed to /usr/sbin by default. Assume that path if not
set by APK_UVOL environment variable.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-02-13 09:50:50 +01:00
Ariadne Conill 6315575af1 database: fix apk_db_cache_active returning true when cache not configured
this regression was caused by refactoring of the options handling into the
apk_ctx struct in 354713d2, presumably a little too much innovation with sed

fixes #10799
2022-02-03 22:26:57 +00:00
Timo Teräs 6df225eac3 mkpkg, adb: validate version and dependency format
Fail if the package or dependency version format is not valid.

fixes #10807
2022-02-01 14:47:27 +02:00
Thiago Perrotta bd13e774de fix typo on apk-add.8.scd 2022-01-24 00:46:43 -05:00
Timo Teräs b7e3ca22f7 genhelp: fix upper case substition 2022-01-21 14:47:54 +02:00
Timo Teräs 10d0043063 cache: allow various flags, and addition of dependencies
Allow controlling 'cache download' more closely to 'upgrade' so
it can be used to pre-download packages for ugprade.
2022-01-21 14:36:31 +02:00
Timo Teräs a2cd188039 package: fail on invalid control data
Handle meta data error to produce hard failure.

fixes #10806
2022-01-17 10:55:37 +02:00
Ariadne Conill e8650d4d44 support building with uncompressed help databases 2022-01-13 14:13:53 +00:00
Ariadne Conill 3d41d1c90a package: factor out /dev initialization to linux-specific helper function 2021-12-29 20:38:40 +02:00
Ariadne Conill 10b26851a4 database: refactor mounting and unmounting /proc 2021-12-29 20:37:28 +02:00
Ariadne Conill dfe2e141ca database: relocate find_mountpoint() 2021-12-29 20:37:28 +02:00
Ariadne Conill ae4008c4f2 database: refactor cache remounting 2021-12-29 20:37:28 +02:00
Ariadne Conill 4fa6a9fd73 database: refactor tmpfs root detection and cache setup 2021-12-29 20:37:25 +02:00
Ariadne Conill dd1908f2fc portability: add sys/sysmacros.h wrapper for makedev/major/minor 2021-12-29 20:14:41 +02:00
Ariadne Conill 837d2fd915 portability: include environ in overlaid unistd.h 2021-12-29 20:14:41 +02:00
Ariadne Conill e6b1b29028 portability: implement pipe2 and mknodat 2021-12-29 20:14:41 +02:00
Ariadne Conill fade8b1ef2 ci: use meson on debian, not legacy build system 2021-12-29 20:14:41 +02:00
Ariadne Conill 2c3cef8787 portability: take over strlcpy 2021-12-29 20:14:41 +02:00
Ariadne Conill 03a5e6d9b9 io: use opendirectory for UID/GID lookups on macOS
macOS has no concept of a chroot-specific UID/GID database, as the database is actually
LDAP.

ref #10794
2021-12-29 20:14:41 +02:00
Ariadne Conill 9d07d07fe4 abstract differences between GNU and Apple xattr functions 2021-12-29 20:14:41 +02:00
Ariadne Conill 6344a0eedb database: isolate linux-specific mountpoint headers 2021-12-29 20:14:41 +02:00
Ariadne Conill de15d4adbb legacy build system: include libportability headers 2021-12-29 20:14:41 +02:00
Ariadne Conill cbdc4e9f25 portability: add endian.h wrapper 2021-12-29 20:14:38 +02:00
Ariadne Conill a7a0c0a6ca portability: implement skeleton with memrchr function 2021-12-29 20:11:17 +02:00
Timo Teräs 9ed4785f1c apk_adb: add missing compare functions
fixes #10803
2021-12-29 19:36:34 +02:00
Ariadne Conill 8d5784aaf5 database: use SA_RESETHAND instead of SA_ONESHOT when registering a SIGALRM handler
SA_ONESHOT is a GNU-specific alias for POSIX SA_RESETHAND.
2021-12-29 10:36:59 +02:00
Paul Spooren 0b1b090f02 gitignore: add build/
The folder is commonly used for meson, ignore it.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2021-12-29 07:53:17 +00:00
Ariadne Conill 2a9c0277c0 use fstatat, not fstatat64
the stat64 family of functions were provided as transitional functions,
but when building on glibc with _GNU_SOURCE, or any other supported system,
the stat functions are equivalent to their stat64 counterparts
2021-12-29 07:52:48 +00:00
Ariadne Conill 336a133b76 meson: define _FILE_OFFSET_BITS=64 for glibc 2021-12-29 07:52:48 +00:00