From 3c3eb598130be7e3ef80279fd02c25b34f42e6c1 Mon Sep 17 00:00:00 2001 From: lotherk Date: Mon, 23 Nov 2026 17:29:55 +0000 Subject: [PATCH] pkg-binaries: the manifest is written once, before the download The second loop wrote $tmp/files again, so .fetch-files had two lines per package (measured 2026-11-23 on the MacBook: 564 lines for 282 packages). Its size lookup then read the wrong record and threw away the archives it had just fetched. --- tools/pkg-binaries.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/pkg-binaries.sh b/tools/pkg-binaries.sh index 7c8ca6bdd6..16941a5579 100755 --- a/tools/pkg-binaries.sh +++ b/tools/pkg-binaries.sh @@ -215,7 +215,9 @@ stale= while read -r p; do file=$(awk -F'\t' -v p="$p" '$1 == p { print $3 }' "$tmp/index") size=$(awk -F'\t' -v p="$p" '$1 == p { print $2 }' "$tmp/index") - echo "$file $size" >> "$tmp/files" + # The manifest was written above, before the first download; writing it + # again here doubled every line (measured 2026-11-23: 564 lines for 282 + # packages on the MacBook). dst=$OUT/All/$file have=$({ wc -c < "$dst"; } 2>/dev/null | tr -d ' ') if [ "${have:-0}" != "$size" ]; then