[gnome-software] Refine the package origin even if the source ID is already known



commit 5ac3b7ca9716ced3502570b73d2d5fbc43a1365e
Author: Kalev Lember <klember redhat com>
Date:   Thu Jun 18 12:05:52 2015 +0200

    Refine the package origin even if the source ID is already known
    
    Do separate checks to see if the source ID needs refining and if the
    origin needs refining. Previously we would skip refining if we already
    had the source ID (but no origin) - this can happen for packages created
    by the packagekit plugin, for example.
    
    This fixes a number of packages having "Source: Unknown" in the UI.

 src/plugins/gs-plugin-packagekit-refine.c |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/gs-plugin-packagekit-refine.c b/src/plugins/gs-plugin-packagekit-refine.c
index e979aba..9145ab2 100644
--- a/src/plugins/gs-plugin-packagekit-refine.c
+++ b/src/plugins/gs-plugin-packagekit-refine.c
@@ -648,6 +648,21 @@ gs_plugin_refine_requires_update_details (GsApp *app, GsPluginRefineFlags flags)
 }
 
 /**
+ * gs_plugin_refine_requires_origin:
+ */
+static gboolean
+gs_plugin_refine_requires_origin (GsApp *app, GsPluginRefineFlags flags)
+{
+       const gchar *tmp;
+       tmp = gs_app_get_origin (app);
+       if (tmp != NULL)
+               return FALSE;
+       if ((flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN) > 0)
+               return TRUE;
+       return FALSE;
+}
+
+/**
  * gs_plugin_refine_requires_package_id:
  */
 static gboolean
@@ -671,8 +686,6 @@ gs_plugin_refine_requires_package_id (GsApp *app, GsPluginRefineFlags flags)
                return TRUE;
        if ((flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_UPDATE_DETAILS) > 0)
                return TRUE;
-       if ((flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN) > 0)
-               return TRUE;
        return FALSE;
 }
 
@@ -717,6 +730,7 @@ gs_plugin_refine (GsPlugin *plugin,
                        continue;
                if (gs_app_get_state (app) == AS_APP_STATE_UNKNOWN ||
                    gs_plugin_refine_requires_package_id (app, flags) ||
+                   gs_plugin_refine_requires_origin (app, flags) ||
                    gs_plugin_refine_requires_version (app, flags)) {
                        resolve_all = g_list_prepend (resolve_all, app);
                }


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