From b6764551eb60f54fbab7ab10829871f56df24f2d Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Sun, 12 Aug 2007 14:17:39 +0000 Subject: - internal o computeGroupSize: do direct requires before choices (eg for epiphany: require libmozilla-firefox2.0.0.6 before choosing package providing libmozjs.so) ps: is such a thing already done in perl-URPM's resolve_requested() ? --- perl-install/install/NEWS | 5 +++++ perl-install/install/pkgs.pm | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'perl-install') diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS index 3be68e94c..9b81fc2ce 100644 --- a/perl-install/install/NEWS +++ b/perl-install/install/NEWS @@ -1,3 +1,8 @@ +- internal + o computeGroupSize: do direct requires before choices + (eg for epiphany: require libmozilla-firefox2.0.0.6 before choosing + package providing libmozjs.so) + Version 10.4.165 - 10 August 2007, by Thierry Vignaud - fix detecting sound cards diff --git a/perl-install/install/pkgs.pm b/perl-install/install/pkgs.pm index dbf6c07c6..7df037c87 100644 --- a/perl-install/install/pkgs.pm +++ b/perl-install/install/pkgs.pm @@ -493,8 +493,9 @@ sub computeGroupSize { $newSelection{$id} = undef; my $pkg = $packages->{depslist}[$id]; - foreach ($pkg->requires_nosense) { - my @choices = keys %{$packages->{provides}{$_} || {}}; + my @requires = map { [ $_, keys %{$packages->{provides}{$_} || {}} ] } $pkg->requires_nosense; + foreach (sort { @$a <=> @$b } @requires) { #- sort on number of provides (it helps choosing "b" in: "a" requires both "b" and virtual={"b","c"}) + my ($virtual, @choices) = @$_; if (@choices <= 1) { #- only one choice :) } elsif (find { exists $newSelection{$_} } @choices) { @@ -504,7 +505,7 @@ sub computeGroupSize { if (find { $_->flag_available } @choices_pkgs) { @choices = (); #- one package is already selected (?) } else { - @choices = map { $_->id } packageCallbackChoices($packages, undef, undef, \@choices_pkgs, $_); + @choices = map { $_->id } packageCallbackChoices($packages, undef, undef, \@choices_pkgs, $virtual); } } push @l2, @choices; -- cgit v1.2.1