unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 15c025a72646d2a63ce943125ef99e938e7127fd 1078 bytes (raw)
name: packages/patches/docbook-utils-source-date-epoch.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
# Source: <https://sources.debian.org/patches/docbook-utils/0.6.14-4/support_source_date_epoch.patch/>

Author: Reiner Herrmann <reiner@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/
Bug-Debian: https://bugs.debian.org/800797

--- a/helpers/docbook2man-spec.pl
+++ b/helpers/docbook2man-spec.pl
@@ -57,6 +57,7 @@
 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
@@ -279,6 +280,10 @@
 _END_BANNER
 
 	my $date = `date "+%d %B %Y"`;
+	if ($ENV{SOURCE_DATE_EPOCH}) {
+		setlocale(LC_TIME, "C");
+		$date = strftime("%d %B %Y", gmtime($ENV{SOURCE_DATE_EPOCH} || time));
+	}
 	my $manpage_date = $manpage_date || $date ;
 
 	output '.TH "';

debug log:

solving 15c025a72646d2a63ce943125ef99e938e7127fd ...
found 15c025a72646d2a63ce943125ef99e938e7127fd in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).