From 16e29d6b9a28e5ed25c6f5f65fb891074870286f Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Tue, 25 Feb 2003 18:15:31 +0000 Subject: improved code for populating group with pixel. --- perl-install/pkgs.pm | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'perl-install/pkgs.pm') diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 3719c5309..02c60d989 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -665,7 +665,7 @@ sub computeGroupSize { } join("\t", map { join('&&', @$_) } @r); } - my (%group, %memo); + my (%group, %memo, $slowpart_counter); foreach my $p (@{$packages->{depslist}}) { my @flags = $p->rflags; @@ -688,16 +688,27 @@ sub computeGroupSize { my $pkg = $packages->{depslist}[$id]; foreach ($pkg->requires_nosense) { - my ($candidate_id, $prefer_id); - foreach (keys %{$packages->{provides}{$_} || {}}) { - 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 ||= $_; - $candidate_id = $_; - } - if (defined $prefer_id || defined $candidate_id) { - push @l2, defined $prefer_id ? $prefer_id : $candidate_id; + 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) { + /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; + } } } } -- cgit v1.2.1