From: Jan Alexander Steffens (heftig) Date: Sun, 8 Oct 2023 10:31:57 +0000 (+0200) Subject: docs: use SOURCE_DATE_EPOCH for generated manpages X-Git-Tag: curl-8_5_0~262 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1f7d8cd478f024bc16cad204a9b62feb6e92a0c5;p=thirdparty%2Fcurl.git docs: use SOURCE_DATE_EPOCH for generated manpages This should make builds from Git reproducible. Closes #12092 --- diff --git a/docs/cmdline-opts/gen.pl b/docs/cmdline-opts/gen.pl index 8b9b98bb2d..edf90622b2 100755 --- a/docs/cmdline-opts/gen.pl +++ b/docs/cmdline-opts/gen.pl @@ -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; diff --git a/docs/libcurl/mksymbolsmanpage.pl b/docs/libcurl/mksymbolsmanpage.pl index a8cb10d82a..3bc6869491 100755 --- a/docs/libcurl/mksymbolsmanpage.pl +++ b/docs/libcurl/mksymbolsmanpage.pl @@ -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 <