mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2025-12-25 07:00:07 +01:00
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>
This commit is contained in:
parent
8855f1ac59
commit
8d70f44989
1 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue