From d3ce98cb3ffe379631c23845e85e375471b10ee8 Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Sat, 17 Aug 2019 10:48:05 +0000 Subject: dh: Skip some invalid calls to helpers after an override With the new "conditional" addon feature, it was possible to trigger a gratious useless warning with a conditional override. Consider: override_dh_foo-arch: ... And dh_foo was added by an arch-only addon. Before this commit, we would do: debian/rules override_dh_foo-arch dh_foo -a -N The latter call to dh_foo rightfully complained there was nothing to do. With this commit, we correctly omit the latter call. Signed-off-by: Niels Thykier --- dh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'dh') diff --git a/dh b/dh index 829759b8..b55cbbd2 100755 --- a/dh +++ b/dh @@ -965,7 +965,19 @@ foreach my $i (0..$stoppoint) { # Figure out which packages need to run this command. my @todo; my @opts=@options; - foreach my $package (@packages) { + my @filtered_packages; + if (grep { $_ eq '-i'} @{$command_opts{$command}}) { + if (grep { $_ eq '-a'} @{$command_opts{$command}}) { + @filtered_packages = @packages; + } else { + @filtered_packages = @indep_packages; + } + } elsif (grep { $_ eq '-a'} @{$command_opts{$command}}) { + @filtered_packages = @arch_packages; + } else { + @filtered_packages = @packages; + } + foreach my $package (@filtered_packages) { if ($startpoint{$package} > $i || $logged{$package}{$full_sequence->[$i]}) { push @opts, "-N$package"; -- cgit v1.2.3