docs: use SOURCE_DATE_EPOCH for generated manpages

This should make builds from Git reproducible.

Closes #12092
This commit is contained in:
Jan Alexander Steffens (heftig) 2023-10-08 12:31:57 +02:00 committed by Daniel Stenberg
parent a20d7bd974
commit 1f7d8cd478
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 16 additions and 4 deletions

View File

@ -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;

View File

@ -26,8 +26,14 @@
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
.\\" **************************************************************************