[gnome-build-meta/staging-3-30: 14/29] sdk/dconf: add patch for overriding dconf directory



commit 9bb2f49063f93829b38f769e892fc1a012b7e874
Author: Abderrahim Kitouni <a kitouni gmail com>
Date:   Tue Sep 18 13:34:22 2018 +0100

    sdk/dconf: add patch for overriding dconf directory
    
    Should hopefully fix #58

 elements/sdk/dconf.bst           |  2 ++
 files/dconf/dconf-override.patch | 23 +++++++++++++++++++++++
 2 files changed, 25 insertions(+)
---
diff --git a/elements/sdk/dconf.bst b/elements/sdk/dconf.bst
index de2c402..dc5cab4 100644
--- a/elements/sdk/dconf.bst
+++ b/elements/sdk/dconf.bst
@@ -3,6 +3,8 @@ sources:
 - kind: tar
   url: https://download.gnome.org/sources/dconf/0.30/dconf-0.30.0.tar.xz
   ref: 0af256c98395ec5241e830cb0cc760047dfa6d94f2fe93311e021ff94e14a715
+- kind: patch
+  path: files/dconf/dconf-override.patch
 depends:
 - sdk/glib.bst
 - filename: sdk/vala.bst
diff --git a/files/dconf/dconf-override.patch b/files/dconf/dconf-override.patch
new file mode 100644
index 0000000..0e95c22
--- /dev/null
+++ b/files/dconf/dconf-override.patch
@@ -0,0 +1,23 @@
+diff --git a/engine/dconf-engine-source-user.c b/engine/dconf-engine-source-user.c
+index 1657875..e4f8786 100644
+--- a/engine/dconf-engine-source-user.c
++++ b/engine/dconf-engine-source-user.c
+@@ -39,11 +39,17 @@ dconf_engine_source_user_open_gvdb (const gchar *name)
+ {
+   GvdbTable *table;
+   gchar *filename;
++  const gchar *override;
++
++  override = g_getenv ("DCONF_USER_CONFIG_DIR");
++  if (override == NULL)
++    filename = g_build_filename (g_get_user_config_dir (), "dconf", name, NULL);
++  else
++    filename = g_build_filename (g_get_home_dir (), override, name, NULL);
+ 
+   /* This can fail in the normal case of the user not having any
+    * settings.  That's OK and it shouldn't be considered as an error.
+    */
+-  filename = g_build_filename (g_get_user_config_dir (), "dconf", name, NULL);
+   table = gvdb_table_new (filename, FALSE, NULL);
+   g_free (filename);
+ 


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