summaryrefslogtreecommitdiffstats
path: root/perl-install/pkgs.pm
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2021-01-11 11:38:39 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2021-01-11 11:38:39 +0000
commit8da35bee0da6d6b5074941f598a15ab1031d4250 (patch)
tree14d3f098f4991aba6a5f99065225ac0cdb965f3d /perl-install/pkgs.pm
parentb2d062329f10000e007b80cc72f10c3c649341eb (diff)
downloaddrakx-8da35bee0da6d6b5074941f598a15ab1031d4250.tar
drakx-8da35bee0da6d6b5074941f598a15ab1031d4250.tar.gz
drakx-8da35bee0da6d6b5074941f598a15ab1031d4250.tar.bz2
drakx-8da35bee0da6d6b5074941f598a15ab1031d4250.tar.xz
drakx-8da35bee0da6d6b5074941f598a15ab1031d4250.zip
Fix handling of TYPE"64bit" flags when reading rpmsrate.
The previous fix that prevented false detection of hardware support packages allowed the installer to pre-select the wrong architecture package when both 32-bit and 64bit media were enabled.
Diffstat (limited to 'perl-install/pkgs.pm')
-rw-r--r--perl-install/pkgs.pm19
1 files changed, 13 insertions, 6 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index 5e079f544..66dbead65 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -92,7 +92,7 @@ sub read_rpmsrate_raw {
}
sub read_rpmsrate {
- my ($packages, $rpmsrate_flags_chosen, $file, $match_all_hardware) = @_;
+ my ($packages, $rpmsrate_flags_chosen, $file, $match_all_hardware, $o_match_only_hardware) = @_;
my ($rates, $flags, $need_to_copy) = read_rpmsrate_raw($file);
@@ -118,6 +118,7 @@ sub read_rpmsrate {
@flags = map {
my ($user_flags, $known_flags) = partition { /^!?CAT_/ } split('\|\|', $_);
+ my $bits_ok;
my $ok = find {
my $inv = s/^!//;
return 0 if $::isStandalone && $inv;
@@ -125,7 +126,13 @@ sub read_rpmsrate {
$match_all_hardware ? 1 : ($inv xor find { $_->{description} =~ /$p/i } @probeall);
} elsif (($p) = /^DRIVER"(.*)"/) {
$match_all_hardware ? 1 : ($inv xor find { $_->{driver} =~ /$p/i } @probeall);
- } elsif ((($p) = /^TYPE"(.*)"/) && $p ne '64bit') {
+ } elsif (/^TYPE"64bit"/) {
+ #- When searching for hardware support packages, we need to filter out packages
+ #- that don't match our architecture without signalling a positive match for
+ #- packages that do. So we record the result of the test here for use later.
+ $bits_ok ||= ($inv xor $TYPEs->{'64bit'});
+ $o_match_only_hardware ? 0 : $bits_ok;
+ } elsif (($p) = /^TYPE"(.*)"/) {
$match_all_hardware ? 1 : ($inv xor $TYPEs->{$p});
} elsif (($p) = /^HW_CAT"(.*)"/) {
$match_all_hardware ? 1 : ($inv xor detect_devices::probe_category($p));
@@ -133,7 +140,7 @@ sub read_rpmsrate {
$inv xor $rpmsrate_flags_chosen->{$_};
}
} @$known_flags;
- $ok ? 'TRUE' : @$user_flags ? join('||', @$user_flags) : 'FALSE';
+ $ok ? 'TRUE' : @$user_flags ? join('||', @$user_flags) : $bits_ok ? () : 'FALSE';
} @flags;
@flags = member('FALSE', @flags) ? 'FALSE' : @flags;
@@ -150,8 +157,8 @@ sub read_rpmsrate {
sub simple_read_rpmsrate {
- my ($o_match_all_hardware, $o_ignore_flags) = @_;
- my ($rates, $flags) = read_rpmsrate({}, {}, $::prefix . '/usr/share/meta-task/rpmsrate-raw', $o_match_all_hardware);
+ my ($o_match_all_hardware, $o_ignore_flags, $o_match_only_hardware) = @_;
+ my ($rates, $flags) = read_rpmsrate({}, {}, $::prefix . '/usr/share/meta-task/rpmsrate-raw', $o_match_all_hardware, $o_match_only_hardware);
# FIXME: we do not handle !CAT_desktop but we do not care for now:
if (!$o_match_all_hardware && $o_ignore_flags) {
@@ -168,7 +175,7 @@ sub simple_read_rpmsrate {
sub detect_rpmsrate_hardware_packages {
my ($o_match_all_hardware, $ignore_flags) = @_;
- grep { !/openoffice|java/ } simple_read_rpmsrate($o_match_all_hardware, $ignore_flags);
+ grep { !/openoffice|java/ } simple_read_rpmsrate($o_match_all_hardware, $ignore_flags, 'match-only-hardware');
}
sub detect_graphical_drivers {