issue-2209: Add support for the Flatpak package manager.#2222
issue-2209: Add support for the Flatpak package manager.#2222bim9262 merged 2 commits intogreshake:masterfrom
Conversation
1391607 to
89e5209
Compare
|
@zheltikov can you rebase your change? |
89e5209 to
fa62878
Compare
|
Rebased, @bim9262 |
| } | ||
|
|
||
| async fn get_updates_list(&self) -> Result<Vec<String>> { | ||
| Command::new("flatpak") |
There was a problem hiding this comment.
Is this necessary? I thought that flatpak remote-ls alone would list the updates?
Under what circumstance do you need to run the flatpak update --appstream -y first?
There was a problem hiding this comment.
As per the manual:
remote-ls lists the whole contents of a remote repository.
update --appstream updates the info for that all remotes.
So we need to update the local info before listing updates.
There was a problem hiding this comment.
This helped clarify the matter further: flatpak/flatpak#5974 (comment)
src/blocks/packages/flatpak.rs
Outdated
|
|
||
| let stdout = Command::new("flatpak") | ||
| .env("LC_ALL", "C") | ||
| .args(["remote-ls", "--updates", "--no-header", "--columns=ref"]) |
There was a problem hiding this comment.
When I run this I get the following error:
> LC_ALL=C flatpak remote-ls --updates --no-header --columns=ref
error: Unknown option --no-header
> flatpak --version
Flatpak 1.16.2
There was a problem hiding this comment.
My bad, i guess we can replace it with a .skip(1)
There was a problem hiding this comment.
Upon further investigation, it turns out that flatpak does not print headers for non-tty outputs. So we can just omit stripping the header line entirely.
src/blocks/packages.rs
Outdated
| //! [[block.click]] | ||
| //! # shows dmenu with cached available updates. Any dmenu alternative should also work. | ||
| //! button = "left" | ||
| //! cmd = "flatpak remote-ls --updates --no-header --columns=ref | tail -n +2 | rofi -dmenu" |
There was a problem hiding this comment.
With the --no-header (if it worked) you wouldn't need the tail. Without --no-header, you only need to skip the first line, not the first 2.
There was a problem hiding this comment.
Yes, we can remove the tail invocation entirely.
|
This looks good now! I'm able to see the correct count of packages available for update 😄 |
Resolves #2209 .
Depends on #2221 being merged first.
@MaxVerevkin @bim9262 @ammgws