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

Mattia Rizzolo mattia at mapreri.org
Thu Nov 26 22:49:41 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 1c3e268cafad8e1ed902922ded56bee42d09a51c
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 e23856b..53c570f 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -543,8 +543,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;
@@ -566,7 +565,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 33592a9..1b3ccb7 100755
--- a/dh_builddeb
+++ b/dh_builddeb
@@ -131,10 +131,9 @@ sub build_and_rename_deb {
 		 "${destdir}/${desired_filename}");
 }
 
-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! $!");
@@ -175,8 +174,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});
@@ -186,8 +185,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