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

Jérémy Bobbio lunar at moszumanska.debian.org
Fri Mar 4 17:44:47 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 0ee8c3af4aeae9ac08b061d7d5e40f77299435ec
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 5a3b634..b84bedf 100755
--- a/scripts/dpkg-buildpackage.pl
+++ b/scripts/dpkg-buildpackage.pl
@@ -398,6 +398,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