pkgng/pkgng b67e56flibpkg pkg_jobs.c

pkg_autoremove/force delete: Fix order

If package A depends on package B (on a binary or script for example), when
autoremove is called currently the order is (likely) by alphabetic.
This cause problems as if package A is removed first and package B needs a script
from package A it will fails to clean up correctly the system.
Since autoremove is considered as force internally simply remove the check so we will
process the removals in the correct order.

Sponsored by:   Beckhoff Automation GmbH & Co. KG
DeltaFile
+0-3libpkg/pkg_jobs.c
+0-31 files

pkgng/pkgng e4add1elibpkg pkg_jobs.c

pkg_autoremove/force delete: Fix order

If package A depends on package B (on a binary or script for example), when
autoremove is called currently the order is (likely) by alphabetic.
This cause problems as if package A is removed first and package B needs a script
from package A it will fails to clean up correctly the system.
Since autoremove is considered as force internally simply remove the check so we will
process the removals in the correct order.

Sponsored by:   Beckhoff Automation GmbH & Co. KG
DeltaFile
+0-3libpkg/pkg_jobs.c
+0-31 files

pkgng/pkgng 851d081libpkg pkg_jobs.c

pkg_autoremove: Fix order

If package A depends on package B (on a binary or script for example), when
autoremove is called currently the order is (likely) by alphabetic.
This cause problems as if package A is removed first and package B needs a script
from package A it will fails to clean up correctly the system.
Since autoremove is considered as force internally simply extend the check so we will
process the removals in the correct order.

Sponsored by:   Beckhoff Automation GmbH & Co. KG
DeltaFile
+1-1libpkg/pkg_jobs.c
+1-11 files

pkgng/pkgng 1d75060. NEWS auto.def

2.5.99.3
DeltaFile
+5-0NEWS
+1-1auto.def
+6-12 files

pkgng/pkgng b3bdad1tests/frontend upgrade.sh

Revert "test: add a unit test about extract optimisation"

This reverts commit 462a91c84f09fefcbc74117e212633b973169cbc.
DeltaFile
+0-44tests/frontend/upgrade.sh
+0-441 files

pkgng/pkgng a39a76elibpkg pkg_add.c

Revert "extract: do not extract a file which is identical to the installed one"

This reverts commit 571674223c5f92cfe168967b81c7d8e71ed168da.
DeltaFile
+0-19libpkg/pkg_add.c
+0-191 files

pkgng/pkgng e1928d6libpkg pkg_add.c

hardlinks: add an explicit error in failing case
DeltaFile
+21-1libpkg/pkg_add.c
+21-11 files

pkgng/pkgng dc198c7libpkg pkg_jobs.c

jobs: plug a memory leak
DeltaFile
+4-1libpkg/pkg_jobs.c
+4-11 files

pkgng/pkgng 910336flibpkg pkg_jobs.c

jobs: prevent double fetch
DeltaFile
+1-1libpkg/pkg_jobs.c
+1-11 files

pkgng/pkgng 041107elibpkg pkg_jobs.c

jobs: fix NULL dereference
DeltaFile
+2-0libpkg/pkg_jobs.c
+2-01 files

pkgng/pkgng 666f91alibpkg pkg_jobs_universe.c

universe: fix inverted logic
DeltaFile
+2-2libpkg/pkg_jobs_universe.c
+2-21 files

pkgng/pkgng 9eabdf5. NEWS auto.def

2.5.99.2
DeltaFile
+7-0NEWS
+1-1auto.def
+8-12 files

pkgng/pkgng 9ebf1d2libpkg pkgdb.c

pkgdb: skip WAL journal mode on read-only databases

PRAGMA journal_mode = WAL requires write access to create the -wal and
-shm sidecar files. When pkg-static runs as an unprivileged user (e.g.
nobody during poudriere's package phase), the local database is opened
read-only and the WAL pragma fails with "attempt to write a readonly
database".

This caused actual-package-depends to fail silently, producing packages
with missing dependencies. For example, gmake was packaged without its
gettext-runtime dependency, leading to "libintl.so.8 not found" errors
when gmake was later installed as a build dependency.

Use sqlite3_db_readonly() to check the connection mode before attempting
to enable WAL, consistent with other read-only guards in pkgdb.c.

Fixes: a7ccf3c03e92 ("pkgdb: enable WAL journal mode for local databases")
Reported-by: https://github.com/freebsd/pkg/issues/2605
DeltaFile
+2-1libpkg/pkgdb.c
+2-11 files

pkgng/pkgng 17cf2e8libpkg pkgdb.c

pkgdb: open read-only databases in immutable mode to fix WAL access

When pkg enables WAL journal mode on the local database (during a
write-access session), the mode is persisted in the database header.
Subsequent read-only opens (e.g. as nobody during poudriere's package
phase) fail because WAL requires -shm/-wal sidecar files which cannot
be created without write access, causing all queries to fail — including
read-only ones like PRAGMA user_version.

This caused actual-package-depends to fail silently, producing packages
with missing dependencies. For example, gmake was packaged without its
gettext-runtime dependency, leading to "libintl.so.8 not found" errors.

Fix by opening the database with sqlite3_open_v2() and immutable=1 URI
parameter when write access is not available. Immutable mode tells
SQLite to bypass WAL/SHM entirely and read directly from the main
database file, which contains all committed data after the last
writer's checkpoint.
DeltaFile
+19-1libpkg/pkgdb.c
+19-11 files

pkgng/pkgng cafe79flibpkg pkgdb.c

pkgdb: open read-only databases in immutable mode to fix WAL access

When pkg enables WAL journal mode on the local database (during a
write-access session), the mode is persisted in the database header.
Subsequent read-only opens (e.g. as nobody during poudriere's package
phase) fail because WAL requires -shm/-wal sidecar files which cannot
be created without write access, causing all queries to fail — including
read-only ones like PRAGMA user_version.

This caused actual-package-depends to fail silently, producing packages
with missing dependencies. For example, gmake was packaged without its
gettext-runtime dependency, leading to "libintl.so.8 not found" errors.

Fix by opening the database with sqlite3_open_v2() and immutable=1 URI
parameter when write access is not available. Immutable mode tells
SQLite to bypass WAL/SHM entirely and read directly from the main
database file, which contains all committed data after the last
writer's checkpoint.
DeltaFile
+19-1libpkg/pkgdb.c
+19-11 files

pkgng/pkgng 0076750libpkg pkgdb.c

pkgdb: skip WAL journal mode on read-only databases

PRAGMA journal_mode = WAL requires write access to create the -wal and
-shm sidecar files. When pkg-static runs as an unprivileged user (e.g.
nobody during poudriere's package phase), the local database is opened
read-only and the WAL pragma fails with "attempt to write a readonly
database".

This caused actual-package-depends to fail silently, producing packages
with missing dependencies. For example, gmake was packaged without its
gettext-runtime dependency, leading to "libintl.so.8 not found" errors
when gmake was later installed as a build dependency.

Use sqlite3_db_readonly() to check the connection mode before attempting
to enable WAL, consistent with other read-only guards in pkgdb.c.

Fixes: a7ccf3c03e92 ("pkgdb: enable WAL journal mode for local databases")
Reported-by: https://github.com/freebsd/pkg/issues/2605
DeltaFile
+2-1libpkg/pkgdb.c
+2-11 files

pkgng/pkgng bdcacb7. NEWS auto.def

1.5.99.1
DeltaFile
+9-0NEWS
+2-2auto.def
+11-22 files

pkgng/pkgng 462a91ctests/frontend upgrade.sh

test: add a unit test about extract optimisation
DeltaFile
+44-0tests/frontend/upgrade.sh
+44-01 files

pkgng/pkgng 38ed98blibpkg pkg_add.c

Fix EBADF crash

if ftruncate() failes, it uses pkg_errno() which only log the error
instead of pkg_fatal_errno) which return (EPKG_FATAL).

While here fix a fd leak

Fixes: #2279
DeltaFile
+4-2libpkg/pkg_add.c
+4-21 files

pkgng/pkgng f648e3dlibpkg pkg_jobs.c

upgrade: Fix crash in pkg upgrade

when upgrading pkgbase, pkg may try in its plan to remove temporarily
itself, in such case we could reach a crash

Fixes: #2496
DeltaFile
+2-1libpkg/pkg_jobs.c
+2-11 files

pkgng/pkgng 544d62clibpkg pkg.c, tests/frontend create.sh query.sh

reproducibility: fix regression in DL_SORT

STREQ returns a boolean while DL_SORT expect the 3 kind of returns
provided by strcmp to properly sort.

Fixes:  #2427
DeltaFile
+9-9tests/frontend/create.sh
+5-5libpkg/pkg.c
+1-1tests/frontend/query.sh
+15-153 files

pkgng/pkgng 9c40fc5libpkg pkg_manifest.c

url_decode: fix a regression from a4b8871

Fixes: #2480
DeltaFile
+7-7libpkg/pkg_manifest.c
+7-71 files

pkgng/pkgng e6d8ee7libpkg pkg_add.c

add: check for version when running pkg add ./something.pkg

Fixes:  #2599
DeltaFile
+2-1libpkg/pkg_add.c
+2-11 files

pkgng/pkgng cf77f94libpkg pkg_jobs.c

upgrade: multiple fixes on how decisions are taken

- Fix handling of shlibs on non pkgbase system
- Fix bad loop logic which resulted in some shlibs changed not being
  detected
- Remove dead code
DeltaFile
+25-17libpkg/pkg_jobs.c
+25-171 files

pkgng/pkgng 742c0d1libpkg backup_lib.c

libpkg: ensure ignored shlibs loaded before usage

Sponsored by:   The FreeBSD Foundation
Fixes:          32a1ebdbc036c7512ce4f601a98691fd477eaa26
DeltaFile
+6-0libpkg/backup_lib.c
+6-01 files

pkgng/pkgng 2174968libpkg pkg_jobs_universe.c

libpkg/pkg_jobs_universe.c: sprinkle debugs during shlibs tracking
DeltaFile
+26-4libpkg/pkg_jobs_universe.c
+26-41 files

pkgng/pkgng 8725e85libpkg pkg_jobs_universe.c

libpkg/pkg_jobs_universe.c: sprinkle debugs during shlibs tracking
DeltaFile
+26-4libpkg/pkg_jobs_universe.c
+26-41 files

pkgng/pkgng d514868libpkg pkg_add.c

extract: if the renamed failed, keep the extracted file with a .pkgnew suffix
DeltaFile
+9-2libpkg/pkg_add.c
+9-21 files

pkgng/pkgng 5716742libpkg pkg_add.c

extract: do not extract a file which is identical to the installed one
DeltaFile
+19-0libpkg/pkg_add.c
+19-01 files

pkgng/pkgng 8f790d4libpkg pkg_jobs.c

pkg_jobs: try to break potential infinite recursion
DeltaFile
+10-3libpkg/pkg_jobs.c
+10-31 files