summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2019-08-16 19:07:06 +0000
committerNiels Thykier <niels@thykier.net>2019-08-16 19:07:06 +0000
commita610abc6fca411e3e03f9e580c2152470d706bda (patch)
tree23f44fac31a2d0e8e8664fd7ad63fcc317a8726e
parentd7c19012163800168b98fd9d35918288b0c9b652 (diff)
downloaddebhelper-a610abc6fca411e3e03f9e580c2152470d706bda.tar.gz
Generalize and move logic for filtering out arch-only helpers
Signed-off-by: Niels Thykier <niels@thykier.net>
-rwxr-xr-xdh3
-rw-r--r--lib/Debian/Debhelper/Sequence.pm5
2 files changed, 5 insertions, 3 deletions
diff --git a/dh b/dh
index a44bd12d..bffa6606 100755
--- a/dh
+++ b/dh
@@ -418,9 +418,6 @@ qw{
dh_makeshlibs
dh_shlibdeps
}));
-if (! getpackages("arch")) {
- @ba=();
-}
my @b=qw{
dh_installdeb
dh_gencontrol
diff --git a/lib/Debian/Debhelper/Sequence.pm b/lib/Debian/Debhelper/Sequence.pm
index fc857055..4fd599b8 100644
--- a/lib/Debian/Debhelper/Sequence.pm
+++ b/lib/Debian/Debhelper/Sequence.pm
@@ -8,6 +8,7 @@ use warnings;
use Exporter qw(import);
+use Debian::Debhelper::Dh_Lib qw(getpackages);
use Debian::Debhelper::SequencerUtil qw(extract_rules_target_name sequence_type SEQUENCE_NO_SUBSEQUENCES
SEQUENCE_ARCH_INDEP_SUBSEQUENCES SEQUENCE_TYPE_ARCH_ONLY SEQUENCE_TYPE_INDEP_ONLY SEQUENCE_TYPE_BOTH);
@@ -112,8 +113,12 @@ sub flatten_sequence {
my ($this, $sequence_type) = @_;
die("Invalid sequence type $sequence_type") if $sequence_type eq SEQUENCE_NO_SUBSEQUENCES;
my @cmds;
+ my $has_arch_pkgs = getpackages("arch") ? 1 : 0;
+ my $has_indep_pkgs = getpackages("indep") ? 1 : 0;
for my $cmd_desc (@{$this->{'_cmds'}}) {
my $seq_limitation = $cmd_desc->{'sequence-limitation'};
+ next if ($seq_limitation eq SEQUENCE_TYPE_ARCH_ONLY and not $has_arch_pkgs);
+ next if ($seq_limitation eq SEQUENCE_TYPE_INDEP_ONLY and not $has_indep_pkgs);
if ($seq_limitation eq $sequence_type or $sequence_type eq SEQUENCE_TYPE_BOTH or $seq_limitation eq SEQUENCE_TYPE_BOTH) {
my $cmd = $cmd_desc->{'command'};
my @cmd_options = $cmd_desc->{'command-options'};