Mercurial > hg > orthanc
comparison Plugins/Samples/WebSkeleton/Framework/EmbedResources.py @ 3587:76b3228f99b0
Sort file lists
to make builds reproducible in spite of
nondeterministic filesystem readdir order.
See https://reproducible-builds.org/ for why this matters.
author | Bernhard M. Wiedemann <bernhard+hgcommit@lsmod.de> |
---|---|
date | Thu, 05 Dec 2019 16:21:41 +0100 |
parents | 4e43e67f8ecf |
children | 94f4a18a79cc |
comparison
equal
deleted
inserted
replaced
3586:732922e48937 | 3587:76b3228f99b0 |
---|---|
72 | 72 |
73 if os.path.isdir(pathName): | 73 if os.path.isdir(pathName): |
74 # The resource is a directory: Recursively explore its files | 74 # The resource is a directory: Recursively explore its files |
75 content = {} | 75 content = {} |
76 for root, dirs, files in os.walk(pathName): | 76 for root, dirs, files in os.walk(pathName): |
77 dirs.sort() | |
78 files.sort() | |
77 base = os.path.relpath(root, pathName) | 79 base = os.path.relpath(root, pathName) |
78 for f in files: | 80 for f in files: |
79 if f.find('~') == -1: # Ignore Emacs backup files | 81 if f.find('~') == -1: # Ignore Emacs backup files |
80 if base == '.': | 82 if base == '.': |
81 r = f | 83 r = f |