Fix tests: check all repo matches for each package, not just first
Tests / tests (push) Failing after 2m38s

This commit is contained in:
2026-09-15 08:22:32 +10:00
parent 5b9463f055
commit 75918f9dfd
+17 -10
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
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