Skip to content

Commit

Permalink
build: Use UTC datetime for build info.
Browse files Browse the repository at this point in the history
Makes build reproducible per https://wiki.debian.org/ReproducibleBuilds

Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk>
  • Loading branch information
lamby authored and bradleysepos committed Sep 9, 2016
1 parent 0b33dd8 commit fc267da
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions make/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ def _action( self ):

url_ctype = '_unstable'
url_ntype = 'unstable'
self.build = time.strftime('%Y%m%d') + '01'
self.build = time.strftime('%Y%m%d', now) + '01'
self.title = '%s %s (%s)' % (self.name,self.version,self.build)
else:
m = re.match('^([a-zA-Z]+)\.([0-9]+)$', suffix)
Expand All @@ -867,7 +867,7 @@ def _action( self ):
url_ctype = '_unstable'
url_ntype = 'unstable'

self.build = time.strftime('%Y%m%d') + '00'
self.build = time.strftime('%Y%m%d', now) + '00'
self.title = '%s %s (%s)' % (self.name,self.version,self.build)

self.url_appcast = 'https://handbrake.fr/appcast%s%s.xml' % (url_ctype,url_arch)
Expand Down Expand Up @@ -1484,6 +1484,8 @@ def infof( self, format, *args ):
if arg == '--verbose':
verbose = Configure.OUT_VERBOSE

now = time.gmtime(int(os.environ.get('SOURCE_DATE_EPOCH', time.time())))

## create main objects; actions/probes run() is delayed.
## if any actions must be run earlier (eg: for configure --help purposes)
## then run() must be invoked earlier. subequent run() invocations
Expand Down Expand Up @@ -1824,7 +1826,7 @@ class Tools:
else:
doc.add( 'BUILD.cross.prefix', '' )

doc.add( 'BUILD.date', time.strftime('%c') )
doc.add( 'BUILD.date', time.strftime('%c', now) ),
doc.add( 'BUILD.arch', arch.mode.mode )

doc.addBlank()
Expand Down

0 comments on commit fc267da

Please sign in to comment.