From 291b0ebf126de9961cd2f8dd1cea2654c57a594a Mon Sep 17 00:00:00 2001 From: whh4git <44186125+whh4git@users.noreply.github.com> Date: Thu, 24 Oct 2024 00:44:32 +0800 Subject: [PATCH] change to centos-vault and centos-stream (#72) Co-authored-by: whh4git --- common/libc.sh | 31 +++++++++++++++++++++++++++++++ get | 19 +++++++++++++++++-- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/common/libc.sh b/common/libc.sh index 042d6f4..067f85e 100644 --- a/common/libc.sh +++ b/common/libc.sh @@ -252,6 +252,37 @@ requirements_centos() { return 0 } +# ===== CentOS-Stream ===== # + +get_from_fullfiletimelist() { + local info=$1 + local website=$2 + local pkg=$3 + local arch=$4 + echo "Getting package $pkg locations" + local url="" + for i in $(seq 1 3); do + urls=$(wget "$website/fullfiletimelist" -O - 2>/dev/null \ + | grep -h "$pkg-[0-9]" \ + | grep -h "$arch\.rpm" \ + | awk '{print $4}') + [[ -z "$urls" ]] || break + echo "Retrying..." + sleep 1 + done + [[ -n "$urls" ]] || die "Failed to get package version" + for url in $urls + do + get_rpm "$website/$url" "$info" "$pkg" + sleep .1 + done +} + +requirements_centos_stream() { + which awk 1>/dev/null 2>&1 || return + requirements_centos || return + return 0 +} # ===== Arch ===== # diff --git a/get b/get index e3e3ffd..3cb0aa1 100755 --- a/get +++ b/get @@ -49,8 +49,16 @@ categories[cntr_category]="centos" requirements["centos"]="requirements_centos" cntr_category=$((cntr_category + 1)) centos() { - get_from_filelistgz centos-glibc http://mirror.centos.org/centos/ glibc i686 - get_from_filelistgz centos-glibc http://mirror.centos.org/centos/ glibc x86_64 + get_from_filelistgz centos-glibc https://vault.centos.org/ glibc i686 + get_from_filelistgz centos-glibc https://vault.centos.org/ glibc x86_64 +} + +categories[cntr_category]="centos_stream" +requirements["centos_stream"]="requirements_centos_stream" +cntr_category=$((cntr_category + 1)) +centos_stream() { + get_from_fullfiletimelist centos-glibc https://mirror.stream.centos.org/ glibc i686 + get_from_fullfiletimelist centos-glibc https://mirror.stream.centos.org/ glibc x86_64 } categories[cntr_category]="arch" @@ -82,6 +90,13 @@ alpine() { v3.10 v3.11 v3.12 + v3.13 + v3.14 + v3.15 + v3.16 + v3.17 + v3.18 + v3.19 ) for version in "${alpine_versions[@]}"; do