Bug#836004: python-gflags: please make the build reproducible
Chris Lamb
lamby at debian.org
Mon Aug 29 22:27:01 UTC 2016
Source: python-gflags
Version: 1.5.1-2
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], I noticed
that python-gflags could not be built reproducibly.
Patch attached.
[0] https://reproducible-builds.org/
Regards,
--
,''`.
: :' : Chris Lamb
`. `'` lamby at debian.org / chris-lamb.co.uk
`-
-------------- next part --------------
--- a/debian/patches/reproducible-build.patch 1970-01-01 01:00:00.000000000 +0100
--- b/debian/patches/reproducible-build.patch 2016-08-29 23:26:39.050457866 +0100
@@ -0,0 +1,24 @@
+Description: Make the build reproducible
+Author: Chris Lamb <lamby at debian.org>
+Last-Update: 2016-08-29
+
+--- python-gflags-1.5.1.orig/gflags2man.py
++++ python-gflags-1.5.1/gflags2man.py
+@@ -174,6 +174,8 @@ class ProgramInfo(object):
+ self.modules = {} # { section_name(string), [ flags ] }
+ self.module_list = [] # list of module names in their original order
+ self.date = time.localtime(time.time()) # default date info
++ if 'SOURCE_DATE_EPOCH' in os.environ:
++ self.date = time.gmtime(int(os.environ['SOURCE_DATE_EPOCH']))
+
+ def Run(self):
+ """Run it and collect output.
+@@ -188,6 +190,8 @@ class ProgramInfo(object):
+
+ finfo = os.stat(self.executable)
+ self.date = time.localtime(finfo[stat.ST_MTIME])
++ if 'SOURCE_DATE_EPOCH' in os.environ:
++ self.date = time.gmtime(finfo[stat.ST_MTIME])
+
+ logging.info('Running: %s %s </dev/null 2>&1'
+ % (self.executable, FLAGS.help_flag))
--- a/debian/patches/series 2016-08-29 23:21:57.615594011 +0100
--- b/debian/patches/series 2016-08-29 23:26:38.086448077 +0100
@@ -1,2 +1,3 @@
python2.7-testsuite.patch
python3-fixes.patch
+reproducible-build.patch
More information about the Reproducible-builds
mailing list