summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lamb <chris@chris-lamb.co.uk>2021-08-10 11:57:34 +0100
committerVagrant Cascadian <vagrant@debian.org>2022-12-29 11:10:52 -0800
commit986f3e5bd0dd74f93dca15637e2c1242c6546d76 (patch)
treeb9a88d21d11ce40f34f8f0a3a9b08eaa44ae8ed9
parentc9aea7efe0c8223f4b6f9742bcfe95c67f151ec5 (diff)
Changes to generation of pytsk3.c for reproducible build
(Closes: #992060) Merged upstream as https://github.com/py4n6/pytsk/commit/f2b9ffa642a83127eb0e517a1f0ed4a22a99199a in pull request https://github.com/py4n6/pytsk/pull/81
-rw-r--r--class_parser.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/class_parser.py b/class_parser.py
index be994dc..4d05307 100644
--- a/class_parser.py
+++ b/class_parser.py
@@ -913,8 +913,9 @@ uint64_t integer_object_copy_to_uint64(PyObject *integer_object) {{
for class_name in self.classes.keys():
self.initialise_class(class_name, out, done)
- # Add the constants in here
- for constant, type in self.constants:
+ # Add the constants here. Make sure they are sorted so builds
+ # of pytsk3.c are reproducible.
+ for constant, type in sorted(self.constants):
if type == "integer":
out.write(
" tmp = PyLong_FromUnsignedLongLong((uint64_t) {0:s});\n".format(constant))