Skip to content

Commit

Permalink
llvm-apt: fetch codenames from upstream, add focal back (fix tuna/iss…
Browse files Browse the repository at this point in the history
…ues#2026)

Signed-off-by: Harry Chen <[email protected]>
  • Loading branch information
Harry-Chen committed Sep 19, 2024
1 parent 23c45fc commit f454850
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions llvm-apt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,22 @@ BASE_URL=${TUNASYNC_UPSTREAM_URL:-"https://apt.llvm.org"}

export REPO_SIZE_FILE=/tmp/reposize.$RANDOM

for os in "jammy" "noble" "bullseye" "bookworm"; do
prefix=llvm-toolchain-$os
"$apt_sync" --delete "$BASE_URL/$os" $prefix,$prefix-9,$prefix-10,$prefix-11,$prefix-12,$prefix-13,$prefix-14,$prefix-15,$prefix-16,$prefix-17,$prefix-18,$prefix-19 main amd64,arm64 "$BASE_PATH/$os"
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/,$//')
if [ -z "$codenames" ]; then
echo "Unable to fetch codename from $dist_meta_url, using default" >&2
prefix=llvm-toolchain-$os
codenames="$prefix,$prefix-18,$prefix-19"
fi
echo "Codenames for $os: $codenames" >&2
echo $codenames
}

for os in "focal" "jammy" "noble" "bullseye" "bookworm"; do
codenames=$(get_codenames $os)
"$apt_sync" --delete "$BASE_URL/$os" "$codenames" "$BASE_PATH/$os"
done

echo "APT finished"
Expand Down

0 comments on commit f454850

Please sign in to comment.