]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
docs: use SOURCE_DATE_EPOCH for generated manpages
authorJan Alexander Steffens (heftig) <heftig@archlinux.org>
Sun, 8 Oct 2023 10:31:57 +0000 (12:31 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 12 Oct 2023 07:45:41 +0000 (09:45 +0200)
This should make builds from Git reproducible.

Closes #12092

docs/cmdline-opts/gen.pl
docs/libcurl/mksymbolsmanpage.pl

index 8b9b98bb2d861575f4bf87e7c72ed12f78959e4f..edf90622b2ea1a8e7460dff58a9cf8f0ce0c9657 100755 (executable)
@@ -48,8 +48,14 @@ my %protolong;
 my %catlong;
 
 use POSIX qw(strftime);
-my $date = strftime "%B %d %Y", localtime;
-my $year = strftime "%Y", localtime;
+my @ts;
+if (defined($ENV{SOURCE_DATE_EPOCH})) {
+    @ts = localtime($ENV{SOURCE_DATE_EPOCH});
+} else {
+    @ts = localtime;
+}
+my $date = strftime "%B %d %Y", @ts;
+my $year = strftime "%Y", @ts;
 my $version = "unknown";
 my $globals;
 
index a8cb10d82ac0f685ffddffc8021997572c372fcc..3bc6869491856695e75ef65c615a148a183f6342 100755 (executable)
 my $version="7.41.0";
 
 use POSIX qw(strftime);
-my $date = strftime "%b %e, %Y", localtime;
-my $year = strftime "%Y", localtime;
+my @ts;
+if (defined($ENV{SOURCE_DATE_EPOCH})) {
+    @ts = localtime($ENV{SOURCE_DATE_EPOCH});
+} else {
+    @ts = localtime;
+}
+my $date = strftime "%b %e, %Y", @ts;
+my $year = strftime "%Y", @ts;
 
 print <<HEADER
 .\\" **************************************************************************