Skip to content

Commit 1c5ebdc

Browse files
lambytridge
authored andcommitted
Make the build reproducible
From https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1093201: Whilst working on the Reproducible Builds effort [0], we noticed that rsync could not be built reproducibly. This is because the date in the manual page can vary depending on whether there is a .git directory and the modification time of version.h and Mafile, which might get modified when patching via quilt. A patch is attached that makes this use SOURCE_DATE_EPOCH, which will always be reliable.
1 parent 9994933 commit 1c5ebdc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

md-convert

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,9 @@ def find_man_substitutions():
248248

249249
env_subs['date'] = time.strftime('%d %b %Y', time.gmtime(mtime + tz_offset)).lstrip('0')
250250

251+
if 'SOURCE_DATE_EPOCH' in os.environ:
252+
env_subs['date'] = time.strftime('%d %b %Y', time.gmtime(int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))))
253+
251254

252255
def html_via_commonmark(txt):
253256
return commonmark.HtmlRenderer().render(commonmark.Parser().parse(txt))

0 commit comments

Comments
 (0)