[gnome-software/gnome-3-20] Do not overwrite the update version if already set



commit 95ec86e581d8d6ca3d0cddc5184e608b3e80dc63
Author: Richard Hughes <richard hughsie com>
Date:   Tue May 24 12:28:25 2016 +0100

    Do not overwrite the update version if already set
    
    If the application doesn't have any <releases> information we want to use the
    distro-provided version number rather than overwriting it with the possibly
    very old version from the distro-shipped AppStream metadata.

 src/plugins/gs-appstream.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/plugins/gs-appstream.c b/src/plugins/gs-appstream.c
index 5c04ae2..5d85e16 100644
--- a/src/plugins/gs-appstream.c
+++ b/src/plugins/gs-appstream.c
@@ -438,10 +438,12 @@ gs_appstream_refine_app_updates (GsPlugin *plugin,
                gs_app_set_update_details (app, update_desc->str);
        }
 
-       /* newest release only */
-       rel = as_app_get_release_default (item);
-       if (rel != NULL)
-               gs_app_set_update_version (app, as_release_get_version (rel));
+       /* if there is no already set update version use the newest */
+       if (gs_app_get_update_version (app) == NULL) {
+               rel = as_app_get_release_default (item);
+               if (rel != NULL)
+                       gs_app_set_update_version (app, as_release_get_version (rel));
+       }
 
        /* success */
        return TRUE;


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