]> git.donarmstrong.com Git - debhelper.git/commitdiff
make dh override_dh_* a no-op
authorJoey Hess <joey@gnu.kitenet.net>
Tue, 17 Feb 2009 17:33:57 +0000 (12:33 -0500)
committerJoey Hess <joey@gnu.kitenet.net>
Fri, 27 Feb 2009 20:13:19 +0000 (15:13 -0500)
This happens if the override target is completly empty.
Make sees it is, and runs the implicit dh target.
(cherry picked from commit 86fbd6038ee5b7222efa774751fcceedeffedfc2)

debian/rules
dh

index ae14186711106479d1a20f78668a70749245e101..23b782b156bf237a3f0d1296b1865cd583364b73 100755 (executable)
@@ -5,11 +5,10 @@
 # Each debhelper command in this rules file has to be run using ./run,
 # to ensure that the commands and libraries in the source tree are used,
 # rather than the installed ones.
+
 %:
        ./run dh $@
 
 # 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 571d4b63fe4a993f53570c01ca6b82e2b3f9bf1e..1ec46ba937788c3efbeaf5ddf3dc23d8a0ad74d3 100755 (executable)
--- a/dh
+++ b/dh
@@ -182,6 +182,15 @@ after a particular debhelper command is run.
                dh_fixperms
                chmod 4755 debian/foo/usr/bin/foo
 
+If the package's source tree might get files with names
+like build or clean in it, the rules file would not
+run targets with the same names. This issue can be worked
+around by passing -B to make.
+
+       #!/usr/bin/make -Bf
+       %:
+               dh $@
+
 =cut
 
 # Stash this away before init modifies it.
@@ -311,8 +320,10 @@ if (! @ARGV) {
        error "specify a sequence to run";
 }
 my $sequence=shift;
-if ($sequence eq 'debian/rules') {
+if ($sequence eq 'debian/rules' ||
+    $sequence =~ /^override_dh_/) {
        # make -B causes the rules file to be run as a target
+       # and support completly empty override targets
        exit 0
 }      
 elsif (! exists $sequences{$sequence}) {