From 110ae9e4eb6acb19950757adae6f297c80c8ec79 Mon Sep 17 00:00:00 2001 From: Pepe44DEV Date: Thu, 28 May 2026 18:27:22 +0200 Subject: [PATCH] fix is_package_installed to check provides (virtual packages) aylurs-gtk-shell-git provides aylurs-gtk-shell, but pacman -Qi only matches exact package names. This caused the installer to think ags was missing and try to install aylurs-gtk-shell from AUR, which conflicts with the already-installed -git variant. Now uses expac (fast) or pacman loop (fallback) to check if any installed package provides the requested virtual package name. --- lib/utils.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/utils.sh b/lib/utils.sh index 72fd9fe..335c4b6 100755 --- a/lib/utils.sh +++ b/lib/utils.sh @@ -91,8 +91,19 @@ is_package_installed() { local pkg="$1" if command -v pacman >/dev/null 2>&1; then - pacman -Qi "$pkg" >/dev/null 2>&1 - return $? + pacman -Qi "$pkg" >/dev/null 2>&1 && return 0 + if command -v expac >/dev/null 2>&1; then + expac -Q '%n %P' 2>/dev/null | awk -v pkg="$pkg" ' + { for (i=2; i<=NF; i++) if ($i == pkg) {found=1; exit} } + END {exit !found} + ' && return 0 + else + while IFS= read -r installed; do + [[ -z "$installed" ]] && continue + pacman -Qi "$installed" 2>/dev/null | grep -qP "Provides\s*:\s*.*\b${pkg}\b" && return 0 + done < <(pacman -Qq 2>/dev/null) + fi + return 1 fi return 1