[debhelper-devel] [debhelper] 01/03: dh: Move some "compat 9"-only code inside an if-guard
Niels Thykier
nthykier at moszumanska.debian.org
Thu Jan 4 19:29:52 UTC 2018
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to branch master
in repository debhelper.
commit 76a900d24ba46df3e8868f778a6a0d7ab84c52ed
Author: Niels Thykier <niels at thykier.net>
Date: Thu Jan 4 19:09:59 2018 +0000
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 at thykier.net>
---
dh | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/dh b/dh
index 4e69bb2..d6ba0c4 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!?");
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debhelper/debhelper.git
More information about the debhelper-devel
mailing list