[gnome-software/wip/jrocha/fix-runtime-extensions-update: 2/5] flatpak: Refine extensions when getting them
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/jrocha/fix-runtime-extensions-update: 2/5] flatpak: Refine extensions when getting them
- Date: Wed, 31 Jan 2018 19:16:37 +0000 (UTC)
commit 05fe1484fa1caa2e78996b60482338cdc5b9146a
Author: Joaquim Rocha <jrocha endlessm com>
Date: Mon Nov 6 14:26:26 2017 +0100
flatpak: Refine extensions when getting them
When installing or removing an app, a list with the app's related
extensions is gathered in order to install/remove them as well.
The lists in this app may not have the correct state assigned when
they're gathered though, so when installing/removing them, there will
be a warning about an unexpected change of state.
These changes refine the mentioned extensions meaning they will set up
the right state and allow the further state changes from further
operations (installation/removal).
plugins/flatpak/gs-flatpak.c | 7 +++++++
1 file changed, 7 insertions(+)
---
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index d4528058..a6eb8c25 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -2341,10 +2341,13 @@ gs_flatpak_get_list_for_remove (GsFlatpak *self, GsApp *app,
for (guint i = 0; i < related->len; i++) {
FlatpakRelatedRef *xref_related = g_ptr_array_index (related, i);
g_autoptr(GsApp) app_tmp = NULL;
+
if (!flatpak_related_ref_should_delete (xref_related))
continue;
app_tmp = gs_flatpak_create_app (self, FLATPAK_REF (xref_related));
gs_app_set_origin (app_tmp, gs_app_get_origin (app));
+ if (!gs_plugin_refine_item_state (self, app_tmp, cancellable, error))
+ return NULL;
gs_app_list_add (list, app_tmp);
}
@@ -2531,6 +2534,10 @@ gs_flatpak_get_list_for_install (GsFlatpak *self, GsApp *app,
} else {
gs_app_set_origin (app_tmp, gs_app_get_origin (app));
g_debug ("adding related %s for install", ref_display);
+
+ if (!gs_plugin_refine_item_state (self, app_tmp, cancellable, error))
+ return NULL;
+
gs_app_list_add (list, app_tmp);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]