[debhelper-devel] [debhelper] 02/02: Make the build-stamp optional via a build-stamp sequence

Niels Thykier nthykier at moszumanska.debian.org
Sat Oct 22 19:29:25 UTC 2016


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

nthykier pushed a commit to branch master
in repository debhelper.

commit 8a07afe7b2343442d73f1fb3b64626c2241b9e48
Author: Niels Thykier <niels at thykier.net>
Date:   Sat Oct 22 19:28:32 2016 +0000

    Make the build-stamp optional via a build-stamp sequence
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 Debian/Debhelper/Sequence/build_stamp.pm | 17 +++++++++++++++++
 debhelper.pod                            | 12 ++++++++++++
 debian/rules                             |  2 +-
 dh                                       | 12 +++++++++---
 4 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/Debian/Debhelper/Sequence/build_stamp.pm b/Debian/Debhelper/Sequence/build_stamp.pm
new file mode 100644
index 0000000..59437c8
--- /dev/null
+++ b/Debian/Debhelper/Sequence/build_stamp.pm
@@ -0,0 +1,17 @@
+#!/usr/bin/perl
+
+use warnings;
+use strict;
+use Debian::Debhelper::Dh_Lib;
+
+add_command_at_end('create-stamp debian/debhelper-build-stamp', 'build');
+add_command_at_end('create-stamp debian/debhelper-build-stamp', 'build-arch');
+add_command_at_end('create-stamp debian/debhelper-build-stamp', 'build-indep');
+
+1
+
+# Local Variables:
+# indent-tabs-mode: t
+# tab-width: 4
+# cperl-indent-level: 4
+# End:
diff --git a/debhelper.pod b/debhelper.pod
index f3edcf5..00ef680 100644
--- a/debhelper.pod
+++ b/debhelper.pod
@@ -613,6 +613,18 @@ it).
 
 The vast majority of all packages will be unaffected by this change.
 
+=item -
+
+B<dh> no longer creates a stamp (or log) file to record whether the
+build already ran or not.  This means that unless upstream's build
+system correctly tracks this, the build will be run twice (once for
+the "build" target and once for the "binary" target).
+
+On the other hand, this means that rebuild without cleaning
+(e.g. B<dpkg-buildpackage -nc>) will behave as much people expect.
+
+The previous behaviour can restored by using B<--with build-stamp>
+
 =back
 
 =back
diff --git a/debian/rules b/debian/rules
index c323707..9ca8b94 100755
--- a/debian/rules
+++ b/debian/rules
@@ -11,7 +11,7 @@
 # nothing for debhelper and it keeps the set of B-D smaller)
 
 %:
-	./run dh $@ --no-parallel --without autoreconf
+	./run dh $@ --no-parallel --without autoreconf --with build-stamp
 
 # Disable as they are unneeded (and we can then be sure debhelper
 # builds without needing autotools-dev, dh-strip-nondetermism etc.)
diff --git a/dh b/dh
index 999779c..87eae9d 100755
--- a/dh
+++ b/dh
@@ -295,6 +295,10 @@ if (not compat(9, 1)) {
 	# Enable systemd support by default in compat 10 or later.
 	unshift(@ARGV, "--with=systemd");
 }
+if (compat(10, 1)) {
+	unshift(@ARGV, "--with=build-stamp");
+}
+
 
 inhibit_log();
 		
@@ -375,9 +379,7 @@ my @bd = (qw{
 	dh_auto_configure
 	dh_auto_build
 	dh_auto_test
-},
-	"create-stamp ${build_stamp_file}",
-);
+});
 my @i = (qw{
 	dh_testroot
 	dh_prep
@@ -502,6 +504,10 @@ sub add_command {
 	my ($command, $sequence) = @_;
 	unshift @{$sequences{$sequence}}, $command;
 }
+sub add_command_at_end {
+	my ($command, $sequence) = @_;
+	push(@{$sequences{$sequence}}, $command);
+}
 sub add_command_options {
 	my $command=shift;
 	push @{$command_opts{$command}}, @_;

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




More information about the debhelper-devel mailing list