llvm-apt: follow redirection when fetch codenames
Some checks failed
docker-images / multi (., tunasync-scripts) (push) Has been cancelled
docker-images / multi (bandersnatch) (push) Has been cancelled
docker-images / multi (dockerfiles/rubygems, rubygems-mirror) (push) Has been cancelled
docker-images / multi (ftpsync) (push) Has been cancelled
docker-images / multi (nix-channels) (push) Has been cancelled
docker-images / multi (pub-mirror) (push) Has been cancelled
docker-images / multi (rustup-mirror) (push) Has been cancelled
docker-images / multi (shadowmire) (push) Has been cancelled
docker-images / multi (tsumugu) (push) Has been cancelled

This commit is contained in:
Miao Wang 2025-03-20 16:37:49 +08:00
parent d5e564ff48
commit 79b33ae3b0

View File

@ -13,7 +13,7 @@ export REPO_SIZE_FILE=/tmp/reposize.$RANDOM
function get_codenames() {
local os=$1
local dist_meta_url="${BASE_URL}/${os}/conf/distributions"
local codenames=$(curl -s $dist_meta_url 2>/dev/null | grep -oP '^Codename: \K.*' | tr '\n' ',' | sed 's/,$//')
local codenames=$(curl -sSfL $dist_meta_url 2>/dev/null | grep -oP '^Codename: \K.*' | tr '\n' ',' | sed 's/,$//')
if [ -z "$codenames" ]; then
echo "Unable to fetch codename from $dist_meta_url, using default" >&2
prefix=llvm-toolchain-$os