Skip to content

Commit

Permalink
fix: Avoid false positive on unused runtimes for Flatpak with pinned …
Browse files Browse the repository at this point in the history
…runtimes

This was due to the way the Flatpak CLI output is parsed, similar to #103.
Luckily one day the Flatpak CLI output will eventually be [easier to work with](flatpak/flatpak#5499) 👀

This commit also replaces `flatpak remove` by `flatpak uninstall`, the former only being an alias for the latter.

Fixes #285
  • Loading branch information
RayJW authored Dec 4, 2024
1 parent ff81590 commit 2dae27b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/orphan_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 uninstall --unused | sed -n '/^ 1./,$p' | awk '{print $2}' | grep -v '^$' | sed '$d')
fi

if [ -n "${orphan_packages}" ]; then
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2dae27b

Please sign in to comment.