summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-04-17 21:10:16 +0000
committerThierry Vignaud <tv@mageia.org>2012-04-17 21:10:16 +0000
commite6b8ab46680c101c6fccfc2677a5f60aa2a77066 (patch)
tree0f22b7b5aeb55f3122fb82c1ceff5e12979e0ac4 /perl-install
parentc354a8c3b5000d35ec7adc680f14d45e3cb67a1b (diff)
downloaddrakx-e6b8ab46680c101c6fccfc2677a5f60aa2a77066.tar
drakx-e6b8ab46680c101c6fccfc2677a5f60aa2a77066.tar.gz
drakx-e6b8ab46680c101c6fccfc2677a5f60aa2a77066.tar.bz2
drakx-e6b8ab46680c101c6fccfc2677a5f60aa2a77066.tar.xz
drakx-e6b8ab46680c101c6fccfc2677a5f60aa2a77066.zip
(select_by_package_names_or_die) track suggested packages
(unselectAllPackages) unselect already suggested packages when performing a minimal install if "no suggests" option was choosen (mga#5209) rationale: the no_suggests option only applies after selecting basesystem (thus minimal install has urpmi b/c basesystem suggest urpmi)
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/install/NEWS2
-rw-r--r--perl-install/install/pkgs.pm5
2 files changed, 7 insertions, 0 deletions
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index a60c06af3..52fc570a7 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,5 +1,7 @@
- fix lock icon
- show again package descriptions in individual package list (mga#549)
+- unselect already suggested packages when performing a minimal install if "no
+ suggests" option was choosen (mga#5209)
Version 14.5 - 12 April 2012
diff --git a/perl-install/install/pkgs.pm b/perl-install/install/pkgs.pm
index a63622c90..9420f0cea 100644
--- a/perl-install/install/pkgs.pm
+++ b/perl-install/install/pkgs.pm
@@ -273,11 +273,13 @@ sub select_by_package_names_or_die {
}
}
+my @suggested_package_ids;
sub _resolve_requested_and_check {
my ($packages, $state, $requested) = @_;
my @l = $packages->resolve_requested($packages->{rpmdb}, $state, $requested,
callback_choices => \&packageCallbackChoices, no_suggests => $::o->{no_suggests});
+ @suggested_package_ids = uniq(@suggested_package_ids, map { $packages->{depslist}[$_]->id } grep { $state->{selected}{$_}{suggested} } keys $state->{selected});
my $error;
if (find { !exists $state->{selected}{$_} } keys %$requested) {
@@ -329,7 +331,10 @@ sub unselectAllPackages {
my %keep_selected;
log::l("unselecting all packages...");
foreach (@{$packages->{depslist}}) {
+ log::l("will unselect suggested " . $_->name) if member($_->id, @suggested_package_ids);
my $to_select = $_->flag_base || $_->flag_installed && $_->flag_selected;
+ # unselect suggested packages if minimal install:
+ undef $to_select if $::o->{no_suggests} && member($_->id, @suggested_package_ids);
if ($to_select) {
#- keep track of packages that should be kept selected.
$keep_selected{$_->id} = $_;