>From 22cfcb69cbf4dc40cf46e1b6fe8d21cfc888cde2 Mon Sep 17 00:00:00 2001 From: Chris Lamb Date: Fri, 6 Sep 2019 09:09:16 +0100 Subject: [PATCH] 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 --- podwrapper.pl.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/podwrapper.pl.in b/podwrapper.pl.in index 978134a..dd0551e 100755 --- a/podwrapper.pl.in +++ b/podwrapper.pl.in @@ -227,7 +227,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); }