From e912180e8d8ca2b9d8e1adc3cf4f7301ea88237f Mon Sep 17 00:00:00 2001 From: magges Date: Sat, 11 Jul 2026 15:14:45 +0000 Subject: [PATCH] Fix two real bugs in the package build scripts, found via a live CI run 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 --- packages/unraid-podman/unraid-podman.SlackBuild | 7 ++++++- scripts/lib/slackbuild-common.sh | 10 ++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/unraid-podman/unraid-podman.SlackBuild b/packages/unraid-podman/unraid-podman.SlackBuild index 071bd12..792a1ad 100755 --- a/packages/unraid-podman/unraid-podman.SlackBuild +++ b/packages/unraid-podman/unraid-podman.SlackBuild @@ -28,7 +28,12 @@ REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" # shellcheck source=/dev/null . "$REPO_ROOT/versions.env" -VERSION=$(grep -oP '(?<= from $REPO_ROOT/plugin/podman.plg" >&2 exit 1 diff --git a/scripts/lib/slackbuild-common.sh b/scripts/lib/slackbuild-common.sh index 505817b..3627a47 100755 --- a/scripts/lib/slackbuild-common.sh +++ b/scripts/lib/slackbuild-common.sh @@ -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" }