-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We need to sort python dict output to be deterministic and generate consistent header files. (From OE-Core rev: 91abfa2bd11234874af6dd63d82a2c268d7ddb2c) Signed-off-by: Richard Purdie <[email protected]>
- Loading branch information
Showing
2 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
The order of dict values is not deterministic leading to differing header file generation. | ||
Sort to remove this inconsistency. | ||
|
||
RP 2020/2/7 | ||
|
||
Signed-off-by: Richard Purdie <[email protected]> | ||
Upstream-Status: Pending | ||
|
||
Index: a/libevdev/make-event-names.py | ||
=================================================================== | ||
--- a/libevdev/make-event-names.py | ||
+++ b/libevdev/make-event-names.py | ||
@@ -67,10 +67,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("") | ||
@@ -111,7 +111,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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters