[gnome-software/1453-flathub-repo-misleadingly-considered-present-on-fedora-35-with-filtered-flathub] flatpak: Update existing remote from a .flatpakref file
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/1453-flathub-repo-misleadingly-considered-present-on-fedora-35-with-filtered-flathub] flatpak: Update existing remote from a .flatpakref file
- Date: Tue, 21 Sep 2021 12:23:22 +0000 (UTC)
commit 502b67a4591f6dfbd27abcbbf72e85e82e238840
Author: Milan Crha <mcrha redhat com>
Date: Tue Sep 21 14:06:35 2021 +0200
flatpak: Update existing remote from a .flatpakref file
Update existing remote's title, description and filter when installing
a .flatpakref file, to match what had been installed, with new-enough
flatpak library.
Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1453
plugins/flatpak/gs-flatpak.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index 55a91af2a..fa7df00c9 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -1608,9 +1608,16 @@ gs_flatpak_app_install_source (GsFlatpak *self,
gs_app_get_id (app),
cancellable, NULL);
if (xremote != NULL) {
- /* if the remote already exists, just enable it */
- g_debug ("enabling existing remote %s", flatpak_remote_get_name (xremote));
+ /* if the remote already exists, just enable it and update it */
+ g_debug ("modifying existing remote %s", flatpak_remote_get_name (xremote));
flatpak_remote_set_disabled (xremote, FALSE);
+ if (gs_flatpak_app_get_file_kind (app) == GS_FLATPAK_APP_FILE_KIND_REPO) {
+ flatpak_remote_set_title (xremote, gs_app_get_origin_ui (app));
+ #if FLATPAK_CHECK_VERSION(1, 4, 0)
+ flatpak_remote_set_filter (xremote, gs_flatpak_app_get_repo_filter (app));
+ flatpak_remote_set_description (xremote, gs_app_get_description (app));
+ #endif
+ }
} else if (!is_install) {
g_set_error (error, GS_PLUGIN_ERROR, GS_PLUGIN_ERROR_FAILED, "Cannot enable flatpak remote
'%s', remote not found", gs_app_get_id (app));
} else {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]