diff --git a/src/scripts/tools/ppa.sh b/src/scripts/tools/ppa.sh index 5db4d1f4..2fab7888 100644 --- a/src/scripts/tools/ppa.sh +++ b/src/scripts/tools/ppa.sh @@ -246,7 +246,11 @@ check_lists() { match_file=$(grep -Elr "$primary" "$list_dir" 2>/dev/null | head -n 1) fi if [ -z "$match_file" ] && [ -n "$secondary" ]; then - match_file=$(grep -Elr "$secondary" "$list_dir" 2>/dev/null | head -n 1) + local candidate + candidate=$(grep -Elr "$secondary" "$list_dir" 2>/dev/null | head -n 1) + if [ -n "$candidate" ] && { [ -z "$primary" ] || grep -Eq "$primary" "$candidate"; }; then + match_file="$candidate" + fi fi if [ -n "$match_file" ]; then local list_count