File: reproducible-build.patch

package info (click to toggle)
python-gflags 1.5.1-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 976 kB
  • sloc: python: 3,374; makefile: 15; sh: 5
file content (24 lines) | stat: -rw-r--r-- 979 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Description: Make the build reproducible
Author: Chris Lamb <lamby@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(int(os.environ['SOURCE_DATE_EPOCH']))
 
     logging.info('Running: %s %s </dev/null 2>&1'
                  % (self.executable, FLAGS.help_flag))