From a472fcb522fcdb7bdb9bb3b413d88392113f174e Mon Sep 17 00:00:00 2001 From: "Bernhard M. Wiedemann" Date: Sat, 17 Jun 2017 17:40:42 +0200 Subject: [PATCH] Allow to override man-page date to enable reproducible builds of osc packages --- osc/cmdln.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osc/cmdln.py b/osc/cmdln.py index da49ce61..3d303b09 100644 --- a/osc/cmdln.py +++ b/osc/cmdln.py @@ -45,8 +45,9 @@ import re import cmd import optparse import sys +import time from pprint import pprint -from datetime import date +from datetime import datetime # this is python 2.x style def introspect_handler_2(handler): @@ -619,9 +620,10 @@ class RawCmdln(cmd.Cmd): usage: ${name} man """ + mandate = datetime.utcfromtimestamp(int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))) self.stdout.write(bytes( self.man_header % { - 'date': date.today().strftime('%b %Y'), + 'date': mandate.strftime('%b %Y'), 'version': self.get_version(), 'name': self.name, 'ucname': self.name.upper()