diff --git a/mangle/validate_repos b/mangle/validate_repos index a845cff..d897cf5 100755 --- a/mangle/validate_repos +++ b/mangle/validate_repos @@ -1,11 +1,14 @@ #!/usr/bin/env bash +### +# Use RLVER=9 for rocky 9 + # Source mangle vars # shellcheck source=./common disable=SC1091,1090 -source "$(dirname "$0")/common" +source "$(dirname "${BASH_SOURCE[0]}")/common" # Source sync / migrate vars for repository information # shellcheck source=../sync/common disable=SC1091,1090 -source "$(dirname "$0")/../sync/common" +source "$(dirname "${BASH_SOURCE[0]}")/../sync/common" # How many ARG1=${1} @@ -30,12 +33,16 @@ cleanup_repo () { repo="${repo^^}" fi - # Everything has an 8 appended to it - repo="${repo}-8" + # Append the major version from sync/common to support 8 and 9 + repo="${repo}-${MAJOR}" return 0 } -for repo in "${ALL_REPOS[@]}"; do +# Sort the array +IFS=$'\n' sorted=($(sort <<<"${ALL_REPOS[*]}")) +unset IFS + +for repo in "${sorted[@]}"; do # Business logic must be done, sometimes... cleanup_repo "${repo}" @@ -52,8 +59,8 @@ for repo in "${ALL_REPOS[@]}"; do result=$(curl -s "${MIRRORLIST_BASE}?repo=${repo}&arch=${arch}&time&country=global") print_result - # x86 and a64 have 'debug' types, as well - if [[ "${arch}" =~ ^(x86_|aarch)64$ ]]; then + # x86 and a64 have 'debug' types, as well ("arch" != "source") + if [[ "${arch}" =~ ^(x86_|aarch)64|(s390x|ppc64le)$ ]]; then result=$(curl -s "${MIRRORLIST_BASE}?repo=${repo}-debug&arch=${arch}&time&country=global") print_result fi diff --git a/sync/common b/sync/common index 0141d01..be3c832 100644 --- a/sync/common +++ b/sync/common @@ -32,7 +32,7 @@ ARCHES=(x86_64 aarch64) # Source Major common # Override: Not Allowed -test -f "$(dirname "$0")/common_${RLVER}" && source "$(dirname "$0")/common_${RLVER}" +test -f "$(dirname "${BASH_SOURCE[0]}")/common_${RLVER}" && source "$(dirname "${BASH_SOURCE[0]}")/common_${RLVER}" if [ "$?" -ne 0 ]; then echo "Could not source common_${RLVER}" exit 1 diff --git a/sync/gen-torrents.sh b/sync/gen-torrents.sh index c80c90d..dc1486b 100755 --- a/sync/gen-torrents.sh +++ b/sync/gen-torrents.sh @@ -3,7 +3,7 @@ # Source common variables # shellcheck disable=SC2046,1091,1090 -source "$(dirname "$0")/common" +source "$(dirname "${BASH_SOURCE[0]}")/common" NAME=gen-torrents