[gnome-builder] flatpak: override flatpak user dir



commit fed7cd76f6637f02d0667960d7651d096510a024
Author: Christian Hergert <chergert redhat com>
Date:   Wed Sep 21 17:54:47 2016 -0700

    flatpak: override flatpak user dir
    
    This is useful when running from inside the flatpak so that we get the
    proper user runtime directory.

 plugins/flatpak/gbp-flatpak-runtime-provider.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/plugins/flatpak/gbp-flatpak-runtime-provider.c b/plugins/flatpak/gbp-flatpak-runtime-provider.c
index d254f1b..cf54508 100644
--- a/plugins/flatpak/gbp-flatpak-runtime-provider.c
+++ b/plugins/flatpak/gbp-flatpak-runtime-provider.c
@@ -188,6 +188,8 @@ gbp_flatpak_runtime_provider_load_worker (GTask        *task,
 {
   GbpFlatpakRuntimeProvider *self = source_object;
   g_autoptr(GPtrArray) ret = NULL;
+  g_autoptr(GFile) file = NULL;
+  g_autofree gchar *path = NULL;
   GError *error = NULL;
 
   IDE_ENTRY;
@@ -206,7 +208,10 @@ gbp_flatpak_runtime_provider_load_worker (GTask        *task,
 
   gbp_flatpak_runtime_provider_load_refs (self, self->system_installation, ret, cancellable, &error);
 
-  if (NULL == (self->user_installation = flatpak_installation_new_user (cancellable, &error)))
+  path = g_build_filename (g_get_home_dir (), ".local", "share", "flatpak", NULL);
+  file = g_file_new_for_path (path);
+
+  if (NULL == (self->user_installation = flatpak_installation_new_for_path (file, TRUE, cancellable, 
&error)))
     {
       g_task_return_error (task, error);
       IDE_EXIT;


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