summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-08-12 13:30:49 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-08-12 13:30:49 +0000
commite93eebce620d5f30ae350b8e7dc79c1ee5633b04 (patch)
tree64b3c285862a82785102beec61187abbc629d691
parenta576b7e4e024766652f16a818d4d627eca416821 (diff)
downloaddrakx-e93eebce620d5f30ae350b8e7dc79c1ee5633b04.tar
drakx-e93eebce620d5f30ae350b8e7dc79c1ee5633b04.tar.gz
drakx-e93eebce620d5f30ae350b8e7dc79c1ee5633b04.tar.bz2
drakx-e93eebce620d5f30ae350b8e7dc79c1ee5633b04.tar.xz
drakx-e93eebce620d5f30ae350b8e7dc79c1ee5633b04.zip
computeGroupSize(): use packageCallbackChoices()
-rw-r--r--perl-install/install/pkgs.pm30
1 files changed, 11 insertions, 19 deletions
diff --git a/perl-install/install/pkgs.pm b/perl-install/install/pkgs.pm
index 5322892c5..dbf6c07c6 100644
--- a/perl-install/install/pkgs.pm
+++ b/perl-install/install/pkgs.pm
@@ -463,7 +463,7 @@ sub computeGroupSize {
}
join("\t", map { join('&&', @$_) } @r);
}
- my (%group, %memo, $slowpart_counter);
+ my (%group, %memo);
log::l("install::pkgs::computeGroupSize");
my $time = time();
@@ -496,26 +496,18 @@ sub computeGroupSize {
foreach ($pkg->requires_nosense) {
my @choices = keys %{$packages->{provides}{$_} || {}};
if (@choices <= 1) {
- push @l2, @choices;
- } elsif (! find { exists $newSelection{$_} } @choices) {
- my ($candidate_id, $prefer_id);
- foreach (@choices) {
- ++$slowpart_counter;
- my $ppkg = $packages->{depslist}[$_] or next;
- $ppkg->flag_available and $prefer_id = $candidate_id = undef, last;
- exists $preferred{$ppkg->name} and $prefer_id = $_;
- $ppkg->name =~ /kernel-\d/ and $prefer_id ||= $_;
- foreach my $l ($ppkg->requires_nosense) {
- $l =~ /locales-/ or next;
- my $pppkg = packageByName($packages, $l) or next;
- $pppkg->flag_available and $prefer_id ||= $_;
- }
- $candidate_id = $_;
- }
- if (defined $prefer_id || defined $candidate_id) {
- push @l2, defined $prefer_id ? $prefer_id : $candidate_id;
+ #- only one choice :)
+ } elsif (find { exists $newSelection{$_} } @choices) {
+ @choices = ();
+ } else {
+ my @choices_pkgs = map { $packages->{depslist}[$_] } @choices;
+ if (find { $_->flag_available } @choices_pkgs) {
+ @choices = (); #- one package is already selected (?)
+ } else {
+ @choices = map { $_->id } packageCallbackChoices($packages, undef, undef, \@choices_pkgs, $_);
}
}
+ push @l2, @choices;
}
}