Page MenuHomeFreeBSD

packages: Make create-sets.sh more robust during release
ClosedPublic

Authored by ivy on Mon, May 4, 3:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 20, 3:20 PM
Unknown Object (File)
Wed, May 20, 3:47 AM
Unknown Object (File)
Wed, May 20, 2:31 AM
Unknown Object (File)
Tue, May 19, 1:16 PM
Unknown Object (File)
Tue, May 19, 1:11 PM
Unknown Object (File)
Tue, May 19, 6:33 AM
Unknown Object (File)
Tue, May 19, 3:53 AM
Unknown Object (File)
Tue, May 19, 3:34 AM
Subscribers

Details

Summary

Commit d1c176fedfc9 made create-sets.sh exit when it encounters an
error, instead of creating an empty repository. However, this turns
out to cause some issues:

  1. A package not having any sets is considered an error, but during the release build, we stuff a 'pkg' package into the repository which doesn't have any sets, which causes a failure. Avoid this by simply ignoring the pkg package.
  1. No error was printed in this case, which made the problem hard to diagnose. Add an explicit error message.
  1. A similar problem occurred running on a repository which already contained sets, which is not usually done during the build, but is not necessarly an inappropriate thing to do. Fix this one by ignoring set packages when looking for sets.

While here, fix another issue that might cause packages to be wrongly
skipped if the path to the repository contains a '-' character, since
we didn't strip the path before testing the package name.

PR: 294966
Fixes: d1c176fedfc9 ("packages: Make create-sets.sh more robust")
MFC after: 2 weeks
Reported by: Alastair Hogge <agh@riseup.net>
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.Mon, May 4, 3:12 PM
emaste added a subscriber: emaste.

LGTM, a couple of possibly bikesheddy comments that you can consider if you like

release/packages/create-sets.sh
41

one line while; do case feels non-stylistic to me, although I see the appeal and don't insist on changing it

50

was going to suggest this can be done with echo as it is a builtin, but TIL printf is bulitin also.

63

echo "${pkg##*/}" | grep feels overly repetitive, could case ${pkg##*/} in make this cleaner?

This revision is now accepted and ready to land.Mon, May 4, 3:22 PM
ivy marked 3 inline comments as done.

rf

This revision now requires review to proceed.Mon, May 4, 3:38 PM
release/packages/create-sets.sh
41

i was trying to avoid an extra level of indent, but when i went to look at what style.sh(5) says about this, i found that it doesn't exist. but, based on our C style, it's probably more idiomatic to not indent the case labels.

50

no one should ever use echo, i don't think there are any two shells where it works in quite the same way. :-)

63

yes, this is better.

This revision is now accepted and ready to land.Mon, May 4, 3:41 PM