mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
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:
committed by
Richard W.M. Jones
parent
a0f9553d21
commit
d58c4e79d8
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user