Make timestamps in manual pages reproducible

Refer to https://reproducible-builds.org/docs/source-date-epoch/ for
documentation on SOURCE_DATE_EPOCH.

Bug-Debian: https://bugs.debian.org/1029807
Signed-off-by: Helmut Grohne <helmut@subdivi.de>

(cherry picked from commit 98352cf667)
This commit is contained in:
Vagrant Cascadian 2023-02-28 11:31:36 +01:00 committed by Helmut Grohne
parent a7a80ffe90
commit a5c9231e88
1 changed files with 5 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import sys
import textwrap
from collections import OrderedDict
from datetime import datetime
import time
from setuptools import Command
@ -459,7 +460,10 @@ class build_man(Command):
self.write_heading(write, description, double_sided=True)
# man page metadata
write(':Author: The Borg Collective')
write(':Date:', datetime.utcnow().date().isoformat())
write(
':Date:',
datetime.utcfromtimestamp(int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))).date().isoformat(),
)
write(':Manual section: 1')
write(':Manual group: borg backup tool')
write()