diff options
author | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2018-12-17 16:14:23 +0000 |
---|---|---|
committer | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2018-12-17 18:17:04 +0000 |
commit | 5ac101a075536b1f6ceea2a335423c18b2ca2269 (patch) | |
tree | d0d60539ef1574c3debd4adabf19dd33eacded2b /perl-install | |
parent | 1fbdf298cc182c97735f81af17c9bea86dd7442e (diff) | |
download | drakx-5ac101a075536b1f6ceea2a335423c18b2ca2269.tar drakx-5ac101a075536b1f6ceea2a335423c18b2ca2269.tar.gz drakx-5ac101a075536b1f6ceea2a335423c18b2ca2269.tar.bz2 drakx-5ac101a075536b1f6ceea2a335423c18b2ca2269.tar.xz drakx-5ac101a075536b1f6ceea2a335423c18b2ca2269.zip |
installer: support optional ISA requirement when selecting packages by name.
Needed for next commit.
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/install/pkgs.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/perl-install/install/pkgs.pm b/perl-install/install/pkgs.pm index ee3c83b54..91a57c2cf 100644 --- a/perl-install/install/pkgs.pm +++ b/perl-install/install/pkgs.pm @@ -125,13 +125,14 @@ sub packagesProviding { grep { $_->is_arch_compat } URPM::packages_providing($packages, $name); } -#- search package with given name and compatible with current architecture. +#- search package with given name (and optional ISA) and compatible with current architecture. #- take the best one found (most up-to-date). # FIXME: reuse urpmi higher level code instead! sub packageByName { my ($packages, $name) = @_; - my @l = sort { $b->id <=> $a->id } grep { $_->name eq $name } packagesProviding($packages, $name); + my $basename = $name =~ s/\(x86-..\)$//r; + my @l = sort { $b->id <=> $a->id } grep { $_->name eq $basename } packagesProviding($packages, $name); my $best; foreach (@l) { |