diff --git a/tools/userland.sh b/tools/userland.sh index 63a9a3fdaa..7276109b22 100755 --- a/tools/userland.sh +++ b/tools/userland.sh @@ -256,19 +256,18 @@ make_repo() # (tools/pkg-binaries.sh), 935 MB that a run must not throw away: this used # to be an `rm -rf $out', so every release deleted the download and fetched # it again (measured 2026-11-23 on the MacBook, four runs of 20 minutes). - # What is cleared is the repository's own set from an earlier run, and - # .fetch-files says which files are not it. + # What is cleared is exactly what this function copied last time, listed in + # .repo-files. It used to consult .fetch-files for that, but that manifest + # is written one level up ($ARCH, not $ARCH/All): it was never found here, + # every .tgz looked foreign, and the whole download was deleted anyway + # (measured 2026-11-23: 282 packages gone, then perl missing for automake). mkdir -p "$out" - if [ -f "$out/.fetch-files" ]; then - for f in "$out"/*.tgz; do - [ -f "$f" ] || continue - b=${f##*/} - awk -v b="$b" '$1 == b { found = 1 } END { exit !found }' \ - "$out/.fetch-files" || rm -f "$f" - done - else - rm -f "$out"/*.tgz + if [ -f "$out/.repo-files" ]; then + while read -r b; do + [ -n "$b" ] && rm -f "$out/$b" + done < "$out/.repo-files" fi + : > "$out/.repo-files" missing= # The run-time closure. A package's +CONTENTS names its own run-time # dependencies as "@pkgdep name>=version", and those can depend again: @@ -287,6 +286,7 @@ make_repo() return 0 fi cp "$TOP/build/packages/All/$1.tgz" "$out/" + echo "$1.tgz" >> "$out/.repo-files" } for p in $repo; do n=$(cd "$PKGSRC/$p" && "$BMAKE" -V '${PKGNAME}')