diff options
author | Niels Thykier <niels@thykier.net> | 2018-01-04 19:09:59 +0000 |
---|---|---|
committer | Niels Thykier <niels@thykier.net> | 2018-01-04 19:10:01 +0000 |
commit | 76a900d24ba46df3e8868f778a6a0d7ab84c52ed (patch) | |
tree | 2197abf55e3dfe7f07728445e018d2be7ce34a16 /dh | |
parent | 74d7ea5a657c1937fbcf688597a251830c49add5 (diff) | |
download | debhelper-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-x | dh | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -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!?"); |