summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-04-17 14:50:03 +0000
committerThierry Vignaud <tv@mandriva.org>2009-04-17 14:50:03 +0000
commit83be6ef980f2667a7f72fbaf7c43ad47efdf524d (patch)
tree9f491416505d26cf002237bf64e21088306f686e
parent407a1bed7e0b9f9ae244793827eee0b8f142e903 (diff)
downloaddrakx-83be6ef980f2667a7f72fbaf7c43ad47efdf524d.tar
drakx-83be6ef980f2667a7f72fbaf7c43ad47efdf524d.tar.gz
drakx-83be6ef980f2667a7f72fbaf7c43ad47efdf524d.tar.bz2
drakx-83be6ef980f2667a7f72fbaf7c43ad47efdf524d.tar.xz
drakx-83be6ef980f2667a7f72fbaf7c43ad47efdf524d.zip
(detect_hardware_packages,simple_read_rpmsrate) do not offer to install
KDE packages on GNOME or LXDE (#49671)
-rw-r--r--perl-install/NEWS1
-rw-r--r--perl-install/pkgs.pm23
2 files changed, 20 insertions, 4 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS
index ab34171a6..f0d1f43c2 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,6 +1,7 @@
- harddrake:
o always detect PCI modems (even when (slow) detecting serial modems
is disabled)
+ o do not offer to install KDE packages on GNOME or LXDE (#49671)
Version 12.28.1 - 16 April 2009
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index f89881145..19f98521b 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -149,14 +149,25 @@ sub read_rpmsrate {
sub simple_read_rpmsrate {
- my ($o_match_all_hardware) = @_;
+ my ($o_match_all_hardware, $o_ignore_flags) = @_;
my ($rates, $flags) = read_rpmsrate({}, {}, $::prefix . '/usr/share/meta-task/rpmsrate-raw', $o_match_all_hardware);
+
+ # FIXME: we do not handle !CAT_desktop but we do not care for now:
+ if (!$o_match_all_hardware && $o_ignore_flags) {
+ while (my ($pkg, $pkg_flags) = each %$flags) {
+ my $flags_str = "@$pkg_flags";
+ if ($flags_str =~ /TRUE/ && any { $flags_str =~ /[^!]$_/ } @$o_ignore_flags) {
+ delete $flags->{$pkg};
+ }
+ }
+ }
+
grep { member('TRUE', @{$flags->{$_}}) && $rates->{$_} >= 5 } keys %$flags;
}
sub detect_rpmsrate_hardware_packages {
- my ($o_match_all_hardware) = @_;
- grep { !/openoffice/ } simple_read_rpmsrate($o_match_all_hardware);
+ my ($o_match_all_hardware, $ignore_flags) = @_;
+ grep { !/openoffice/ } simple_read_rpmsrate($o_match_all_hardware, $ignore_flags);
}
sub detect_graphical_drivers {
@@ -204,8 +215,12 @@ sub detect_network_drivers {
sub detect_hardware_packages {
my ($do_pkgs, $o_match_all_hardware) = @_;
+ my @ignore_flags = $::isInstall ? () : (
+ if_(!$do_pkgs->are_installed('task-kde4-minimal', 'task-kde3-minimal'), "CAT_KDE"),
+ if_(!$do_pkgs->is_installed('task-gnome'), "CAT_GNOME"),
+ );
(
- ($::isInstall ? () : detect_rpmsrate_hardware_packages($o_match_all_hardware)),
+ ($::isInstall ? () : detect_rpmsrate_hardware_packages($o_match_all_hardware, \@ignore_flags)),
detect_graphical_drivers($do_pkgs, $o_match_all_hardware),
detect_network_drivers($do_pkgs, $o_match_all_hardware),
);