]> git.donarmstrong.com Git - debhelper.git/commitdiff
make: Avoid infinite loop that occurrs when testing existence of a target in a certia...
authorJoey Hess <joey@gnu.kitenet.net>
Sat, 21 Nov 2009 18:33:33 +0000 (13:33 -0500)
committerJoey Hess <joey@gnu.kitenet.net>
Sat, 21 Nov 2009 18:33:33 +0000 (13:33 -0500)
by making the test stop after it sees one line of output from make. (This
may be better replaced with dh's makefile parser in the future.)

Debian/Debhelper/Buildsystem/makefile.pm
debian/changelog

index 083abc4293cd7c39b07972e5b9bc0dfc622619a4..47814296b342c30fd14c9671130a665907bbbd39 100644 (file)
@@ -25,7 +25,7 @@ sub exists_make_target {
 
        # Use make -n to check to see if the target would do
        # anything. There's no good way to test if a target exists.
-       my $ret=`$makecmd -s -n --no-print-directory $target 2>/dev/null`;
+       my $ret=`$makecmd -s -n --no-print-directory $target 2>/dev/null | head -n 1`;
        chomp $ret;
        return length($ret);
 }
index 47d08c7a460378b40890019f1c3ce1a30ebbe69a..7a3fefe0974aa55ab1d4556679b62dd5a80aeefd 100644 (file)
@@ -1,3 +1,12 @@
+debhelper (7.4.7) UNRELEASED; urgency=low
+
+  * make: Avoid infinite loop that occurrs when testing existence of a target
+    in a certian horribly broken makefile, by making the test stop after
+    it sees one line of output from make. (This may be better replaced with
+    dh's makefile parser in the future.) Closes: #557307
+
+ -- Joey Hess <joeyh@debian.org>  Sat, 21 Nov 2009 13:29:01 -0500
+
 debhelper (7.4.6) unstable; urgency=low
 
   * Update --list to reflect buildsystem autoselection changes.