summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-02-20 14:41:01 +0000
committerPeter Hutterer <peter.hutterer@who-t.net>2021-02-22 07:06:46 +1000
commit8d70f449892c6f7659e07bb0f06b8347677bb7d8 (patch)
tree8bd43bbb95e57c71d276583539f0fff0fc4c326b
parent8855f1ac59a69d5bdff51e3f8980697f0127c270 (diff)
make-event-names: Fix determinism issue
The order of dict values is not deterministic in python leading to differing  header file generation which results in differing build output for the same configuration. Sort to remove this inconsistency and make the output  reproducible. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Reviewed-by: Filipe Laíns <lains@archlinux.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rwxr-xr-xlibevdev/make-event-names.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/libevdev/make-event-names.py b/libevdev/make-event-names.py
index 88addd7..743b4b5 100755
--- a/libevdev/make-event-names.py
+++ b/libevdev/make-event-names.py
@@ -70,10 +70,10 @@ def print_bits(bits, prefix):
if not hasattr(bits, prefix):
return
print("static const char * const %s_map[%s_MAX + 1] = {" % (prefix, prefix.upper()))
- for val, name in list(getattr(bits, prefix).items()):
+ for val, name in sorted(list(getattr(bits, prefix).items())):
print(" [%s] = \"%s\"," % (name, name))
if prefix == "key":
- for val, name in list(getattr(bits, "btn").items()):
+ for val, name in sorted(list(getattr(bits, "btn").items())):
print(" [%s] = \"%s\"," % (name, name))
print("};")
print("")
@@ -118,7 +118,7 @@ def print_lookup(bits, prefix):
if not hasattr(bits, prefix):
return
- names = list(getattr(bits, prefix).items())
+ names = sorted(list(getattr(bits, prefix).items()))
if prefix == "btn":
names = names + btn_additional