[gnome-builder/gnome-builder-41] flatpak: dont automatically add --user install from daemon



commit 1e9b2bd407f74e57f562f3cd09346d814a25ef3c
Author: Christian Hergert <chergert redhat com>
Date:   Thu Nov 18 20:35:41 2021 -0800

    flatpak: dont automatically add --user install from daemon
    
    Instead we want to add this from the client so that we can ensure that
    tests can run without using the --user installation. In particular, we
    want to be able to test the initial state on a fresh OS install.

 src/plugins/flatpak/daemon/ipc-flatpak-service-impl.c | 4 ----
 src/plugins/flatpak/gbp-flatpak-client.c              | 8 ++++++++
 2 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/plugins/flatpak/daemon/ipc-flatpak-service-impl.c 
b/src/plugins/flatpak/daemon/ipc-flatpak-service-impl.c
index 137cb225c..6222704af 100644
--- a/src/plugins/flatpak/daemon/ipc-flatpak-service-impl.c
+++ b/src/plugins/flatpak/daemon/ipc-flatpak-service-impl.c
@@ -1554,10 +1554,6 @@ ipc_flatpak_service_impl_constructed (GObject *object)
 
   ipc_flatpak_service_set_default_arch (IPC_FLATPAK_SERVICE (self), flatpak_get_default_arch ());
 
-  user_file = g_file_new_build_filename (g_get_home_dir (), ".local", "share", "flatpak", NULL);
-  if ((user = flatpak_installation_new_for_path (user_file, TRUE, NULL, NULL)))
-    add_installation (self, user, NULL);
-
   if ((installations = flatpak_get_system_installations (NULL, NULL)))
     {
       for (guint i = 0; i < installations->len; i++)
diff --git a/src/plugins/flatpak/gbp-flatpak-client.c b/src/plugins/flatpak/gbp-flatpak-client.c
index 319d9a8d4..d168919d3 100644
--- a/src/plugins/flatpak/gbp-flatpak-client.c
+++ b/src/plugins/flatpak/gbp-flatpak-client.c
@@ -146,6 +146,7 @@ gbp_flatpak_client_subprocess_spawned (GbpFlatpakClient        *self,
                                        IdeSubprocess           *subprocess,
                                        IdeSubprocessSupervisor *supervisor)
 {
+  g_autofree gchar *home_install = NULL;
   GList *queued;
 
   IDE_ENTRY;
@@ -176,6 +177,13 @@ gbp_flatpak_client_subprocess_spawned (GbpFlatpakClient        *self,
   /* We can have long running operations, so set no timeout */
   g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (self->service), G_MAXINT);
 
+  /* Add the --user installation as our first call before queued
+   * events can submit their operations.
+   */
+  home_install = g_build_filename (g_get_home_dir (), ".local", "share", "flatpak", NULL);
+  if (g_file_test (home_install, G_FILE_TEST_IS_DIR))
+    ipc_flatpak_service_call_add_installation (self->service, home_install, TRUE, NULL, NULL, NULL);
+
   queued = g_steal_pointer (&self->get_service.head);
 
   self->get_service.head = NULL;


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