Merge "Build: Refactor and clean up runtime_libart"
diff --git a/tools/fs_config/README b/tools/fs_config/README
index 7eca4a3..0258687 100644
--- a/tools/fs_config/README
+++ b/tools/fs_config/README
@@ -67,8 +67,9 @@
* hex (0xFF)
For multiple caps, just separate by whitespace.
-It is an error to specify multiple sections with the same [path]. Per the ini
-specifications enforced by Pythons ConfigParser.
+It is an error to specify multiple sections with the same [path] in different
+files. Note that the same file may contain sections that override the previous
+section in Python versions <= 3.2. In Python 3.2 it's set to strict mode.
The next section type is the "AID" section, for specifying OEM specific AIDS.
@@ -84,13 +85,13 @@
The <name> can be any valid character for a #define identifier in C.
value:
- A valid C style number string. Hex, octal, binary and decimal are supported. See "caps"
- above for more details on number formatting.
+ A valid C style number string. Hex, octal, binary and decimal are supported.
+ See "caps" above for more details on number formatting.
-It is an error to specify multiple sections with the same [AID_<name>]. Per the ini
-specifications enforced by Pythons ConfigParser. It is also an error to specify
-multiple sections with the same value option. It is also an error to specify a value
-that is outside of the inclusive OEM ranges:
+It is an error to specify multiple sections with the same [AID_<name>]. With
+the same constraints as [path] described above. It is also an error to specify
+multiple sections with the same value option. It is also an error to specify a
+value that is outside of the inclusive OEM ranges:
* AID_OEM_RESERVED_START(2900) - AID_OEM_RESERVED_END(2999)
* AID_OEM_RESERVED_2_START(5000) - AID_OEM_RESERVED_2_END(5999)
diff --git a/tools/fs_config/fs_config_generator.py b/tools/fs_config/fs_config_generator.py
index 482c2bc..6a16fea 100755
--- a/tools/fs_config/fs_config_generator.py
+++ b/tools/fs_config/fs_config_generator.py
@@ -183,8 +183,6 @@
are_aids = len(aids) > 0
if are_aids:
- # sort on value of (file_name, name, value, strvalue)
- aids.sort(key=lambda x: x[2])
for a in aids:
# use the preserved str value
print FILE_COMMENT % a[0]
@@ -272,7 +270,24 @@
for x in sys.argv[1:]:
parse(x, files, dirs, aids, seen_paths, seen_aids)
+ # sort entries:
+ # * specified path before prefix match
+ # ** ie foo before f*
+ # * lexicographical less than before other
+ # ** ie boo before foo
+ # Given these paths:
+ # paths=['ac', 'a', 'acd', 'an', 'a*', 'aa', 'ac*']
+ # The sort order would be:
+ # paths=['a', 'aa', 'ac', 'acd', 'an', 'ac*', 'a*']
+ # Thus the fs_config tools will match on specified paths before attempting
+ # prefix, and match on the longest matching prefix.
files.sort(key= lambda x: file_key(x[1]))
+
+ # sort on value of (file_name, name, value, strvalue)
+ # This is only cosmetic so AIDS are arranged in ascending order
+ # within the generated file.
+ aids.sort(key=lambda x: x[2])
+
generate(files, dirs, aids)
if __name__ == '__main__':