cvmfs.sh: update with more elegant generation

Signed-off-by: Harry Chen <i@harrychen.xyz>
This commit is contained in:
Harry Chen 2025-04-13 22:14:04 +08:00
parent 9ed2058d50
commit a7160780e2
No known key found for this signature in database

View File

@ -14,9 +14,37 @@ APT_PATH="${BASE_PATH}/apt"
YUM_PATH="${BASE_PATH}/yum"
export REPO_SIZE_FILE=/tmp/reposize.$RANDOM
# CERN keeps only maintained versions of CVMFS
ubuntu_os=(noble jammy focal)
debian_os=(bookworm bullseye buster)
deb_suffixes=(prod)
declare -a debian_dists=()
declare -a ubuntu_dists=()
for deb_os in "${debian_os[@]}"; do
for suffix in "${deb_suffixes[@]}"; do
debian_dists+=("${deb_os}-${suffix}")
done
done
for ubuntu_os in "${ubuntu_os[@]}"; do
for suffix in "${deb_suffixes[@]}"; do
ubuntu_dists+=("${ubuntu_os}-${suffix}")
done
done
function join_by { local IFS="$1"; shift; echo "$*"; }
ubuntu_dists_list=$(join_by ',' ${ubuntu_dists[@]})
debian_dists_list=$(join_by ',' ${debian_dists[@]})
echo "All Ubuntu codenames: $ubuntu_dists_list"
echo "All Debian codenames: $debian_dists_list"
# =================== APT repos ===============================
"$apt_sync" --delete "${BASE_URL}/apt" bionic-prod,bookworm-prod,bullseye-prod,buster-prod,focal-prod,jammy-prod,jessie-prod,noble-prod,precise-prod,stable,stretch-prod,trusty-prod,xenial-prod main i386,amd64 "$APT_PATH"
echo "APT finished"
"$apt_sync" --delete "${BASE_URL}/apt" "$ubuntu_dists_list" main amd64,i386,amd64 "$APT_PATH"
echo "Ubuntu finished"
"$apt_sync" --delete "${BASE_URL}/apt" "$debian_dists_list" main amd64,i386,amd64 "$APT_PATH"
echo "Debian finished"
# =================== YUM/DNF repos ==========================
"$yum_sync" "${BASE_URL}/yum/@{comp}/EL/@{os_ver}/@{arch}" 6-9 cvmfs,cvmfs-config,cvmfs-kernel aarch64,i386,ppc64le,x86_64 "@{comp}-EL@{os_ver}-@{arch}" "$YUM_PATH"