]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[console] Ensure that all ASCII characters are reachable in all keymaps
authorMichael Brown <mcb30@ipxe.org>
Tue, 15 Feb 2022 11:51:37 +0000 (11:51 +0000)
committerMichael Brown <mcb30@ipxe.org>
Tue, 15 Feb 2022 13:38:21 +0000 (13:38 +0000)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/util/genkeymap.py

index e471cd31aa41c4dd311d04e5bf9f021a9d65a146..8df949612b1984657c595f502cbb4438d5c1fa18 100755 (executable)
@@ -381,6 +381,12 @@ class Keymap:
                  if source.isprintable()
                  and target
                  and target in unreachable}
+        # Check that all characters are now reachable
+        unreachable -= set(table.values())
+        if unreachable:
+            raise ValueError("Unreachable characters: %s" % ', '.join(
+                KeymapKeys.ascii_name(x) for x in sorted(unreachable)
+            ))
         return KeymapKeys(dict(sorted(table.items())))
 
     def cname(self, suffix: str) -> str: