[gnome-software/gnome-3-22] Do not show an update for apps whose latest flatpak commit is NULL



commit 25cac1373b15a87d1c84a56c8305ee7acda5b4ba
Author: Joaquim Rocha <jrocha endlessm com>
Date:   Wed Sep 14 13:21:51 2016 -0700

    Do not show an update for apps whose latest flatpak commit is NULL
    
    The logic for setting an app as updatable works by comparing the current
    commit of an app with the latest one available.
    However, if an app no longer exists in its remote, then the latest
    commit is being set as NULL, thus resulting in a wrong update for the
    app in GNOME Software.
    
    This patch simply checks if the latest commit of an app is not NULL
    before comparing the commits in question.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=771449

 src/plugins/gs-flatpak.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/gs-flatpak.c b/src/plugins/gs-flatpak.c
index 44b41e9..a65e613 100644
--- a/src/plugins/gs-flatpak.c
+++ b/src/plugins/gs-flatpak.c
@@ -880,6 +880,11 @@ 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;
+               }
                if (g_strcmp0 (commit, latest_commit) == 0) {
                        g_debug ("no downloaded update for %s",
                                 flatpak_ref_get_name (FLATPAK_REF (xref)));


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