]> git.donarmstrong.com Git - debhelper.git/commitdiff
dh: Support debian/rules calling make with -B
authorJoey Hess <joey@gnu.kitenet.net>
Fri, 27 Feb 2009 20:12:58 +0000 (15:12 -0500)
committerJoey Hess <joey@gnu.kitenet.net>
Fri, 27 Feb 2009 20:12:58 +0000 (15:12 -0500)
That is useful to avoid issues with phony implicit rules
(see bug #509756).

Apparently make treats the name of the Makfile as an automaticall
set up target, so this causes it to try to build the Makefile
even though it's up-to-date, and the implicit target
makes it run 'dh debian/rules'.

So, make that a no-op.
(cherry picked from commit 378b377ef732119de4c2a08dcb9721500b017da1)

Conflicts:

debian/changelog
dh

debian/changelog
debian/rules
dh

index 19e372a4bd183b0e8dfac57068984d67cafa935a..9c0abb3f52d99312fe5d953da5f76645570e32d7 100644 (file)
@@ -8,6 +8,9 @@ debhelper (7.2.0) UNRELEASED; urgency=low
     than the old method.
   * Remove rules.simple example, there's no need to use explcit targets
     with dh anymore.
+  * dh: Support debian/rules calling make with -B,
+    which is useful to avoid issues with phony implicit
+    rules (see bug #509756).
 
  -- Joey Hess <joeyh@debian.org>  Thu, 25 Dec 2008 16:26:36 -0500
 
index 03db2d00eca9a48246043b1a742f81ae5b383df3..ae14186711106479d1a20f78668a70749245e101 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/make -f
+#!/usr/bin/make -Bf
 # If you're looking for an example debian/rules that uses debhelper, see
 # the examples directory.
 # 
@@ -11,3 +11,5 @@
 # Not intended for use by anyone except the author.
 announcedir:
        @echo ${HOME}/src/joeywiki/code/debhelper/news
+
+.PHONY: build
diff --git a/dh b/dh
index 88dc9c4adbc5b5c69d18608e8acbb0374e928588..571d4b63fe4a993f53570c01ca6b82e2b3f9bf1e 100755 (executable)
--- a/dh
+++ b/dh
@@ -311,8 +311,12 @@ if (! @ARGV) {
        error "specify a sequence to run";
 }
 my $sequence=shift;
-if (! exists $sequences{$sequence}) {
-       error "Unknown sequence $sequence (chose from: ".
+if ($sequence eq 'debian/rules') {
+       # make -B causes the rules file to be run as a target
+       exit 0
+}      
+elsif (! exists $sequences{$sequence}) {
+       error "Unknown sequence $sequence (choose from: ".
                join(" ", sort keys %sequences).")";
 }
 my @sequence=@{$sequences{$sequence}};