]> git.donarmstrong.com Git - debhelper.git/commitdiff
misc minor cleanups of patch
authorJoey Hess <joey@gnu.kitenet.net>
Tue, 17 Feb 2009 05:53:22 +0000 (00:53 -0500)
committerJoey Hess <joey@gnu.kitenet.net>
Fri, 27 Feb 2009 20:11:58 +0000 (15:11 -0500)
(cherry picked from commit ae4994f07656deb47ffc55b8ebd4668c158b9333)

debian/changelog
dh

index 9950c219c7b4d0909ee9aff8d06b818948ae0b1f..19e372a4bd183b0e8dfac57068984d67cafa935a 100644 (file)
@@ -2,6 +2,7 @@ debhelper (7.2.0) UNRELEASED; urgency=low
 
   * dh: debian/rules override targets can change what is run
     for a specific debhelper command in a sequence.
+    (Thanks Modestas Vainius for the improved makefile parser.)
   * dh: Redid all the examples to use override targets, since these
     eliminate all annoying boilerplate and are much easier to understand
     than the old method.
diff --git a/dh b/dh
index e3a5943e959c36802e279789b7bcc52c8e986c24..88dc9c4adbc5b5c69d18608e8acbb0374e928588 100755 (executable)
--- a/dh
+++ b/dh
@@ -495,24 +495,27 @@ sub rules_explicit_target {
        # Checks if a specified target exists as an explicit target
        # in debian/rules. 
        my $target=shift;
-       my $processing_targets = 0;
-       my $not_a_target = 0;
        
        if (! $rules_parsed) {  
+               my $processing_targets = 0;
+               my $not_a_target = 0;
                open(MAKE, "make -Rrnpsf debian/rules debhelper-fail-me 2>/dev/null |");
                while (<MAKE>) {
                        if ($processing_targets) {
                                if (/^# Not a target:/) {
                                        $not_a_target = 1;
-                               } else {
-                                       if (!$not_a_target && /^([^#:]+)::?/ && !exists $targets{$1}) {
+                               }
+                               else {
+                                       if (!$not_a_target && /^([^#:]+)::?/) {
                                                # Target is defined.
-                                               # NOTE: if it is a depenency of .PHONY it will be
+                                               # NOTE: if it is a depenency
+                                               # of .PHONY it will be
                                                # defined too but that's ok.
                                                $targets{$1} = 1;
                                        }
-                                       # "Not a target:" is always followed by a target name,
-                                       # so resetting this one here is safe.
+                                       # "Not a target:" is always followed by
+                                       # a target name, so resetting this one
+                                       # here is safe.
                                        $not_a_target = 0;
                                }
                        } elsif (/^# Files$/) {