]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
apps/progs.pl: use SOURCE_DATE_EPOCH if defined for copyright year
authorRoss Burton <ross.burton@arm.com>
Thu, 27 Jan 2022 12:03:11 +0000 (12:03 +0000)
committerPauli <pauli@openssl.org>
Wed, 2 Feb 2022 03:02:09 +0000 (14:02 +1100)
As with 11d7d903, use SOURCE_DATE_EPOCH for the copyright year if it is
defined, to avoid reproducibility problems.

CLA: trivial

Signed-off-by: Ross Burton <ross.burton@arm.com>
Change-Id: I1bea19070411a69155c43de7082350fb2c499da3

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17601)

apps/progs.pl

index 8a5759a961cbed23c17c63d5fe22b4e26cfcebcf..77054902b4c4546311ff5086d6e877fdca8a25cd 100644 (file)
@@ -21,7 +21,7 @@ die "Unrecognised option, must be -C or -H\n"
 my %commands     = ();
 my $cmdre        = qr/^\s*int\s+([a-z_][a-z0-9_]*)_main\(\s*int\s+argc\s*,/;
 my $apps_openssl = shift @ARGV;
-my $YEAR         = [localtime()]->[5] + 1900;
+my $YEAR         = [gmtime($ENV{SOURCE_DATE_EPOCH} || time())]->[5] + 1900;
 
 # because the program apps/openssl has object files as sources, and
 # they then have the corresponding C files as source, we need to chain