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)
Thu, Jun 4, 12:06 PM
Unknown Object (File)
Sun, May 31, 11:34 AM
Unknown Object (File)
Sun, May 31, 11:30 AM
Unknown Object (File)
Wed, May 27, 2:16 PM
Unknown Object (File)
Wed, May 27, 2:09 PM
Unknown Object (File)
Tue, May 26, 3:05 AM
Unknown Object (File)
Tue, May 26, 3:01 AM
Unknown Object (File)
Sun, May 17, 8: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 Skipped
Unit
Tests Skipped
Build Status
Buildable 72592
Build 69475: arc lint + arc unit

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

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

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.