sort rules within collections
authorJohannes Berg <johannes@sipsolutions.net>
Sat, 24 May 2008 23:23:41 +0000 (01:23 +0200)
committerJohannes Berg <johannes@sipsolutions.net>
Sat, 24 May 2008 23:23:41 +0000 (01:23 +0200)
db2bin.py

index ed551bf..014f717 100755 (executable)
--- a/db2bin.py
+++ b/db2bin.py
@@ -75,6 +75,8 @@ for coll in collections:
     reg_rules_collections[coll] = output.tell()
     # struct regdb_file_reg_rules_collection
     be32(output, len(coll))
+    coll = list(coll)
+    coll.sort(cmp=lambda x, y: cmp(bands[x[0]], bands[y[0]]))
     for regrule in coll:
         be32(output, reg_rules[regrule])