[Reproducible-commits] [dpkg] 23/26: dpkg-buildpackage: Preset build timestamp to latest changelog entry

Jérémy Bobbio lunar at moszumanska.debian.org
Fri Jan 15 21:11:30 UTC 2016


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

lunar pushed a commit to branch pu/reproducible_builds
in repository dpkg.

commit aba0bb881de2979a4469d66ad78f86a6e567628e
Author: Jérémy Bobbio <lunar at debian.org>
Date:   Tue Aug 27 23:53:22 2013 +0200

    dpkg-buildpackage: Preset build timestamp to latest changelog entry
    
    dpkg-buildpackage will set the SOURCE_DATE_EPOCH environment variable to the
    date of the latest entry in debian/changelog. This enables build to be easily
    reproduced as the dates captured in the `.deb` archives will be deterministic.
    
    SOURCE_DATE_EPOCH can also be externaly set before running dpkg-buildpackage.
    to reproduce the build with an arbitrary date.
    
    Closes: #759886
    Closes: #759999
---
 scripts/dpkg-buildpackage.pl | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl
index 17ada97..e14cd26 100755
--- a/scripts/dpkg-buildpackage.pl
+++ b/scripts/dpkg-buildpackage.pl
@@ -439,6 +439,11 @@ if ($changedby) {
     $maintainer = mustsetvar($changelog->{maintainer}, g_('source changed by'));
 }
 
+if (!$ENV{SOURCE_DATE_EPOCH}) {
+    my $timestamp = `date -d'$changelog->{date}' +%s`;
+    chomp $timestamp;
+    $ENV{SOURCE_DATE_EPOCH} = $timestamp;
+}
 
 my @arch_opts;
 push @arch_opts, ('--host-arch', $host_arch) if $host_arch;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list