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

T31068 Support renaming Flatpaks #569

Merged
merged 5 commits into from
Dec 16, 2020
Merged

T31068 Support renaming Flatpaks #569

merged 5 commits into from
Dec 16, 2020

Conversation

mwleeds
Copy link
Contributor

@mwleeds mwleeds commented Dec 16, 2020

Using g_message() allows the log message to be formatted and redirected
appropriately.

(cherry picked from commit f89a291)
When an app is renamed, appropriate metadata is set server-side so that
FlatpakTransaction::end-of-lifed-with-rebase is emitted. On the CLI the
user can choose whether to install the renamed app. GNOME Software
currently ignores the signal so such apps stay on their old names
forever. This commit makes g-s follow such redirects and install the new
app without user interaction, since that is what most users will want. A
follow-up commit will add a message in the UI so the user can be
informed in case the application's name is changing (as opposed to only
the application ID changing, which shouldn't be user-visible).

Note that in the special case where the installed commit is the one with
the eol-rebase metadata (as opposed to being an older commit), such apps
will not be returned by
flatpak_installation_list_installed_refs_for_update() without this
patch: flatpak/flatpak#3945

(cherry picked from commit c4c8086)
Currently for apps that have been renamed on Flathub, at least
org.gnome.iagno for example, the appstream data only exists under the
new name, so the app doesn't get properly displayed in the updates list
as it should so it can be updated to the new name. Instead there are
errors in the log "GsPluginFlatpak no match for ....: no results for
XPath query" and later "Gs app invalid as no name ..."

So use the appstream data under the new name in such circumstances. This
is not perfect in that we'll show the new name before the app has
actually been renamed, but it's certainly better than not showing the
app at all, and in practice renames are often just to change the app ID.

This makes renamed apps display properly in the Installed and Updates
lists, but there is still a remaining issue: after updating an app to
a new name, it doesn't show in the Installed list until after
gnome-software is closed and restarted.

(cherry picked from commit 3a14718)
Without a message the user may be confused why they can't find the app
by looking for the name they remember.

(cherry picked from commit 282e3ef)
@mwleeds
Copy link
Contributor Author

mwleeds commented Dec 16, 2020

These are clean cherry-picks from upstream.

@mwleeds mwleeds merged commit 8215906 into master Dec 16, 2020
@mwleeds mwleeds deleted the T31068 branch December 16, 2020 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant