From b75790c6705c9b7c0fe8d48c6f4553bcb7eba946 Mon Sep 17 00:00:00 2001 From: Alex11 <73743056+Alex6357@users.noreply.github.com> Date: Mon, 28 Oct 2024 18:24:53 +0800 Subject: [PATCH] freebsd-pkg: get channel list before fetching packagesite.txz --- freebsd-pkg/sync.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/freebsd-pkg/sync.sh b/freebsd-pkg/sync.sh index 3f3ecd7..62ba221 100755 --- a/freebsd-pkg/sync.sh +++ b/freebsd-pkg/sync.sh @@ -5,7 +5,7 @@ source /curl-helper.sh FBSD_PKG_UPSTREAM=${FBSD_PKG_UPSTREAM:-"http://pkg.freebsd.org"} -FBSD_PKG_EXCLUDE=${FBSD_PKG_EXCLUDE:-"^FreeBSD:[89]:"} +FBSD_PKG_EXCLUDE=${FBSD_PKG_EXCLUDE:-"^FreeBSD:([0-9]+:(?!amd64|i386|aarch64)[a-z0-9]+$)"} FBSD_PKG_JOBS=${FBSD_PKG_JOBS:-1} FBSD_PLATFORMS=$(mktemp) export PARALLEL_SHELL=/bin/bash @@ -85,7 +85,10 @@ if [[ ${PIPESTATUS[0]} -ne 0 ]]; then fi while read platform; do - for channel in latest quarterly base_latest base_weekly base_release_0 base_release_1; do + echo "[INFO] getting channel list of $platform..." + channels=$($CURL_WRAP -sSL $FBSD_PKG_UPSTREAM/$platform | grep -oP 'latest|quarterly|base_[a-z0-9_]+' | sort -t : -rnk 2 | uniq) + echo $channels + for channel in $channels; do if $CURL_WRAP -sLIf -o /dev/null $FBSD_PKG_UPSTREAM/$platform/$channel/packagesite.txz; then channel_sync $FBSD_PKG_UPSTREAM/$platform/$channel $TO/$platform/$channel fi