bin/fetch_source_archive.sh: Use Heads package names when they differ

Use the Heads name for a package when it differs from the primary
source.  E.g. musl-cross-make's archive is just <hash>.tar.gz, which
makes little sense out of context.  musl-cross-<hash>.tar.gz makes
more sense for a mirror.

Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
This commit is contained in:
Jonathon Hall 2024-01-05 13:17:01 -05:00
parent 3a93b30d5b
commit 29203782f6
No known key found for this signature in database
GPG Key ID: 1E9C3CA91AE25114

View File

@ -56,7 +56,11 @@ download "$URL" && exit 0
# Shuffle the mirrors so we try each equally # Shuffle the mirrors so we try each equally
readarray -t BACKUP_MIRRORS < <(shuf -e "${BACKUP_MIRRORS[@]}") readarray -t BACKUP_MIRRORS < <(shuf -e "${BACKUP_MIRRORS[@]}")
archive="$(basename "$URL")" # The mirrors use our archive names, which may differ from the primary source
# (e.g. musl-cross-make archives are just <hash>.tar.gz, makes more sense to use
# musl-cross-<hash>.tar.gz). This also means mirrors can be seeded directly
# from the packages/<arch>/ directories.
archive="$(basename "$FILE")"
echo "Try mirrors for $archive" >&2 echo "Try mirrors for $archive" >&2
for mirror in "${BACKUP_MIRRORS[@]}"; do for mirror in "${BACKUP_MIRRORS[@]}"; do