From: Ross Burton Date: Thu, 19 Oct 2023 13:40:53 +0000 (+0100) Subject: patchtest: sort when reading patches from a directory X-Git-Tag: yocto-5.2~4807 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4d6b586d37ab4528ed6dae6779cd730af9ef09c2;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git patchtest: sort when reading patches from a directory 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 Signed-off-by: Richard Purdie --- diff --git a/scripts/patchtest b/scripts/patchtest index b71345d828a..a1c824f7b7c 100755 --- a/scripts/patchtest +++ b/scripts/patchtest @@ -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]