From be6e67821f9ac45634efdad800a9cc9002767e4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Wed, 15 May 2024 13:38:40 +0200 Subject: [PATCH] Resolve packages to their actuall install target --- remove-unconfigured-packages.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/remove-unconfigured-packages.sh b/remove-unconfigured-packages.sh index 902654c..6dc640a 100755 --- a/remove-unconfigured-packages.sh +++ b/remove-unconfigured-packages.sh @@ -32,7 +32,19 @@ readarray -d $'\0' -t packages_to_remove < <(comm --zero-terminated -13 \ <(cat \ <(/dev/null | grep ^Name | grep ^Name | cut -d ':' -f 2 | tr -d ' ') ; then + if [[ "${resolved_name}" != "${package}" ]] ; then + if pacman -Qq --explicit "${resolved_name}" >/dev/null ; then + printf '%s\0' "${resolved_name}" + continue + fi + fi + fi + printf '%s\0' "${package}" + done | sort -zu +) \ <(pacman -Qq --explicit | xargs -I "{}" printf '%s\0' "{}" | sort -zu) \ | while IFS= read -r -d $'\0' package; do skip=0