summaryrefslogtreecommitdiff
path: root/dh
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2018-01-04 19:09:59 +0000
committerNiels Thykier <niels@thykier.net>2018-01-04 19:10:01 +0000
commit76a900d24ba46df3e8868f778a6a0d7ab84c52ed (patch)
tree2197abf55e3dfe7f07728445e018d2be7ce34a16 /dh
parent74d7ea5a657c1937fbcf688597a251830c49add5 (diff)
downloaddebhelper-76a900d24ba46df3e8868f778a6a0d7ab84c52ed.tar.gz
dh: Move some "compat 9"-only code inside an if-guard
This will make it easier to see that the code is dead once compat 9 is removed. Signed-off-by: Niels Thykier <niels@thykier.net>
Diffstat (limited to 'dh')
-rwxr-xr-xdh16
1 files changed, 7 insertions, 9 deletions
diff --git a/dh b/dh
index 4e69bb2e..d6ba0c4f 100755
--- a/dh
+++ b/dh
@@ -695,6 +695,7 @@ my ($rules_targets, $full_sequence) = optimize_sequence(\%sequences,
(!compat(9) ? 0 : 1),
\%completed_sequences
);
+my $stoppoint = $#{$full_sequence};
if (compat(9)) {
foreach my $package (@packages) {
@@ -731,21 +732,18 @@ if (compat(9)) {
}
}
}
+ # Figure out what point in the sequence to go to.
+ if ($dh{UNTIL}) {
+ $stoppoint = command_pos($dh{UNTIL}, @{$full_sequence});
+ } elsif ($dh{BEFORE}) {
+ $stoppoint = command_pos($dh{BEFORE}, @{$full_sequence}) - 1;
+ }
} else {
foreach my $package (@packages) {
$startpoint{$package} = 0;
}
}
-# Figure out what point in the sequence to go to.
-my $stoppoint=$#{$full_sequence};
-if ($dh{UNTIL}) {
- $stoppoint = command_pos($dh{UNTIL}, @{$full_sequence});
-}
-elsif ($dh{BEFORE}) {
- $stoppoint = command_pos($dh{BEFORE}, @{$full_sequence}) - 1;
-}
-
for my $rules_command (@{$rules_targets}) {
my $rules_target = extract_rules_target_name($rules_command)
// error("Internal error: $rules_command was not a rules target!?");