Kaydet (Commit) dacaa583 authored tarafından Marcus Cobden's avatar Marcus Cobden

Walk file tree in order for deterministic builds

Python's `os.walk` does not order the lists of files and directories it returns, so in order to produce a consistent build context tarfile, they should be ordered.
üst 00e3ff95
...@@ -72,7 +72,8 @@ def tar(path, exclude=None): ...@@ -72,7 +72,8 @@ def tar(path, exclude=None):
fnames = [name for name in filenames fnames = [name for name in filenames
if not fnmatch_any(os.path.join(relpath, name), if not fnmatch_any(os.path.join(relpath, name),
exclude)] exclude)]
for name in fnames: dirnames.sort()
for name in sorted(fnames):
arcname = os.path.join(relpath, name) arcname = os.path.join(relpath, name)
t.add(os.path.join(path, arcname), arcname=arcname) t.add(os.path.join(path, arcname), arcname=arcname)
for name in dirnames: for name in dirnames:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment