debug: implement PKG_DEBUG_FLAGS
Instead of having level which ends up being way too verbose, welcome
flags, which will be only per subsistem and allow fine grain selection
of the debug messages
pkg -o PKG_DEBUG_FLAGS=flag1,flag2 something
So far the implemented flags are: "none", "fetch", "all"
more to come
extraction: fix an upgrade issue with symlinks becoming directories
many users took the habit to create symlinks from random directories
into another partition when running out of disk space, for this reason
when pkg extracts files it does accept to extract files below a symlink
if this symlink is valid and points to a directory.
The problem is if a package itself provide a symlink to a directory and
then a latter upgrade is providing a directory instead of that symlink.
it results and unsolveable extraction problem for pkg.
From now on, pkg will not accept anymore symlinks not owned by pkg to
exists when extracting files, with the exception of prefix which is
according to the report the number 1 case of symlinks done directly by
users.
1.21.99.1
Changes:
- fix regression in HANDLE_RC_SCRIPTS option (off by default)
- fix processing entries spiner
- fix database path handling for rootdir
- revert a change in vital/lock handling in the solver cause
some vital packages to never be upgraded.
repos: fix database path handling when PKG_DBDIR is overridden
Make pkg_repo_binary_get_filename() return a path relative to the DB
root (usually /var/db/pkg). This fixes consumers which expect that
because they use capsicum-friendly syscalls (faccessat() etc.).
Fixes: 8ecdfa0e2 ("repos: move repos database under /var/db/pkg/repos/<name>/db")
repos: fix database path handling when PKG_DBDIR is overridden
Make pkg_repo_binary_get_filename() return a path relative to the DB
root (usually /var/db/pkg). This fixes consumers which expect that
because they use capsicum-friendly syscalls (faccessat() etc.).
Fixes: 8ecdfa0e2 ("repos: move repos database under /var/db/pkg/repos/<name>/db")
libpkg/pkg_macho.c: use memset instead of bzero
Same commit message as: c3651589cdd2a82de2000d0d0e35a083597472be
Signed-off-by: rilysh <nightquick at proton.me>
libpkg/pkg_audit.c: use memset instead of bzero
Same commit message as: c3651589cdd2a82de2000d0d0e35a083597472be
Signed-off-by: rilysh <nightquick at proton.me>
libpkg/../query.c: use constness, test branch once, and others
* These SQL strings aren't being modified later and generally, they're
just string constants. Use const to explicitly mark them as constants.
* Avoid initializing bsql value with basesql, as if match is MATCH_INTER-
NAL, bsql value have to be set again (previously the value was basesql),
which will use a mov instruction. Use a branch (if..else) to remove that.
* "how" variable is initialized just below, and the function will return
NULL, when none of the case matches with the provided one. So the initia-
lization to NULL is unneeded here.
Signed-off-by: rilysh <nightquick at proton.me>
libpkg/utils.c: use memset instead of bzero
bzero() was deprecated in POSIX.1-2001 and was removed in POSIX.1-2008
specification. For portability reasons, use memset() over bzero(). bzero()
is wrapper function for memset(), and so compilers just replaces it to
memset() to avoid two function calls.
Signed-off-by: rilysh <nightquick at proton.me>