]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
ukify: fix hwids section reproducibility
authorLuca Boccassi <luca.boccassi@gmail.com>
Wed, 30 Jul 2025 23:04:33 +0000 (00:04 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Mon, 4 Aug 2025 15:54:13 +0000 (16:54 +0100)
When there are multiple json files the glob list output is
not stable. Sort it before use.

Follow-up for 0333b9d5892983efc690d444fb8783624a1ef476

(cherry picked from commit 3ddb2ee1721f568c3b9340e2dc78bd5b78bf397c)

src/ukify/ukify.py

index c1d69946659a8f1c400298d63af4e7d1b8309e48..95b46b2daf908d055eb152c890545ec274dd4d6c 100755 (executable)
@@ -1062,7 +1062,7 @@ def pack_strings(strings: set[str], base: int) -> tuple[bytes, dict[str, int]]:
 
 
 def parse_hwid_dir(path: Path) -> bytes:
-    hwid_files = path.rglob('*.json')
+    hwid_files = sorted(path.rglob('*.json'))
 
     strings: set[str] = set()
     devices: collections.defaultdict[tuple[str, str], set[uuid.UUID]] = collections.defaultdict(set)