diff --git a/tools/pkg-binaries.sh b/tools/pkg-binaries.sh index 5acd805bf2..6f6407ebf9 100755 --- a/tools/pkg-binaries.sh +++ b/tools/pkg-binaries.sh @@ -196,6 +196,7 @@ echo "pkg-binaries: $ARCH $BRANCH: $(wc -l < "$tmp/pkgs" | tr -d ' ') packages, [ "$CMD" = fetch ] || exit 0 fail=0 +stale= : > "$tmp/files" while read -r p; do file=$(awk -F'\t' -v p="$p" '$1 == p { print $3 }' "$tmp/index") @@ -207,7 +208,12 @@ while read -r p; do curl -s -f -m 1800 -o "$dst.part" "$REPO/$file" || { echo "FAIL: $file"; fail=1; continue; } mv "$dst.part" "$dst" have=$(wc -c < "$dst" | tr -d ' ') - [ "$have" = "$size" ] || { echo "FAIL: $file is $have bytes, want $size"; fail=1; } + # The summary is cached, and the project rebuilds the quarterly branch + # under it: an archive whose size differs from the summary's is a + # newer build, not a damaged download (measured 2026-11-23: 24 of 282 + # packages, the cached summary of 2026-11-19). Drop the bad file and + # the summary, so the next run reads the current one. + [ "$have" = "$size" ] || { echo "FAIL: $file is $have bytes, want $size"; rm -f "$dst"; stale=1; fail=1; } fi done < "$tmp/pkgs" @@ -217,7 +223,11 @@ zcat "$SUMMARY" | awk -v list="$tmp/pkgs" ' /^PKGNAME=/ { keep = (substr($0, 9) in want) } keep ' | gzip -9n > "$OUT/All/pkg_summary.gz" -[ $fail -eq 0 ] || { rm -f "$OUT/.fetch-key"; die "some packages failed"; } +if [ $fail -ne 0 ]; then + rm -f "$OUT/.fetch-key" + [ -z "${stale:-}" ] || { rm -f "$SUMMARY"; echo "pkg-binaries: the cached summary is out of date and was removed; run again"; } + die "some packages failed" +fi # what this fetch put here, for the next run to see that nothing changed cp "$tmp/files" "$OUT/.fetch-files" printf '%s\n' "$fetchkey" > "$OUT/.fetch-key"