Fix tests: check all repo matches for each package, not just first

This commit is contained in:
2026-09-15 15:37:44 +10:00
committed by alvinlollo
parent 10d2c90c6f
commit b76ff09624
+17 -10
View File
@@ -202,16 +202,23 @@ jobs:
[[ -z "$pkg" || "$pkg" =~ ^# ]] && continue [[ -z "$pkg" || "$pkg" =~ ^# ]] && continue
TOTAL=$((TOTAL + 1)) TOTAL=$((TOTAL + 1))
# Query pacman for the package's repository (strip \r just in case) # Query pacman for the package's repository (all matches, strip \r)
repo=$(pacman -Si "$pkg" 2>/dev/null | grep "^Repository" | awk '{print $3}' | tr -d '\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
if [[ -z "$repo" ]]; then MATCHED=0
echo "❌ MISSING: $pkg" for repo in $repos; do
MISSING+=("$pkg") if [[ "$repo" =~ $ALLOWED_REPOS ]]; then
elif [[ "$repo" =~ $ALLOWED_REPOS ]]; then MATCHED=1
FOUND=$((FOUND + 1)) FOUND=$((FOUND + 1))
else break
echo "⚠️ WRONG REPO: $pkg (found in: $repo)" 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") MISSING+=("$pkg")
fi fi
done < packages.x86_64 done < packages.x86_64