Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False Positive on Unused Flatpak Packages for Pinned Runtimes #285

Closed
RayJW opened this issue Dec 3, 2024 · 9 comments · Fixed by #286
Closed

False Positive on Unused Flatpak Packages for Pinned Runtimes #285

RayJW opened this issue Dec 3, 2024 · 9 comments · Fixed by #286
Assignees
Labels
bug Something isn't working good first issue Good for newcomers
Milestone

Comments

@RayJW
Copy link
Contributor

RayJW commented Dec 3, 2024

Environment

  • Distribution: CachyOS
  • Arch-Update version: 3.4.1

Description of the bug

When running arch-update and Flatpak has pinned runtimes, it reports that there are unused runtimes, even if there are none.

Screenshots / Logs

==> Flatpak Unused Packages:
runtimes

-> Would you like to remove this Flatpak unused package now? [y/N] y

==> Removing Flatpak Unused Packages...

These runtimes in installation 'user' are pinned and won't be removed; see flatpak-pin(1):
  runtime/org.freedesktop.Sdk.Extension.freepascal/x86_64/24.08
  runtime/org.kde.Sdk/x86_64/6.8
Nothing unused to uninstall

Additional context

I suspect that this is merely due to the way the output of flatpak uninstall --unused output is parsed.

@RayJW RayJW added the bug Something isn't working label Dec 3, 2024
@Antiz96
Copy link
Owner

Antiz96 commented Dec 3, 2024

Hi,

Thanks for the bug report!
This is indeed most likely an issue with the output parsing. I had a similar issue in the past already. Unfortunately the flatpak CLI output is a bit difficult to work with 😞

I'll investigate and try to come up with a fix soon.
I'll let you know :)

@RayJW
Copy link
Contributor Author

RayJW commented Dec 3, 2024

This is indeed most likely an issue with the output parsing. I had a similar issue in the past already. Unfortunately the flatpak CLI output is a bit difficult to work with 😞

Yea, I've been there. I hope some day we get flatpak/flatpak#5499, that would make things easier ^^'

@Antiz96
Copy link
Owner

Antiz96 commented Dec 3, 2024

This is indeed most likely an issue with the output parsing. I had a similar issue in the past already. Unfortunately the flatpak CLI output is a bit difficult to work with 😞

Yea, I've been there. I hope some day we get flatpak/flatpak#5499, that would make things easier ^^'

Oh wow, I wasn't aware of this feature request, thanks for sharing!
Definite +1 for me! :D

@Antiz96
Copy link
Owner

Antiz96 commented Dec 4, 2024

Turns out this can be fixed with the same mechanism I used in #104 to fix the similar issue there was with flatpak update.

In practice, that means modifying the following line in the orphan_packages.sh lib script like so (addition of the sed -n '/^ 1./,$p' part before the awk):

  • before: flatpak_unused=$(flatpak remove --unused | awk '{print $2}' | grep -v '^$' | sed '$d')
  • after: flatpak_unused=$(flatpak remove --unused | sed -n '/^ 1./,$p' | awk '{print $2}' | grep -v '^$' | sed '$d')

Would you be interested in contributing that fix via a pull request?

@Antiz96 Antiz96 added the good first issue Good for newcomers label Dec 4, 2024
@Antiz96 Antiz96 added this to the v3.4.2 milestone Dec 4, 2024
@RayJW
Copy link
Contributor Author

RayJW commented Dec 4, 2024

Turns out this can be fixed with the same mechanism I used in #104 to fix the similar issue there was with flatpak update.

In practice, that means modifying the following line in the orphan_packages.sh lib script like so (addition of the sed -n '/^ 1./,$p' part before the awk):

* before: `flatpak_unused=$(flatpak remove --unused | awk '{print $2}' | grep -v '^$' | sed '$d')`

* after: `flatpak_unused=$(flatpak remove --unused | sed -n '/^ 1./,$p' | awk '{print $2}' | grep -v '^$' | sed '$d')`

Would you be interested in contributing that fix via a pull request?

Sure, I'll get on that real quick :) Thanks for the info!

@Antiz96
Copy link
Owner

Antiz96 commented Dec 4, 2024

@RayJW Thanks a lot, that's really appreciated! While you're at it, do you mind replacing flatpak remove by flatpak uninstall in that line as well? :D

remove seems to only be an alias for the actual uninstall command, so better use the latter I guess :)

@RayJW
Copy link
Contributor Author

RayJW commented Dec 4, 2024

@RayJW Thanks a lot, that's really appreciated! While you're at it, do you mind replacing flatpak remove by flatpak uninstall in that line as well? :D

remove seems to only be an alias for the actual uninstall command, so better use the latter I guess :)

Whoops, jumped the gun there. Sure, I'll add a commit for that real quick :)

@Antiz96
Copy link
Owner

Antiz96 commented Dec 4, 2024

There is still another opened issue I'd like to be dealt with before tagging a new release. Another person was interested in opening a PR for it soon-ish.

I will patch the Arch-Update AUR package to include this fix right now though, so you don't have to wait for the next release to enjoy the fix (assuming you use the AUR package) :)

@Antiz96
Copy link
Owner

Antiz96 commented Dec 4, 2024

AUR package patched ;)
Thanks once again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants