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
+15 -8
View File
@@ -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
# 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: $repo)"
echo "⚠️ WRONG REPO: $pkg (found in: $repos)"
fi
MISSING+=("$pkg")
fi
done < packages.x86_64