Package: d-conf / 0.22.0-1

01_env_path.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
GNOME #670493

This patch was rejected upstream (pending alternative solution).
Maybe we should drop it?

At least gdm in Debian currently still requires this, but it's been reworked
upstream. See:
  https://bugzilla.gnome.org/show_bug.cgi?id=722241
once we have this in Debian, check that DCONF_DIR is no longer used in the
archive and then consider dropping this patch if it's not.

--- a/bin/dconf-update.vala
+++ b/bin/dconf-update.vala
@@ -248,7 +248,16 @@
 }
 
 void dconf_update (string[] args) throws GLib.Error {
-	update_all ("/etc/dconf/db");
+	if (args[2] != null) {
+		update_all (args[2]);
+	} else {
+		var dirname = GLib.Environment.get_variable ("DCONF_DIR"
+);
+		if (dirname == null) {
+			dirname = "/etc/dconf";
+		}
+		update_all (Path.build_filename (dirname, "db"));
+	}
 }
 
 // vim:noet ts=4 sw=4
--- a/bin/dconf.vala
+++ b/bin/dconf.vala
@@ -59,7 +59,7 @@
 
 		case "update":
 			description = "Update the system dconf databases";
-			synopsis = "";
+			synopsis = " [DIR] ";
 			break;
 
 		case "watch":
@@ -123,7 +123,9 @@
 				str.append ("  KEY         A key path (starting, but not ending with '/')\n");
 			}
 
-			if (" PATH " in synopsis || " DIR " in synopsis) {
+			if (" [DIR] " in synopsis ) {
+				str.append ("  DIR         Directory containing the databases to update\n");
+			} else if (" PATH " in synopsis || " DIR " in synopsis) {
 				str.append ("  DIR         A directory path (starting and ending with '/')\n");
 			}
 
--- a/engine/dconf-engine-source-system.c
+++ b/engine/dconf-engine-source-system.c
@@ -47,7 +47,10 @@
   GvdbTable *table;
   gchar *filename;
 
-  filename = g_build_filename ("/etc/dconf/db", source->name, NULL);
+  const gchar *dconf_dir = g_getenv ("DCONF_DIR");
+  if (dconf_dir == NULL)
+    dconf_dir = "/etc/dconf";
+  filename = g_build_filename (dconf_dir, "db", source->name, NULL);
   table = gvdb_table_new (filename, FALSE, &error);
 
   if (table == NULL)
--- a/engine/dconf-engine-profile.c
+++ b/engine/dconf-engine-profile.c
@@ -202,8 +202,13 @@
   do
     {
       gchar *filename;
+      const gchar *dconf_dir;
 
-      filename = g_build_filename (prefix, "dconf/profile", profile, NULL);
+      dconf_dir = g_getenv ("DCONF_DIR");
+      if (dconf_dir == NULL)
+        filename = g_build_filename (prefix, "dconf/profile", profile, NULL);
+      else
+        filename = g_build_filename (dconf_dir, "profile", profile, NULL);
       fp = fopen (filename, "r");
 
       /* If it wasn't ENOENT then we don't want to continue on to check