]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
patchtest: sort when reading patches from a directory
authorRoss Burton <ross.burton@arm.com>
Thu, 19 Oct 2023 13:40:53 +0000 (14:40 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 19 Oct 2023 13:53:43 +0000 (14:53 +0100)
When reading patches from a directory it's important to sort the output
of os.listdir(), as that returns the files in an effectively random
order.  We can't test the patches apply if they're applied in the wrong
order, and typically patch filenames are prefixed with a counter to
ensure the order is correct.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/patchtest

index b71345d828acc994760c04c6845e1410fba3ad37..a1c824f7b7c35fbb9e563332557a0137391ba06e 100755 (executable)
@@ -177,7 +177,7 @@ def main():
         return 1
 
     if os.path.isdir(patch_path):
-        patch_list = [os.path.join(patch_path, filename) for filename in os.listdir(patch_path)]
+        patch_list = [os.path.join(patch_path, filename) for filename in sorted(os.listdir(patch_path))]
     else:
         patch_list = [patch_path]