diff options
author | Niels Thykier <niels@thykier.net> | 2019-08-17 10:48:05 +0000 |
---|---|---|
committer | Niels Thykier <niels@thykier.net> | 2019-08-17 10:48:07 +0000 |
commit | d3ce98cb3ffe379631c23845e85e375471b10ee8 (patch) | |
tree | 82e6683ccfaf4db281a0ec72f0b9fc076599d2fa /dh | |
parent | 8bf9f7e84927a6fa6a5765ad8ad90f86459e5a61 (diff) | |
download | debhelper-d3ce98cb3ffe379631c23845e85e375471b10ee8.tar.gz |
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<for each arch:any package>
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 <niels@thykier.net>
Diffstat (limited to 'dh')
-rwxr-xr-x | dh | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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"; |