[gnome-software/gnome-3-22] trivial: Install the runtime before trying to install the flatpakref



commit b822c280f86df22fda4ffcfe756f3e1f333ac467
Author: Richard Hughes <richard hughsie com>
Date:   Tue Mar 14 10:23:03 2017 +0000

    trivial: Install the runtime before trying to install the flatpakref
    
    It seems install_ref_file doesn't check the availability of the runtime.

 src/plugins/gs-flatpak.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)
---
diff --git a/src/plugins/gs-flatpak.c b/src/plugins/gs-flatpak.c
index 361be16..d9efbee 100644
--- a/src/plugins/gs-flatpak.c
+++ b/src/plugins/gs-flatpak.c
@@ -2420,15 +2420,6 @@ gs_flatpak_app_install (GsFlatpak *self,
                        gs_app_set_state_recover (app);
                        return FALSE;
                }
-               data = g_bytes_new (contents, len);
-               xref2 = flatpak_installation_install_ref_file (self->installation,
-                                                             data,
-                                                             cancellable,
-                                                             error);
-               if (xref2 == NULL) {
-                       gs_app_set_state_recover (app);
-                       return FALSE;
-               }
 
                /* we have a missing remote and a RuntimeRef */
                runtime = gs_app_get_runtime (app);
@@ -2506,6 +2497,17 @@ gs_flatpak_app_install (GsFlatpak *self,
                                return FALSE;
                        }
                }
+
+               /* now install actual app */
+               data = g_bytes_new (contents, len);
+               xref2 = flatpak_installation_install_ref_file (self->installation,
+                                                             data,
+                                                             cancellable,
+                                                             error);
+               if (xref2 == NULL) {
+                       gs_app_set_state_recover (app);
+                       return FALSE;
+               }
        }
 
        /* install required runtime if not already installed */


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