]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
fix: let util/mkbuildinf.pl use SOURCE_DATE_EPOCH, even if it's zero
authorRichard Levitte <levitte@openssl.org>
Tue, 15 Oct 2024 12:25:34 +0000 (14:25 +0200)
committerRichard Levitte <levitte@openssl.org>
Thu, 17 Oct 2024 10:42:45 +0000 (12:42 +0200)
Doing this allows reproducible builds, for those who want this.

Fixes #25475

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/25699)

util/mkbuildinf.pl

index 1c273872be11c01e881a59a61bb3f0f125679441..7b1aba054ccc937e59c1c85cfb8793119181f8a0 100755 (executable)
@@ -12,7 +12,9 @@ use warnings;
 my ($cflags, $platform) = @ARGV;
 $cflags = "compiler: $cflags";
 
-my $date = gmtime($ENV{'SOURCE_DATE_EPOCH'} || time()) . " UTC";
+# Use the value of the envvar SOURCE_DATE_EPOCH, even if it's
+# zero or the empty string.
+my $date = gmtime($ENV{'SOURCE_DATE_EPOCH'} // time()) . " UTC";
 
 print <<"END_OUTPUT";
 /*