fix(cublas): redirect diagnostic echo to stderr in download_verified_pkg

Echo messages captured in stdout polluted the return value of
download_verified_pkg(), causing extract_deb() to receive a
multi-line string instead of a file path and silently exit via set -e.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-26 20:22:39 +03:00
parent fc5c2019aa
commit d69a46f211

View File

@@ -77,26 +77,26 @@ download_verified_pkg() {
if [ -f "$out" ]; then if [ -f "$out" ]; then
actual_sha="$(sha256sum "$out" | awk '{print $1}')" actual_sha="$(sha256sum "$out" | awk '{print $1}')"
if [ "$actual_sha" = "$repo_sha" ]; then if [ "$actual_sha" = "$repo_sha" ]; then
echo "=== using cached $(basename "$repo_file") ===" echo "=== using cached $(basename "$repo_file") ===" >&2
printf '%s\n' "$out" printf '%s\n' "$out"
return 0 return 0
fi fi
echo "=== removing stale $(basename "$repo_file") (sha256 mismatch) ===" echo "=== removing stale $(basename "$repo_file") (sha256 mismatch) ===" >&2
rm -f "$out" rm -f "$out"
fi fi
echo "=== downloading $(basename "$repo_file") ===" echo "=== downloading $(basename "$repo_file") ===" >&2
wget --show-progress -O "$out" "${REPO_BASE}/$(basename "$repo_file")" wget --show-progress -O "$out" "${REPO_BASE}/$(basename "$repo_file")"
actual_sha="$(sha256sum "$out" | awk '{print $1}')" actual_sha="$(sha256sum "$out" | awk '{print $1}')"
if [ "$actual_sha" != "$repo_sha" ]; then if [ "$actual_sha" != "$repo_sha" ]; then
echo "ERROR: sha256 mismatch for $(basename "$repo_file")" echo "ERROR: sha256 mismatch for $(basename "$repo_file")" >&2
echo " expected: $repo_sha" echo " expected: $repo_sha" >&2
echo " actual: $actual_sha" echo " actual: $actual_sha" >&2
rm -f "$out" rm -f "$out"
exit 1 exit 1
fi fi
echo "sha256 OK: $(basename "$repo_file")" echo "sha256 OK: $(basename "$repo_file")" >&2
printf '%s\n' "$out" printf '%s\n' "$out"
} }