summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2011-06-14 12:24:31 -0400
committerJoey Hess <joey@kitenet.net>2011-06-14 12:25:59 -0400
commitf82142aaf22547815f4a83eb0e94a0cf497c7fe5 (patch)
tree7dfbf5414d0b1f86b1f91a6a68cee1526e62051d
parent959defaccc3f49cff7c0b020b66c64a28e1ea21b (diff)
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.
-rwxr-xr-xdh9
1 files changed, 6 insertions, 3 deletions
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 (<MAKE>) {
if ($processing_targets) {
if (/^# Not a target:/) {