Page MenuHomeFreeBSD

packages: Make create-sets.sh more robust
ClosedPublic

Authored by ivy on Apr 28 2026, 1:40 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Aug 29, 9:59 AM
Unknown Object (File)
Fri, Aug 28, 9:09 PM
Unknown Object (File)
Thu, Aug 27, 3:28 PM
Unknown Object (File)
Tue, Aug 25, 2:38 PM
Unknown Object (File)
Sat, Aug 22, 9:16 AM
Unknown Object (File)
Wed, Aug 19, 7:59 AM
Unknown Object (File)
Tue, Aug 18, 7:40 PM
Unknown Object (File)
Sun, Aug 16, 9:43 AM
Subscribers

Details

Summary

Use ${PKG_CMD} rather than bare 'pkg' to fix the build when pkg is
not in the tools path. Provide a default in case it's not set for
some reason (e.g., running the script by hand).

Since set -- $(...) does not trigger an exit from set -e if the
command fails, this failure was silent and resulted in sets not
being built correctly if we failed to run pkg. Use a temporary
variable, which does trigger set -e, to fail correctly.

MFC after: 2 weeks
Sponsored by: https://www.patreon.com/bsdivy

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ivy requested review of this revision.Apr 28 2026, 1:40 AM
sjg added inline comments.
release/packages/create-sets.sh
29

the quotes are unnecessary fwiw

48–49

again fwiw the outer quotes are not required
is the switch to 2 steps just to aid debugging ? i don't see _tmp used elsewhere

release/packages/create-sets.sh
48–49

the reason is that this does not trigger set -e:

set -- $(nonesuch)

while this does:

_tmp=$(nonesuch)
set -- $_tmp

so we need this to fail properly if $(nonesuch) fails, which in this case it will if $PKG_CMD isn't found for some reason.

This revision is now accepted and ready to land.Apr 28 2026, 7:30 PM
This revision was automatically updated to reflect the committed changes.