GNOME #670493

Index: dconf-0.13.4/bin/dconf-update.vala
===================================================================
--- dconf-0.13.4.orig/bin/dconf-update.vala	2012-07-14 06:07:48.000000000 +1200
+++ dconf-0.13.4/bin/dconf-update.vala	2012-07-19 10:56:15.033408852 +1200
@@ -241,7 +241,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
Index: dconf-0.13.4/bin/dconf.vala
===================================================================
--- dconf-0.13.4.orig/bin/dconf.vala	2012-07-14 06:07:48.000000000 +1200
+++ dconf-0.13.4/bin/dconf.vala	2012-07-19 10:56:15.033408852 +1200
@@ -56,7 +56,7 @@
 
 		case "update":
 			description = "Update the system dconf databases";
-			synopsis = "";
+			synopsis = "[DIR]";
 			break;
 
 		case "watch":
@@ -119,7 +119,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");
 			}
 
Index: dconf-0.13.4/engine/dconf-engine-source-system.c
===================================================================
--- dconf-0.13.4.orig/engine/dconf-engine-source-system.c	2012-07-19 10:54:26.000000000 +1200
+++ dconf-0.13.4/engine/dconf-engine-source-system.c	2012-07-19 10:56:15.037408851 +1200
@@ -48,7 +48,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)
Index: dconf-0.13.4/engine/dconf-engine-profile.c
===================================================================
--- dconf-0.13.4.orig/engine/dconf-engine-profile.c	2012-07-14 06:07:48.000000000 +1200
+++ dconf-0.13.4/engine/dconf-engine-profile.c	2012-07-19 10:57:03.645407172 +1200
@@ -192,7 +192,10 @@
     }
   else if (profile[0] != '/')
     {
-      gchar *filename = g_build_filename ("/etc/dconf/profile", profile, NULL);
+      const gchar *dconf_dir = g_getenv ("DCONF_DIR");
+      if (dconf_dir == NULL)
+        dconf_dir = "/etc/dconf";
+      gchar *filename = g_build_filename (dconf_dir, "profile", profile, NULL);
       file = fopen (filename, "r");
       g_free (filename);
     }
