OSDN Git Service

fat16copy: Sort new directory entries.
authorAlex Deymo <deymo@google.com>
Fri, 23 Sep 2016 20:12:33 +0000 (13:12 -0700)
committerAlex Deymo <deymo@google.com>
Fri, 23 Sep 2016 21:21:38 +0000 (14:21 -0700)
Sort the entries returned by os.listdir to give a consistent ordering
across build.

Bug: None
Test: `make dist`

(cherry picked from commit ef34e5dca216e61fd81020e818f247f6ce47d26e)

Change-Id: I2f80889684f108208f07e13d725acaa7bc0ab099

tools/fat16copy.py

index 77500eb..f49c4fe 100755 (executable)
@@ -787,7 +787,7 @@ def add_item(directory, item):
     if len(base) == 0:
       base = os.path.basename(item[:-1])
     sub = directory.new_subdirectory(base)
-    for next_item in os.listdir(item):
+    for next_item in sorted(os.listdir(item)):
       add_item(sub, os.path.join(item, next_item))
   else:
     with open(item, 'rb') as f: