jobs: before scheduling a DELETE jobs verify if it is really needed
When scheduling a delete job for a install/upgrade (post solver) verify
dependency are still statisfied and no conflicts with installed packages
both both conditions are met and the package wasn't explicitly request
deletion then the package is keept
Fixes: #2566, #1705
updating: support glob patterns in user-provided port names
The matcher() function only applied glob-to-regex conversion to patterns
found in the AFFECTS line of UPDATING, but never to the port names
provided by the user on the command line. This meant that
"pkg updating 'lang/php7*'" would fail to match an UPDATING entry about
lang/php74-imagick because the origin was compared with strcmp().
Replace the matching logic with fnmatch() applied in both directions:
the AFFECTS word as a pattern against the origin, and the origin as a
pattern against the AFFECTS word. This covers *, ? and [...] globs on
either side. A regex fallback is kept for {a,b} brace expansion and
(a|b) alternation syntax which fnmatch() does not support.
The regex_cache is removed since fnmatch() requires no precompilation.
Fixes: #1786
audit: innitialize rc to prevent arithmetic error when stat succeed
reset rc after the fetch decision block so a missing does not cause
the function to return 3
Fixes: #2153
pkg_add: remove existing file before renaming temp directory
When extracting a package, if a file or symlink exists at the
target path of a temporary directory, renameat() fails. This can
happen when a package replaces a symlink with a real directory
(e.g., symlink-to-directory transitions between package versions).
Remove the existing entry before the rename, matching the logic
already applied for regular files later in pkg_extract_finalize().
Fixes: #2041
install: small behaviour change!
pkg install foo
if foo is already installed and marked a automatic will propose
to mark it as non automatic
pkg install -A foo
if foo is already installed and marked as non automatic will propose
to mark it as automatic
Fixes: #1090
pkgdb_close: remove sqlite3_shutdown
pkgdb_close already clean enough, sqlite3_shutdown is not threadsafe
and supposed to be called only once while pkgdb_close can be called
multiple times