From: Patrick Talbert ptalbert@redhat.com
[redhat] scripts: sort dumped keys in uki_create_json.py
The order of the keys in the json output may change causing unnecessary churn in the dist-git diffs. Fix this by setting sort_keys=True in the json.dump() call. Outside of locale sorting differences this should provide a more stable experience.
Signed-off-by: Patrick Talbert ptalbert@redhat.com
diff --git a/redhat/scripts/uki_addons/uki_create_json.py b/redhat/scripts/uki_addons/uki_create_json.py index blahblah..blahblah 100755 --- a/redhat/scripts/uki_addons/uki_create_json.py +++ b/redhat/scripts/uki_addons/uki_create_json.py @@ -86,7 +86,7 @@ def create_json(addons):
def write_json(obj, dest_file): with open(dest_file, 'w') as f: - json.dump(obj , f, indent=4) + json.dump(obj , f, indent=4, sort_keys=True) print(f'Processed addons files are in {dest_file}')
if __name__ == "__main__":
-- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3817
kernel@lists.fedoraproject.org