[gnome-software/wip/hughsie/fix-alternates-regression] Only do one pass of wildcard components



commit 018ecdc518b58c5b78cc69d8b7f19d45efc21328
Author: Richard Hughes <richard hughsie com>
Date:   Mon Oct 8 15:34:01 2018 +0100

    Only do one pass of wildcard components
    
    I think this was added from when we had one huge AppStream store for all
    plugins; doing more than one pass might be required if something like a
    resolve() added a wildcard, but with the design we have now that's clearly
    not what we want plugins to do.
    
    Remove the 2nd wildcard pass to remove duplicate components from the alternate
    list, and thus the details drop-down.

 lib/gs-plugin-loader.c | 20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)
---
diff --git a/lib/gs-plugin-loader.c b/lib/gs-plugin-loader.c
index 77ed2547..10839dae 100644
--- a/lib/gs-plugin-loader.c
+++ b/lib/gs-plugin-loader.c
@@ -975,7 +975,6 @@ gs_plugin_loader_run_refine (GsPluginLoaderHelper *helper,
                             GCancellable *cancellable,
                             GError **error)
 {
-       gboolean has_match_any_prefix = FALSE;
        gboolean ret;
        g_autoptr(GsAppList) freeze_list = NULL;
        g_autoptr(GsPluginLoaderHelper) helper2 = NULL;
@@ -1003,23 +1002,8 @@ gs_plugin_loader_run_refine (GsPluginLoaderHelper *helper,
        if (!ret)
                goto out;
 
-       /* second pass for any unadopted apps */
-       for (guint i = 0; i < gs_app_list_length (list); i++) {
-               GsApp *app = gs_app_list_index (list, i);
-               if (gs_app_has_quirk (app, AS_APP_QUIRK_MATCH_ANY_PREFIX)) {
-                       has_match_any_prefix = TRUE;
-                       break;
-               }
-       }
-       if (has_match_any_prefix) {
-               g_debug ("2nd resolve pass for unadopted wildcards");
-               if (!gs_plugin_loader_run_refine_internal (helper2, list,
-                                                          cancellable,
-                                                          error))
-                       goto out;
-               /* filter any MATCH_ANY_PREFIX apps left in the list */
-               gs_app_list_filter (list, gs_plugin_loader_app_is_non_wildcard, NULL);
-       }
+       /* filter any MATCH_ANY_PREFIX apps left in the list */
+       gs_app_list_filter (list, gs_plugin_loader_app_is_non_wildcard, NULL);
 
        /* remove any addons that have the same source as the parent app */
        for (guint i = 0; i < gs_app_list_length (list); i++) {


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