Skip to content

Commit 7131fff

Browse files
fix: make sure files are zipped in the same order
Followup of #182 Sort files before zipping, so that the zips are fully reproducible.
1 parent e406801 commit 7131fff

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/lib/fs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ def ensure_dir(file_path):
7878

7979

8080
def make_zip(input_dir: str, output_zip: str):
81-
os.makedirs(dirname(output_zip), exist_ok=True)
81+
ensure_dir(output_zip)
8282

8383
with ReproducibleZipFile(output_zip, "w") as z:
8484
for root, dirs, files in os.walk(input_dir):
85-
for file in files:
85+
for file in sorted(files):
8686
if not file.endswith(".zip"):
8787
filepath = join(root, file)
8888
arcpath = relpath(filepath, input_dir)

0 commit comments

Comments
 (0)