Fix two real bugs in the package build scripts, found via a live CI run
Build Packages / Build .txz packages (push) Failing after 5m5s
Lint / ShellCheck (push) Successful in 13s
Lint / Validate .plg XML (push) Successful in 9s
Lint / EditorConfig (push) Successful in 4s

The toolchain bootstrap fixes finally got build-packages.sh far enough
to attempt actual package builds, surfacing two genuine bugs (not
environment/toolchain issues) in task 80's log:

1. sb_fetch_and_verify() echoed its "Fetching..."/"SHA256 verified..."
   progress messages to stdout, same stream its return value (the
   tarball path) is returned on. Every caller captures that return value
   via `tarball=$(sb_fetch_and_verify ...)`, so command substitution
   swallowed the progress lines into $tarball too, and the resulting
   multi-line garbage got handed to `tar -xf` as a single bogus
   filename. Fixed by sending the progress echoes to stderr.

2. unraid-podman.SlackBuild read plugin/podman.plg's version via
   `grep -oP` with a variable-length lookbehind ({1,10} to match
   flexible whitespace). PCRE requires fixed-length lookbehind; this
   works on a PCRE2 grep (e.g. most dev machines) but fails outright
   ("lookbehind assertion is not fixed length") on Slackware's PCRE1
   grep. Replaced with a portable sed capture group.

Both verified directly against vbatts/slackware:15.0 on the runner host
before this commit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-11 15:14:45 +00:00
co-authored by Claude Sonnet 5
parent 3133d45d74
commit e912180e8d
2 changed files with 14 additions and 3 deletions
+8 -2
View File
@@ -68,7 +68,13 @@ sb_fetch_and_verify() {
local dest_name="$3"
local dest_path="$TMP/$dest_name"
echo "==> [$PRGNAM] Fetching $url"
# All progress/diagnostic output here must go to stderr, not stdout:
# callers capture this function's return value via `tarball=$(sb_fetch_and_verify ...)`,
# and command substitution captures everything written to stdout — a
# stray stdout echo above the final `echo "$dest_path"` would get
# concatenated into that captured value instead of just printing to the
# log.
echo "==> [$PRGNAM] Fetching $url" >&2
curl -fL --retry 3 --retry-delay 2 -o "$dest_path" "$url"
local actual_sha256
@@ -84,7 +90,7 @@ sb_fetch_and_verify() {
exit 1
fi
echo "==> [$PRGNAM] SHA256 verified ($actual_sha256)"
echo "==> [$PRGNAM] SHA256 verified ($actual_sha256)" >&2
echo "$dest_path"
}