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



commit e4998d15264b85cd3575e05d6bfe5c4b6cefacc0
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]