File reproducible.patch of Package deepin-gettext-tools
commit 5ab2f8408ca5a6b8ae5919855be7ef7be24a2c44
Author: Jelle van der Waa <jelle@vdwaa.nl>
Date: Sat Jul 31 22:52:00 2021 +0200
fix: Make generated policy files reproducible
To generate reproducible policy files on different filesystems the
Python dictionary has to be sorted when iterated over.
Log:
diff --git a/src/policy_ts_convert.py b/src/policy_ts_convert.py
index 5d231bc..75936a4 100755
--- a/src/policy_ts_convert.py
+++ b/src/policy_ts_convert.py
@@ -137,7 +137,7 @@ def ts2policy(policyFile, tsDir, outputPolicyFile):
for action_elem in tree.iter("action"):
action = Action(action_elem)
- for lang in tr_dict:
+ for lang in sorted(tr_dict):
d = tr_dict[lang]
src = ""
for ty in ["description", "message"]: