From 12384ba06a8b6e603c2b2e41bd4863ad587afb70 Mon Sep 17 00:00:00 2001 From: RayJW <29835902+RayJW@users.noreply.github.com> Date: Wed, 4 Dec 2024 13:14:15 +0100 Subject: [PATCH 1/2] fix: false positive on unused runtimes for Flatpak with pinned runtimes --- src/lib/orphan_packages.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/orphan_packages.sh b/src/lib/orphan_packages.sh index 475e1e1..c9ea5a7 100755 --- a/src/lib/orphan_packages.sh +++ b/src/lib/orphan_packages.sh @@ -7,7 +7,7 @@ orphan_packages=$(pacman -Qtdq) if [ -n "${flatpak}" ]; then - flatpak_unused=$(flatpak remove --unused | awk '{print $2}' | grep -v '^$' | sed '$d') + flatpak_unused=$(flatpak remove --unused | sed -n '/^ 1./,$p' | awk '{print $2}' | grep -v '^$' | sed '$d') fi if [ -n "${orphan_packages}" ]; then From 5ed56534def647e9175628e3ca22e2657e725616 Mon Sep 17 00:00:00 2001 From: RayJW <29835902+RayJW@users.noreply.github.com> Date: Wed, 4 Dec 2024 13:19:03 +0100 Subject: [PATCH 2/2] chore: use uninstall instead of the alias remove for Flatpak --- src/lib/orphan_packages.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/orphan_packages.sh b/src/lib/orphan_packages.sh index c9ea5a7..61af669 100755 --- a/src/lib/orphan_packages.sh +++ b/src/lib/orphan_packages.sh @@ -7,7 +7,7 @@ orphan_packages=$(pacman -Qtdq) if [ -n "${flatpak}" ]; then - flatpak_unused=$(flatpak remove --unused | sed -n '/^ 1./,$p' | awk '{print $2}' | grep -v '^$' | sed '$d') + flatpak_unused=$(flatpak uninstall --unused | sed -n '/^ 1./,$p' | awk '{print $2}' | grep -v '^$' | sed '$d') fi if [ -n "${orphan_packages}" ]; then @@ -60,7 +60,7 @@ if [ -n "${flatpak}" ]; then echo main_msg "$(eval_gettext "Removing Flatpak Unused Packages...")" - if ! flatpak remove --unused; then + if ! flatpak uninstall --unused; then echo error_msg "$(eval_gettext "An error has occurred during the removal process\nThe removal has been aborted\n")" else