summaryrefslogtreecommitdiff
path: root/dh
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2011-09-11 12:58:33 -0400
committerJoey Hess <joey@kitenet.net>2011-09-11 12:58:33 -0400
commite14e51cc8d91ac28fb215ef27233f3ee3204cf11 (patch)
treeddeec9d9f28d97581720d1acbdf05ce403872dc1 /dh
parent0152f75c3dd6de14dfca258ce7ca2f90cea055fa (diff)
simplify
Diffstat (limited to 'dh')
-rwxr-xr-xdh29
1 files changed, 10 insertions, 19 deletions
diff --git a/dh b/dh
index 3afec52..7cab4c0 100755
--- a/dh
+++ b/dh
@@ -629,18 +629,18 @@ foreach my $i (0..$stoppoint) {
my $command=$sequence[$i];
# Figure out which packages need to run this command.
- my @exclude;
+ my @todo;
+ my @opts=@options;
foreach my $package (@packages) {
if ($startpoint{$package} > $i ||
$logged{$package}{$sequence[$i]}) {
- push @exclude, $package;
+ push @opts, "-N$package";
+ }
+ else {
+ push @todo, $package;
}
}
-
- if (@exclude eq @packages) {
- # Command already done for all packages.
- next;
- }
+ next unless @todo;
my $rules_target = rules_target($command);
if (defined $rules_target) {
@@ -652,15 +652,9 @@ foreach my $i (0..$stoppoint) {
next;
}
- my @opts=@options;
- # If some packages are excluded, add flags
- # to prevent them from being acted on.
- push @opts, map { "-N$_" } @exclude;
-
# Check for override targets in debian/rules, and run instead of
# the usual command.
- next if run_override("override_".$command, $command,
- \@packages, \@exclude, @opts);
+ next if run_override("override_".$command, $command, \@todo, @opts);
run($command, @opts);
}
@@ -693,7 +687,6 @@ sub run_override {
my $override=shift;
my $command=shift;
my @packages=@{shift()};
- my @exclude=@{shift()};
my @options=@_;
my $has_explicit_target = rules_explicit_target($override);
@@ -713,10 +706,8 @@ sub run_override {
# (But avoid logging for dh_clean since it removes
# the log earlier.)
if (! $dh{NO_ACT} && $command ne 'dh_clean') {
- my %packages=map { $_ => 1 } @packages;
- map { delete $packages{$_} } @exclude;
- write_log($command, keys %packages);
- commit_override_log(keys %packages);
+ write_log($command, @packages);
+ commit_override_log(@packages);
}
return 1;