diff options
Diffstat (limited to 'perl-install/pkgs.pm')
-rw-r--r-- | perl-install/pkgs.pm | 19 |
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 { |