1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-10 22:56:15 +01:00
Take SOURCE_DATE_EPOCH env variable into account when generating the
manpage (in order to support reproducible builds).
This commit is contained in:
Marcus Huewe 2017-06-18 17:51:52 +02:00
commit 2f4792b56d

View File

@ -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()