On Sat, Oct 03, 2015 at 07:31:04PM +0200, Reiner Herrmann wrote: > Source: docbook-utils > Version: 0.6.14-3 > Severity: wishlist > Tags: patch > User: reproducible-bui...@lists.alioth.debian.org > Usertags: toolchain timestamps locale > X-Debbugs-Cc: reproducible-bui...@lists.alioth.debian.org > > Hi! > > While working on the "reproducible builds" effort [1], we have noticed > that docbook-utils doesn't generate reproducible manpages. > The embedded timestamp is using the build date and also varies depending > on the configured locale. > > The attached patch adds support for the SOURCE_DATE_EPOCH environment > variable [2] and uses the C locale for the human-readable month > (which also fixes #214982). > > Regards, > Reiner > > [1]: https://wiki.debian.org/ReproducibleBuilds > [2]: https://reproducible-builds.org/specs/source-date-epoch/ >
> diff --git a/debian/patches/series b/debian/patches/series > index 6e5630a..795b9d1 100644 > --- a/debian/patches/series > +++ b/debian/patches/series > @@ -4,3 +4,4 @@ bug_212088.patch > bug_214982.patch > bug_394511.patch > bug_528334.patch > +support_source_date_epoch.patch > diff --git a/debian/patches/support_source_date_epoch.patch > b/debian/patches/support_source_date_epoch.patch > new file mode 100644 > index 0000000..ce5559c > --- /dev/null > +++ b/debian/patches/support_source_date_epoch.patch > @@ -0,0 +1,29 @@ > +Author: Reiner Herrmann <rei...@reiner-h.de> > +Description: Support SOURCE_DATE_EPOCH for timestamps > + To allow generating documents in a reproducible way, > + allow overriding the timestamp through the environment. > + . > + See also: https://reproducible-builds.org/specs/source-date-epoch/ > + > +Index: docbook-utils-0.6.14/helpers/docbook2man-spec.pl > +=================================================================== > +--- docbook-utils-0.6.14.orig/helpers/docbook2man-spec.pl > ++++ docbook-utils-0.6.14/helpers/docbook2man-spec.pl > +@@ -57,6 +57,7 @@ Software Foundation, 675 Mass Ave, Cambr > + use SGMLS; # Use the SGMLS package. > + use SGMLS::Output; # Use stack-based output. > + use SGMLS::Refs; > ++use POSIX qw(strftime setlocale LC_TIME); > + > + ######################################################################## > + # SGMLSPL script produced automatically by the script sgmlspl.pl > +@@ -278,7 +279,8 @@ sgml('</REFMETA>', sub { > + .\\" etc. to Steve Cheng <steve\@ggi-project.org>. > + _END_BANNER > + > +- my $date = `date "+%d %B %Y"`; > ++ setlocale(LC_TIME, "C"); Would it make sense to force the C locale only if SOURCE_DATE_EPOCH is set to not modify existing behaviour? Otherwise I'm all for an NMU. Cheers, -- Guido