[gnome-software] trivial: Don't try to refine non-package names with PackageKit



commit ec22f1d9badc32e6d1f9c008e04ad471338996b3
Author: Richard Hughes <richard hughsie com>
Date:   Sun Jun 12 16:14:05 2016 +0100

    trivial: Don't try to refine non-package names with PackageKit

 src/plugins/gs-plugin-packagekit-refine.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/gs-plugin-packagekit-refine.c b/src/plugins/gs-plugin-packagekit-refine.c
index d96ecd8..f1743d7 100644
--- a/src/plugins/gs-plugin-packagekit-refine.c
+++ b/src/plugins/gs-plugin-packagekit-refine.c
@@ -770,6 +770,14 @@ gs_plugin_packagekit_refine_distro_upgrade (GsPlugin *plugin,
        return TRUE;
 }
 
+static gboolean
+gs_plugin_packagekit_refine_valid_package_name (const gchar *source)
+{
+       if (g_strstr_len (source, -1, "/") != NULL)
+               return FALSE;
+       return TRUE;
+}
+
 gboolean
 gs_plugin_refine (GsPlugin *plugin,
                  GsAppList *list,
@@ -816,6 +824,9 @@ gs_plugin_refine (GsPlugin *plugin,
                sources = gs_app_get_sources (app);
                if (sources->len == 0)
                        continue;
+               tmp = g_ptr_array_index (sources, 0);
+               if (!gs_plugin_packagekit_refine_valid_package_name (tmp))
+                       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) ||


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