[Reproducible-commits] [debhelper] 05/06: dh_builddeb: Use get_source_date_epoch rather than $dh{DATE}

Mattia Rizzolo mattia at mapreri.org
Wed Aug 12 17:47:26 UTC 2015


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

mapreri-guest pushed a commit to branch pu/reproducible_builds
in repository debhelper.

commit dd097dabe9e0e11d9d8b94b2cee4d9cd300d2a04
Author: Niels Thykier <niels at thykier.net>
Date:   Wed Aug 12 16:17:44 2015 +0200

    dh_builddeb: Use get_source_date_epoch rather than $dh{DATE}
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 Debian/Debhelper/Dh_Lib.pm |  4 +---
 dh_builddeb                | 13 ++++++-------
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index 9565057..83ad659 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -532,8 +532,7 @@ sub pkgfilename {
 }
 
 # Returns 1 if the package is a native debian package, null otherwise.
-# As a side effect, sets $dh{VERSION} to the version of this package,
-# and $dh{DATE} to the date of the latest changelog entry.
+# As a side effect, sets $dh{VERSION} to the version of this package.
 {
 	# Caches return code so it only needs to run dpkg-parsechangelog once.
 	my %isnative_cache;
@@ -555,7 +554,6 @@ sub pkgfilename {
 		if (! defined $dh{VERSION}) {
 			error("changelog parse failure");
 		}
-		($dh{DATE})=$version=~m/Date:\s*(.*)/m;
 
 		# Is this a native Debian package?
 		if ($dh{VERSION}=~m/.*-/) {
diff --git a/dh_builddeb b/dh_builddeb
index 27478fb..ebbabf9 100755
--- a/dh_builddeb
+++ b/dh_builddeb
@@ -104,10 +104,9 @@ sub default_compressor_args {
 	return (@{$default_comp}, @args);
 }
 
-foreach my $package (@{$dh{DOPACKAGES}}) {
-	# XXX: not nice, we only run this for the side effect of getting $dh{DATE} set
-	isnative($package);
+my $source_date = get_source_date_epoch();
 
+foreach my $package (@{$dh{DOPACKAGES}}) {
 	my $pid=fork();
 	if (! defined $pid) {
 		error("fork failed! $!");
@@ -148,8 +147,8 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 			# the ddeb.
 			my @args = default_compressor_args(["-z1", "-Zxz", "-Sextreme"],
 											   @{$dh{U_PARAMS}});
-			complex_doit("find $ddeb_tmpdir -newermt '$dh{DATE}' $find_options -print0",
-					"2>/dev/null | xargs -0r touch --no-dereference --date='$dh{DATE}'");
+			complex_doit("find $ddeb_tmpdir -newermt '\@${source_date}' $find_options -print0",
+					"2>/dev/null | xargs -0r touch --no-dereference --date='\@${source_date}'");
 
 			doit("dpkg-deb", @args,
 				 "--build", $ddeb_tmpdir, $dh{DESTDIR});
@@ -159,8 +158,8 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 		}
 	}
 
-	complex_doit("find $tmp -newermt '$dh{DATE}' $find_options -print0",
-		"2>/dev/null | xargs -0r touch --no-dereference --date='$dh{DATE}'");
+	complex_doit("find $tmp -newermt '\@${source_date}' $find_options -print0",
+		"2>/dev/null | xargs -0r touch --no-dereference --date='\@${source_date}'");
 
 	if (! is_udeb($package)) {
 		doit("dpkg-deb", @{$dh{U_PARAMS}}, "--build", $tmp, $dh{DESTDIR}.$dh{FILENAME});

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



More information about the Reproducible-commits mailing list