changeset 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 732922e48937
children a648c2d67a65
files Plugins/Samples/ModalityWorklists/WorklistsDatabase/Generate.py Plugins/Samples/WebSkeleton/Framework/EmbedResources.py Resources/EmbedResources.py
diffstat 3 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/Samples/ModalityWorklists/WorklistsDatabase/Generate.py	Mon Dec 02 11:32:21 2019 +0100
+++ b/Plugins/Samples/ModalityWorklists/WorklistsDatabase/Generate.py	Thu Dec 05 16:21:41 2019 +0100
@@ -6,7 +6,7 @@
 SOURCE = '/home/jodogne/Downloads/dcmtk-3.6.0/dcmwlm/data/wlistdb/OFFIS/'
 TARGET = os.path.abspath(os.path.dirname(__file__))
 
-for f in os.listdir(SOURCE):
+for f in sorted(os.listdir(SOURCE)):
     ext = os.path.splitext(f)
 
     if ext[1].lower() == '.dump':
--- a/Plugins/Samples/WebSkeleton/Framework/EmbedResources.py	Mon Dec 02 11:32:21 2019 +0100
+++ b/Plugins/Samples/WebSkeleton/Framework/EmbedResources.py	Thu Dec 05 16:21:41 2019 +0100
@@ -74,6 +74,8 @@
         # The resource is a directory: Recursively explore its files
         content = {}
         for root, dirs, files in os.walk(pathName):
+            dirs.sort()
+            files.sort()
             base = os.path.relpath(root, pathName)
             for f in files:
                 if f.find('~') == -1:  # Ignore Emacs backup files
--- a/Resources/EmbedResources.py	Mon Dec 02 11:32:21 2019 +0100
+++ b/Resources/EmbedResources.py	Thu Dec 05 16:21:41 2019 +0100
@@ -101,6 +101,8 @@
         # The resource is a directory: Recursively explore its files
         content = {}
         for root, dirs, files in os.walk(pathName):
+            dirs.sort()
+            files.sort()
             base = os.path.relpath(root, pathName)
 
             # Fix issue #24 (Build fails on OSX when directory has .DS_Store files):