From b76ff096241cd7db889a3e763cbe94884634ed93 Mon Sep 17 00:00:00 2001 From: Alvin Vilaythong Date: Tue, 15 Sep 2026 08:22:32 +1000 Subject: [PATCH] Fix tests: check all repo matches for each package, not just first --- .gitea/workflows/tests.yaml | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/tests.yaml b/.gitea/workflows/tests.yaml index f8d6d6d..098e4ed 100644 --- a/.gitea/workflows/tests.yaml +++ b/.gitea/workflows/tests.yaml @@ -202,16 +202,23 @@ jobs: [[ -z "$pkg" || "$pkg" =~ ^# ]] && continue TOTAL=$((TOTAL + 1)) - # Query pacman for the package's repository (strip \r just in case) - repo=$(pacman -Si "$pkg" 2>/dev/null | grep "^Repository" | awk '{print $3}' | tr -d '\r') - - if [[ -z "$repo" ]]; then - echo "❌ MISSING: $pkg" - MISSING+=("$pkg") - elif [[ "$repo" =~ $ALLOWED_REPOS ]]; then - FOUND=$((FOUND + 1)) - else - echo "⚠️ WRONG REPO: $pkg (found in: $repo)" + # Query pacman for the package's repository (all matches, strip \r) + repos=$(pacman -Si "$pkg" 2>/dev/null | grep "^Repository" | awk '{print $3}' | tr -d '\r') + # Check if ANY of the repos is in the allowed list + MATCHED=0 + for repo in $repos; do + if [[ "$repo" =~ $ALLOWED_REPOS ]]; then + MATCHED=1 + FOUND=$((FOUND + 1)) + break + fi + done + if [[ $MATCHED -eq 0 ]]; then + if [[ -z "$repos" ]]; then + echo "❌ MISSING: $pkg" + else + echo "⚠️ WRONG REPO: $pkg (found in: $repos)" + fi MISSING+=("$pkg") fi done < packages.x86_64