[gnome-software: 9/10] plugin loader: Re-refine apps after install / remove



commit f66eb29fed3dbd098774653749a5cc4dffbcacfc
Author: Kalev Lember <kalevlember gmail com>
Date:   Sat Feb 7 17:07:18 2015 +0100

    plugin loader: Re-refine apps after install / remove
    
    This ensures we pick up the new default source ID. If we don't have
    one, any subsequent install / remove actions on the same app would fail.

 src/gs-plugin-loader.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 49e9f09..0250698 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -2121,6 +2121,7 @@ gs_plugin_loader_app_action_thread_cb (GTask *task,
        GPtrArray *addons;
        gboolean ret;
        guint i;
+       _cleanup_list_free_ GList *list = NULL;
 
        /* add to list */
        g_mutex_lock (&plugin_loader->priv->pending_apps_mutex);
@@ -2146,7 +2147,20 @@ gs_plugin_loader_app_action_thread_cb (GTask *task,
                                }
                        }
                }
-               g_task_return_boolean (task, TRUE);
+
+               /* refine again to make sure we pick up new source id */
+               list = g_list_prepend (list, state->app);
+               ret = gs_plugin_loader_run_refine (plugin_loader,
+                                                  state->function_name,
+                                                  &list,
+                                                  GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN,
+                                                  cancellable,
+                                                  &error);
+               if (ret) {
+                       g_task_return_boolean (task, TRUE);
+               } else {
+                       g_task_return_error (task, error);
+               }
        } else {
                gs_app_set_state (state->app, state->state_failure);
                addons = gs_app_get_addons (state->app);


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