From f82142aaf22547815f4a83eb0e94a0cf497c7fe5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 14 Jun 2011 12:24:31 -0400 Subject: avoid infinite recursion The makefile parse causes dh to be run recursively. Before, dh would just immediatly fail with "unknown sequence", but now it has to run the makefile parse to calculate the sequences, so an earlier bailout is needed. --- dh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'dh') diff --git a/dh b/dh index 2241c648..59d5ee07 100755 --- a/dh +++ b/dh @@ -346,9 +346,12 @@ if (! defined $sequence) { } # make -B causes the rules file to be run as a target. # Also support completly empty override targets. -# Note: it's not safe to use rules_explicit_target before this check. +# Note: it's not safe to use rules_explicit_target before this check, +# since it causes dh to be run. +my $dummy_target="debhelper-fail-me"; if ($sequence eq 'debian/rules' || - $sequence =~ /^override_dh_/) { + $sequence =~ /^override_dh_/ || + $sequence eq $dummy_target) { exit 0; } @@ -814,7 +817,7 @@ sub rules_explicit_target { my $processing_targets = 0; my $not_a_target = 0; my $current_target; - open(MAKE, "LC_ALL=C make -Rrnpsf debian/rules debhelper-fail-me 2>/dev/null |"); + open(MAKE, "LC_ALL=C make -Rrnpsf debian/rules $dummy_target 2>/dev/null |"); while () { if ($processing_targets) { if (/^# Not a target:/) { -- cgit v1.2.3