[gnome-software/gnome-3-22] trivial: Add all system FlatpakInstallation instances



commit 5bf8b66e9b3195130341edcdba0db69b57241c13
Author: Richard Hughes <richard hughsie com>
Date:   Thu Feb 23 16:33:12 2017 +0000

    trivial: Add all system FlatpakInstallation instances
    
    It is unusual to have more than one system installation present on a system,
    but this may be what the integrator has to do if the storage is split over
    SD cards and eMMC.
    
    It is expected that a 3rd party plugin will set the flatpak::object-id metadata
    value to an explicit value to influence what software gets put on each media
    type.

 configure.ac                    |    2 +-
 src/plugins/gs-flatpak.c        |    4 ++++
 src/plugins/gs-plugin-flatpak.c |   17 ++++++++++-------
 3 files changed, 15 insertions(+), 8 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index ce8a175..7e9a897 100644
--- a/configure.ac
+++ b/configure.ac
@@ -243,7 +243,7 @@ AC_ARG_ENABLE(flatpak,
               enable_flatpak=maybe)
 AS_IF([test "x$enable_flatpak" != "xno"], [
     PKG_CHECK_MODULES(FLATPAK,
-                      [flatpak >= 0.6.12],
+                      [flatpak >= 0.8.0],
                       [have_flatpak=yes],
                       [have_flatpak=no])
 ], [
diff --git a/src/plugins/gs-flatpak.c b/src/plugins/gs-flatpak.c
index baba6b0..a37b22b 100644
--- a/src/plugins/gs-flatpak.c
+++ b/src/plugins/gs-flatpak.c
@@ -2909,6 +2909,10 @@ gs_flatpak_get_id (GsFlatpak *self)
                GString *str = g_string_new ("GsFlatpak");
                g_string_append_printf (str, "-%s",
                                        as_app_scope_to_string (self->scope));
+               if (flatpak_installation_get_id (self->installation) != NULL) {
+                       g_string_append_printf (str, "-%s",
+                                               flatpak_installation_get_id (self->installation));
+               }
                if (self->flags & GS_FLATPAK_FLAG_IS_TEMPORARY)
                        g_string_append (str, "-temp");
                self->id = g_string_free (str, FALSE);
diff --git a/src/plugins/gs-plugin-flatpak.c b/src/plugins/gs-plugin-flatpak.c
index afa9004..29b155d 100644
--- a/src/plugins/gs-plugin-flatpak.c
+++ b/src/plugins/gs-plugin-flatpak.c
@@ -136,15 +136,18 @@ gs_plugin_setup (GsPlugin *plugin, GCancellable *cancellable, GError **error)
 
        /* we use a permissions helper to elevate privs */
        if (priv->has_system_helper && priv->destdir_for_tests == NULL) {
-               g_autoptr(FlatpakInstallation) installation = NULL;
-               installation = flatpak_installation_new_system (cancellable, error);
-               if (installation == NULL) {
+               g_autoptr(GPtrArray) installations = NULL;
+               installations = flatpak_get_system_installations (cancellable, error);
+               if (installations == NULL) {
                        return FALSE;
                }
-               if (!gs_plugin_flatpak_add_installation (plugin, installation,
-                                                        GS_FLATPAK_FLAG_NONE,
-                                                        cancellable, error)) {
-                       return FALSE;
+               for (guint i = 0; i < installations->len; i++) {
+                       FlatpakInstallation *installation = g_ptr_array_index (installations, i);
+                       if (!gs_plugin_flatpak_add_installation (plugin, installation,
+                                                                GS_FLATPAK_FLAG_NONE,
+                                                                cancellable, error)) {
+                               return FALSE;
+                       }
                }
        }
 


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