]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Add a trivial guard against using the same uuid twice 21425/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 19 Nov 2021 16:26:36 +0000 (17:26 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 19 Nov 2021 17:49:46 +0000 (18:49 +0100)
tools/list-discoverable-partitions.py

index e9a3dce11d43349097fb6c94ba63ab3017da4db4..2ad179c77694a78fcf1ccba0f8a1e4520c53c034 100644 (file)
@@ -169,10 +169,16 @@ def generate(defines):
 
     print(HEADER, end='')
 
+    uuids = set()
+
     for type, arch, uuid in defines:
         tdesc = TYPES[type]
         adesc = '' if arch is None else f' ({ARCHITECTURES[arch]})'
 
+        # Let's make sure that we didn't select&paste the same value twice
+        assert uuid not in uuids
+        uuids.add(uuid)
+
         if type != prevtype:
             prevtype = type
             morea, moreb = DESCRIPTIONS[type]