[Reproducible-builds] Bug#831065: python-kinterbasdb: please make the build reproducible
Chris Lamb
lamby at debian.org
Thu Jul 14 07:47:55 UTC 2016
Source: python-kinterbasdb
Version: 3.3.0-3
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-builds at lists.alioth.debian.org
Hi,
Whilst working on the "reproducible builds" effort [0], we
noticed that python-kinterbasdb could not be built reproducibly.
Patch attached.
[0] https://wiki.debian.org/ReproducibleBuilds
Regards,
--
,''`.
: :' : Chris Lamb
`. `'` lamby at debian.org / chris-lamb.co.uk
`-
-------------- next part --------------
--- a/debian/patches/03_reproducible_build.patch 1970-01-01 02:00:00.000000000 +0200
--- b/debian/patches/03_reproducible_build.patch 2016-07-14 09:45:51.028259634 +0200
@@ -0,0 +1,23 @@
+Author: Chris Lamb <lamby at debian.org>
+Last-Update: 2016-07-14
+
+--- python-kinterbasdb-3.3.0.orig/setup.py
++++ python-kinterbasdb-3.3.0/setup.py
+@@ -1,7 +1,7 @@
+ # This horrible tangle of code will soon be blown away and replaced with
+ # something more respectable. Yep, RSN.
+
+-import re, struct, sys, time
++import re, struct, sys, time, os, datetime
+ from StringIO import StringIO
+
+ # Exclude old versions of Python:
+@@ -129,7 +129,7 @@ if not shouldSkipBuild:
+
+ reTimestamp = re.compile(r"^(__timestamp__\s+=\s+')(.*?)(')$", re.MULTILINE)
+ initModuleCode = reTimestamp.sub(
+- r'\g<1>%s\g<3>' % time.strftime('%Y.%m.%d.%H.%M.%S.UTC', time.gmtime()),
++ r'\g<1>%s\g<3>' % datetime.datetime.utcfromtimestamp(int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))).strftime('%Y.%m.%d.%H.%M.%S.UTC'),
+ initModuleCode
+ )
+
--- a/debian/patches/series 2016-07-14 09:34:41.760405146 +0200
--- b/debian/patches/series 2016-07-14 09:45:40.540139851 +0200
@@ -1 +1,2 @@
02_drop_removed_fb_defines.patch
+03_reproducible_build.patch
More information about the Reproducible-builds
mailing list