Index: dconf-0.10.0/bin/dconf-update.vala
===================================================================
--- dconf-0.10.0.orig/bin/dconf-update.vala	2012-02-20 23:54:10.342034493 +0100
+++ dconf-0.10.0/bin/dconf-update.vala	2012-02-21 01:31:29.710581713 +0100
@@ -41,17 +41,38 @@ unowned Gvdb.Item get_parent (Gvdb.HashT
 	return parent;
 }
 
-Gvdb.HashTable? read_locks_directory (string dirname) throws GLib.Error {
+string[]? list_directory (string dirname) throws GLib.Error {
+	var l = new SList<string> ();
 	var dir = Dir.open (dirname);
+	unowned string? name;
+	string[] entries = {};
 
 	if (dir == null) {
 		return null;
 	}
+	while ((name = dir.read_name ()) != null) {
+		l.insert_sorted (name, strcmp);
+	}
+	// Go through directories in reverse order.
+	// This is so that values in higher-numbered files take precedence.
+	l.reverse();
+
+	foreach (string s in l) {
+		entries += s;
+	}
+	return entries;
+}
+
+Gvdb.HashTable? read_locks_directory (string dirname) throws GLib.Error {
+	var entries = list_directory (dirname);
+
+	if (entries == null) {
+		return null;
+	}
 
 	var table = new Gvdb.HashTable ();
-	unowned string? name;
 
-	while ((name = dir.read_name ()) != null) {
+	foreach (var name in entries) {
 		var filename = Path.build_filename (dirname, name);
 		Posix.Stat buf;
 
@@ -75,12 +96,10 @@ Gvdb.HashTable? read_locks_directory (st
 
 Gvdb.HashTable read_directory (string dirname) throws GLib.Error {
 	var table = new Gvdb.HashTable ();
-	unowned string? name;
 
 	table.insert ("/");
 
-	var dir = Dir.open (dirname);
-	while ((name = dir.read_name ()) != null) {
+	foreach (var name in list_directory (dirname)) {
 		var filename = Path.build_filename (dirname, name);
 		Posix.Stat buf;
 
@@ -194,11 +213,7 @@ void maybe_update_from_directory (string
 }
 
 void update_all (string dirname) throws GLib.Error {
-	unowned string? name;
-
-	var dir = Dir.open (dirname);
-
-	while ((name = dir.read_name ()) != null) {
+	foreach (var name in list_directory (dirname)) {
 		if (name.has_suffix (".d")) {
 			try {
 				maybe_update_from_directory (Path.build_filename (dirname, name));
