]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
Make the build reproducible
authorChris Lamb <lamby@debian.org>
Tue, 12 Aug 2025 19:23:59 +0000 (20:23 +0100)
committerAndrew Tridgell <andrew@tridgell.net>
Sat, 23 Aug 2025 06:40:34 +0000 (16:40 +1000)
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.

md-convert

index fb2bc993f981116edd51c519c8e54657fd941201..06e5b1ef0d18f9ff71e6d6b6402bd37a221eed61 100755 (executable)
@@ -248,6 +248,9 @@ def find_man_substitutions():
 
     env_subs['date'] = time.strftime('%d %b %Y', time.gmtime(mtime + tz_offset)).lstrip('0')
 
+    if 'SOURCE_DATE_EPOCH' in os.environ:
+        env_subs['date'] = time.strftime('%d %b %Y', time.gmtime(int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))))
+
 
 def html_via_commonmark(txt):
     return commonmark.HtmlRenderer().render(commonmark.Parser().parse(txt))