Source: txt2man
Version: 1.5.6-3
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: toolchain timestamps
X-Debbugs-Cc: reproducible-builds@lists.alioth.debian.org

Hi!

When no explicit date is specified on the command line, txt2man currently embeds
the current time into generated manpages.
For the Reproducible Builds effort we are proposing an environment variable [1],
that will contain a deterministic epoch timestamp (based on the latest 
debian/changelog
entry) that could be used.
We hope that it will soon be automatically exported by debhelper.
With the attached patch packages using txt2man would then automatically generate
reproducible manpages (instead of having to adapt each package to explicitely 
pass a
timestamp).

Btw. help2man also recently added support for this [2]. :-)

Regards,
 Reiner

[1]: https://wiki.debian.org/ReproducibleBuilds/TimestampsProposal
[2]: https://bugs.debian.org/787444

diff --git a/debian/patches/reproducible-date b/debian/patches/reproducible-date
new file mode 100644
index 0000000..f404281
--- /dev/null
+++ b/debian/patches/reproducible-date
@@ -0,0 +1,23 @@
+Author: Reiner Herrmann <rei...@reiner-h.de>
+Description: Honour SOURCE_DATE_EPOCH if available
+ Using the current date for timestamps will produce unreproducible
+ manpages. If the environment variable SOURCE_DATE_EPOCH is set,
+ as proposed by the Reproducible Builds effort [1], a deterministic
+ timestamp is avilable that can be used to embed dates.
+
+ [1]: https://wiki.debian.org/ReproducibleBuilds/TimestampsProposal
+
+Index: txt2man-1.5.6/txt2man
+===================================================================
+--- txt2man-1.5.6.orig/txt2man
++++ txt2man-1.5.6/txt2man
+@@ -145,7 +145,8 @@ do
+ 	esac
+ done
+ shift $(($OPTIND - 1))
+-date=${date:-$(date +'%d %B %Y')}
++date_arg="-d @${SOURCE_DATE_EPOCH:-$(date +%s)}"
++date=${date:-$(LC_ALL=C date -u +'%d %B %Y' $date_arg)}
+ 
+ if test "$doprobe"
+ then
diff --git a/debian/patches/series b/debian/patches/series
index f8bb28f..a0943fc 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@ fix-path-hyphen
 fix-bashisms
 fix-pager-option
 fix-spelling-hyphen
+reproducible-date

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Reproducible-builds mailing list
Reproducible-builds@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds

Reply via email to