From 76a900d24ba46df3e8868f778a6a0d7ab84c52ed Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Thu, 4 Jan 2018 19:09:59 +0000 Subject: 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 --- dh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'dh') 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!?"); -- cgit v1.2.3