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)
Sun, Jul 19, 12:53 AM
Unknown Object (File)
Sat, Jul 18, 11:03 AM
Unknown Object (File)
Wed, Jul 15, 10:40 AM
Unknown Object (File)
Wed, Jul 15, 7:19 AM
Unknown Object (File)
Wed, Jul 15, 7:19 AM
Unknown Object (File)
Mon, Jul 13, 10:30 PM
Unknown Object (File)
Tue, Jul 7, 10:39 AM
Unknown Object (File)
Fri, Jul 3, 3:14 PM
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.