[gnome-software/1151-flatpak-not-having-latest-commit-is-not-a-problem: 19/19] flatpak: Not having latest commit is not a problem




commit bc0a21673c0367a6a5485d06797da94f6cbd0a1f
Author: Milan Crha <mcrha redhat com>
Date:   Fri Feb 19 11:17:49 2021 +0100

    flatpak: Not having latest commit is not a problem
    
    Since flatpak_installation_list_installed_refs_for_update() returns refs
    for update, there's no need to check the latest_commit for an existence.
    The updates page could hide pending Flatpak updates when the ref did not
    contain the latest_commit, but it is a valid state, thus no need to ignore
    such applications.
    
    Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1151

 plugins/flatpak/gs-flatpak.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
---
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index 339027fcc..128ba46b7 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -1601,12 +1601,6 @@ gs_flatpak_add_updates (GsFlatpak *self, GsAppList *list,
                /* check the application has already been downloaded */
                commit = flatpak_ref_get_commit (FLATPAK_REF (xref));
                latest_commit = flatpak_installed_ref_get_latest_commit (xref);
-               if (latest_commit == NULL) {
-                       g_debug ("could not get latest commit for %s",
-                                flatpak_ref_get_name (FLATPAK_REF (xref)));
-                       continue;
-               }
-
                app = gs_flatpak_create_installed (self, xref, NULL, cancellable);
                main_app = get_real_app_for_update (self, app, cancellable, &error_local);
                if (main_app == NULL) {
@@ -1628,7 +1622,7 @@ gs_flatpak_add_updates (GsFlatpak *self, GsAppList *list,
                        gs_app_set_state (app, GS_APP_STATE_UPDATABLE_LIVE);
 
                /* already downloaded */
-               if (g_strcmp0 (commit, latest_commit) != 0) {
+               if (latest_commit && g_strcmp0 (commit, latest_commit) != 0) {
                        g_debug ("%s has a downloaded update %s->%s",
                                 flatpak_ref_get_name (FLATPAK_REF (xref)),
                                 commit, latest_commit);
@@ -1636,7 +1630,6 @@ gs_flatpak_add_updates (GsFlatpak *self, GsAppList *list,
                        gs_app_set_update_version (main_app, NULL);
                        gs_app_set_update_urgency (main_app, AS_URGENCY_KIND_UNKNOWN);
                        gs_app_set_size_download (main_app, 0);
-                       gs_app_list_add (list, main_app);
 
                /* needs download */
                } else {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]