summaryrefslogtreecommitdiff
path: root/dh
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2019-08-13 08:03:43 +0000
committerNiels Thykier <niels@thykier.net>2019-08-16 18:45:57 +0000
commitb6682c0064ff58d8819c8a9e817948f268a6b761 (patch)
tree766264a26ae98dd2348662712ed343ee31bd6e39 /dh
parent6bf914b4eb15578a4f48dafae3ac16d95eddc55a (diff)
downloaddebhelper-b6682c0064ff58d8819c8a9e817948f268a6b761.tar.gz
dh: Drop code only used for obsolete parameters
Signed-off-by: Niels Thykier <niels@thykier.net>
Diffstat (limited to 'dh')
-rwxr-xr-xdh67
1 files changed, 10 insertions, 57 deletions
diff --git a/dh b/dh
index 547ad899..9d3cdd29 100755
--- a/dh
+++ b/dh
@@ -723,44 +723,20 @@ my $stoppoint = $#{$full_sequence};
if (compat(9)) {
foreach my $package (@packages) {
my @log = load_log($package, \%logged);
- if ($dh{AFTER}) {
- # Run commands in the sequence that come after the
- # specified command.
- $startpoint{$package} = command_pos($dh{AFTER}, @{$full_sequence}) + 1;
- # Write a dummy log entry indicating that the specified
- # command was, in fact, run. This handles the case where
- # no commands remain to run after it, communicating to
- # future dh instances that the specified command should not
- # be run again.
- write_log($full_sequence->[$startpoint{$package} - 1], $package);
- }
- elsif ($dh{REMAINING}) {
- # Start at the beginning so all remaining commands will get
- # run.
- $startpoint{$package} = 0;
- }
- else {
- # Find the last logged command that is in the sequence, and
- # continue with the next command after it. If no logged
- # command is in the sequence, we're starting at the beginning..
- $startpoint{$package} = 0;
- COMMAND:
- foreach my $command (reverse @log) {
- foreach my $i (0 .. $#{$full_sequence}) {
- if ($command eq $full_sequence->[$i]) {
- $startpoint{$package} = $i + 1;
- last COMMAND;
- }
+ # Find the last logged command that is in the sequence, and
+ # continue with the next command after it. If no logged
+ # command is in the sequence, we're starting at the beginning..
+ $startpoint{$package} = 0;
+ COMMAND:
+ foreach my $command (reverse @log) {
+ foreach my $i (0 .. $#{$full_sequence}) {
+ if ($command eq $full_sequence->[$i]) {
+ $startpoint{$package} = $i + 1;
+ last COMMAND;
}
}
}
}
- # 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;
@@ -974,29 +950,6 @@ sub reject_obsolete_params {
}
}
-sub command_pos {
- my ($command, @sequence) = @_;
-
- foreach my $i (0..$#sequence) {
- if ($command eq $sequence[$i]) {
- return $i;
- }
- }
-
- my @matches;
- foreach my $i (0..$#sequence) {
- if ($sequence[$i] =~ /\Q$command\E/) {
- push @matches, $i;
- }
- }
- if (! @matches) {
- error "command specification \"$command\" does not match any command in the sequence"
- }
- else {
- return pop @matches;
- }
-}
-
my %skipinfo;
sub can_skip {
my ($command, @packages) = @_;