[gnome-software/wip/temp/ubuntu-xenial-rebased: 298/326] Show version for uninstalled packages



commit c9d7e3be306ed378542e820f5f06f9f250d442e8
Author: Robert Ancell <robert ancell canonical com>
Date:   Mon Apr 25 17:24:58 2016 +0200

    Show version for uninstalled packages

 src/plugins/gs-plugin-apt.cc |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/gs-plugin-apt.cc b/src/plugins/gs-plugin-apt.cc
index 7f92ea0..919d5d6 100644
--- a/src/plugins/gs-plugin-apt.cc
+++ b/src/plugins/gs-plugin-apt.cc
@@ -390,11 +390,12 @@ look_at_pkg (const pkgCache::PkgIterator &P,
 
        if (current)
                info->installed_version = g_strdup (current.VerStr ());
+       if (candidate)
+               info->update_version = g_strdup (candidate.VerStr ());
 
        info->section = g_strdup (candidate.Section ());
        info->architecture = g_strdup (P.Arch ());
        if (info->installed_version) {
-               info->update_version = g_strdup (candidate.VerStr ());
                plugin->priv->installed_packages =
                        g_list_append (plugin->priv->installed_packages, info);
        }
@@ -403,7 +404,7 @@ look_at_pkg (const pkgCache::PkgIterator &P,
        if (g_strcmp0 (info->installed_version, info->update_version) == 0)
                g_clear_pointer (&info->update_version, g_free);
 
-       if (info->update_version)
+       if (info->installed_version && info->update_version)
                plugin->priv->updatable_packages =
                        g_list_append (plugin->priv->updatable_packages, info);
 


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