Control: tags 992060 pending

On 2021-08-10, Chris Lamb wrote:
> Whilst working on the Reproducible Builds effort [0] we noticed that
> pytsk could not be built reproducibly.
>
> This is because it generated a pytsk3.c file in a nondeterministic
> manner, specifically by naively iterating over a Python set()
> structure.

I have uploaded an NMU to DELAYED/10 applying the patch included
upstream:

diff -Nru pytsk-20200117/debian/changelog pytsk-20200117/debian/changelog
--- pytsk-20200117/debian/changelog     2021-01-27 06:48:04.000000000 -0800
+++ pytsk-20200117/debian/changelog     2022-12-29 11:12:45.000000000 -0800
@@ -1,3 +1,13 @@
+pytsk (20200117-3.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+
+  [ Chris Lamb ]
+  * debian/patches: Changes to generation of pytsk3.c for reproducible
+    build (Closes: #992060)
+
+ -- Vagrant Cascadian <vagr...@reproducible-builds.org>  Thu, 29 Dec 2022 
11:12:45 -0800
+
 pytsk (20200117-3) unstable; urgency=medium
 
   * Team upload.
diff -Nru 
pytsk-20200117/debian/patches/changes-to-generation-of-pytsk3.c-for-re.patch 
pytsk-20200117/debian/patches/changes-to-generation-of-pytsk3.c-for-re.patch
--- 
pytsk-20200117/debian/patches/changes-to-generation-of-pytsk3.c-for-re.patch    
    1969-12-31 16:00:00.000000000 -0800
+++ 
pytsk-20200117/debian/patches/changes-to-generation-of-pytsk3.c-for-re.patch    
    2022-12-29 11:12:45.000000000 -0800
@@ -0,0 +1,27 @@
+From: Chris Lamb <ch...@chris-lamb.co.uk>
+Date: Tue, 10 Aug 2021 11:57:34 +0100
+X-Dgit-Generated: 20200117-3.1 986f3e5bd0dd74f93dca15637e2c1242c6546d76
+Subject: 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
+
+---
+
+--- pytsk-20200117.orig/class_parser.py
++++ pytsk-20200117/class_parser.py
+@@ -913,8 +913,9 @@ uint64_t integer_object_copy_to_uint64(P
+         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))
diff -Nru pytsk-20200117/debian/patches/series 
pytsk-20200117/debian/patches/series
--- pytsk-20200117/debian/patches/series        2021-01-27 06:48:04.000000000 
-0800
+++ pytsk-20200117/debian/patches/series        2022-12-29 11:12:45.000000000 
-0800
@@ -1,2 +1,3 @@
 0001-Link-system-tsk-statically-talloc-dynamically-instea.patch
 change-lexer.patch
+changes-to-generation-of-pytsk3.c-for-re.patch


live well,
  vagrant

Attachment: signature.asc
Description: PGP signature

Reply via email to