]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
make_cpio: sort files used as cpio input
authorMalte Poll <1780588+malt3@users.noreply.github.com>
Mon, 11 Dec 2023 10:40:18 +0000 (11:40 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 12 Dec 2023 11:43:56 +0000 (12:43 +0100)
Pathlib's glob functions return files in the order used by the filesystem.
This may differ between implementations and configuration (file system, locale).
For better reproducibility, the file list should be sorted.

mkosi/archive.py

index a08e9092df0612533f2bc9e89bf952ac0824b97e..d6f3772eca7066efef5ce5b501f15c37f9c61ea7 100644 (file)
@@ -89,6 +89,7 @@ def extract_tar(src: Path, dst: Path, log: bool = True) -> None:
 def make_cpio(src: Path, dst: Path, files: Optional[Iterable[Path]] = None) -> None:
     if not files:
         files = src.rglob("*")
+    files = sorted(files)
 
     log_step(f"Creating cpio archive {dst}…")
     bwrap(