Make the build reproducible

Whilst working on the Reproducible Builds effort [0] we noticed
that libnbd could not be built reproducibly.

This is due to it shipping a pod generation wrapper that
does not use/respect SOURCE_DATE_EPOCH [1] and additionally
varies the output depending on the build user's current
timezone.

(This was originally filed in Debian as #939546 [2].)

 [0] https://reproducible-builds.org/
 [1] https://reproducible-builds.org/docs/source-date-epoch/
 [2] https://bugs.debian.org/939546

Signed-off-by: Chris Lamb <lamby@debian.org>
This commit is contained in:
Chris Lamb
2019-09-06 09:09:16 +01:00
committed by Richard W.M. Jones
parent a0f9553d21
commit d58c4e79d8

View File

@@ -287,7 +287,7 @@ if (!$date && -d $filename) {
$date = $1 if /^(\d+-\d+-\d+)\s/;
}
if (!$date) {
my ($day, $month, $year) = (localtime)[3,4,5];
my ($day, $month, $year) = (gmtime($ENV{SOURCE_DATE_EPOCH} || time))[3,4,5];
$date = sprintf ("%04d-%02d-%02d", $year+1900, $month+1, $day);
}