diff --git a/scripts/parse_syscalls.py b/scripts/parse_syscalls.py index 462989d89ee80a..bd712a50bd75c1 100644 --- a/scripts/parse_syscalls.py +++ b/scripts/parse_syscalls.py @@ -23,7 +23,9 @@ def analyze_headers(multiple_directories): ret = [] for base_path in multiple_directories: - for root, dirs, files in os.walk(base_path): + for root, dirs, files in os.walk(base_path, topdown=True): + dirs.sort() + files.sort() for fn in files: # toolchain/common.h has the definition of __syscall which we @@ -52,7 +54,9 @@ def parse_args(): formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument("-i", "--include", required=True, action='append', - help="Base include directory") + help='''include directories recursively scanned + for .h files. Can be specified multiple times: + -i topdir1 -i topdir2 ...''') parser.add_argument( "-j", "--json-file", required=True, help="Write system call prototype information as json to file") diff --git a/scripts/subfolder_list.py b/scripts/subfolder_list.py index 7c71c681308cd2..c593d525a79952 100644 --- a/scripts/subfolder_list.py +++ b/scripts/subfolder_list.py @@ -45,7 +45,8 @@ def main(): else: dirlist.extend(args.directory) dirlist.extend(os.linesep) - for root, dirs, files in os.walk(args.directory): + for root, dirs, _ in os.walk(args.directory, topdown=True): + dirs.sort() for subdir in dirs: if(args.create_links is not None): directory = os.path.join(root, subdir)