[libmarpa-r2-perl] 01/02: reproducible_build.patch: fix buggy behaviour when SOURCE_DATE_EPOCH is not set.

Intrigeri intrigeri at moszumanska.debian.org
Mon Jun 27 08:54:35 UTC 2016


This is an automated email from the git hooks/post-receive script.

intrigeri pushed a commit to branch master
in repository libmarpa-r2-perl.

commit 3552c70010e07a664030bb7255d77eee63ae1599
Author: intrigeri <intrigeri at boum.org>
Date:   Mon Jun 27 08:42:57 2016 +0000

    reproducible_build.patch: fix buggy behaviour when SOURCE_DATE_EPOCH is not set.
---
 debian/patches/reproducible_build.patch | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/debian/patches/reproducible_build.patch b/debian/patches/reproducible_build.patch
index 11f3c6c..dbb5aaf 100644
--- a/debian/patches/reproducible_build.patch
+++ b/debian/patches/reproducible_build.patch
@@ -1,5 +1,12 @@
 Author: Reiner Herrmann <reiner at reiner-h.de>
-Description: Honour SOURCE_DATE_EPOCH for embedded timestamp, if it is set
+Description: Honour SOURCE_DATE_EPOCH for embedded timestamp
+ When the environment variable SOURCE_DATE_EPOCH is set, use it instead of the
+ current time for the embedded build timestamp.
+ .
+ The specification of SOURCE_DATE_EPOCH is available here:
+ https://reproducible-builds.org/specs/source-date-epoch/
+ .
+ In the case it is not defined, fall back to current time in UTC.
 Forwarded: https://rt.cpan.org/Ticket/Display.html?id=115614
 Bug: https://rt.cpan.org/Ticket/Display.html?id=115614
 
@@ -10,7 +17,7 @@ Bug: https://rt.cpan.org/Ticket/Display.html?id=115614
  ##no critic(ValuesAndExpressions::RequireInterpolationOfMetachars)
      $text .= q{use vars qw($TIMESTAMP)} . qq{;\n};
 -    $text .= q{$TIMESTAMP='} . localtime()->datetime . qq{';\n};
-+    $text .= q{$TIMESTAMP='} . (gmtime($ENV{SOURCE_DATE_EPOCH}) || localtime())->datetime . qq{';\n};
++    $text .= q{$TIMESTAMP='} . (gmtime($ENV{SOURCE_DATE_EPOCH} || time()))->datetime . qq{';\n};
  ##use critic
  
      for my $package (@use_packages) {
@@ -19,7 +26,7 @@ Bug: https://rt.cpan.org/Ticket/Display.html?id=115614
  ##no critic(ValuesAndExpressions::RequireInterpolationOfMetachars)
      $text .= q{use vars qw($TIMESTAMP)} . qq{;\n};
 -    $text .= q{$TIMESTAMP='} . localtime()->datetime . qq{';\n};
-+    $text .= q{$TIMESTAMP='} . (gmtime($ENV{SOURCE_DATE_EPOCH}) || localtime())->datetime . qq{';\n};
++    $text .= q{$TIMESTAMP='} . (gmtime($ENV{SOURCE_DATE_EPOCH} || time()))->datetime . qq{';\n};
  ##use critic
  
      for my $package (@use_packages) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmarpa-r2-perl.git



More information about the Pkg-perl-cvs-commits mailing list