[gnome-software] Recover the state of the app when failing to install the flatpak runtime
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Recover the state of the app when failing to install the flatpak runtime
- Date: Wed, 21 Sep 2016 18:55:59 +0000 (UTC)
commit b5c3c7c839b375473396fa9c904d3b020415bb4e
Author: Richard Hughes <richard hughsie com>
Date: Wed Sep 21 19:35:53 2016 +0100
Recover the state of the app when failing to install the flatpak runtime
src/plugins/gs-flatpak.c | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/src/plugins/gs-flatpak.c b/src/plugins/gs-flatpak.c
index b70029d..b1a8a13 100644
--- a/src/plugins/gs-flatpak.c
+++ b/src/plugins/gs-flatpak.c
@@ -1855,21 +1855,25 @@ gs_flatpak_app_install (GsFlatpak *self,
runtime = gs_app_get_runtime (app);
/* the runtime could come from a different remote to the app */
- if (!gs_refine_item_metadata (self, runtime, cancellable,
- error))
+ if (!gs_refine_item_metadata (self, runtime, cancellable, error)) {
+ gs_app_set_state_recover (app);
return FALSE;
- if (!gs_plugin_refine_item_origin (self,
- runtime, cancellable, error))
+ }
+ if (!gs_plugin_refine_item_origin (self, runtime, cancellable, error)) {
+ gs_app_set_state_recover (app);
return FALSE;
- if (!gs_plugin_refine_item_state (self, runtime,
- cancellable, error))
+ }
+ if (!gs_plugin_refine_item_state (self, runtime, cancellable, error)) {
+ gs_app_set_state_recover (app);
return FALSE;
+ }
if (gs_app_get_state (runtime) == AS_APP_STATE_UNKNOWN) {
g_set_error (error,
GS_PLUGIN_ERROR,
GS_PLUGIN_ERROR_NOT_SUPPORTED,
"Failed to find runtime %s",
gs_app_get_source_default (runtime));
+ gs_app_set_state_recover (app);
return FALSE;
}
@@ -1888,6 +1892,7 @@ gs_flatpak_app_install (GsFlatpak *self,
cancellable, error);
if (xref == NULL) {
gs_app_set_state_recover (runtime);
+ gs_app_set_state_recover (app);
return FALSE;
}
gs_app_set_state (runtime, AS_APP_STATE_INSTALLED);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]