From 801fb12d1ff2c9ac167452b8f76ba32168065667 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 24 Jan 2006 11:58:00 +0000 Subject: fix selected_leaves(): it was dropping all packages in a circular reference (including short circular references like amarok-engine-arts -> libamarokarts.so -> amarok-engine-arts) --- perl-install/pkgs.pm | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'perl-install') diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index b1dd4519a..5f637645d 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -1396,14 +1396,19 @@ sub selected_leaves { my @l = grep { $_->flag_requested || $_->flag_installed } @{$packages->{depslist}}; my %required_ids; - foreach (@l) { - foreach ($_->requires_nosense) { - my $h = $provides->{$_} or next; - my @provides = keys %$h; - $required_ids{$provides[0]} = 1 if @provides == 1; + foreach my $pkg (@l) { + foreach my $req ($pkg->requires_nosense) { + my $h = $provides->{$req} or next; + my @provides = my ($provide) = keys %$h; + @provides == 1 or next; + if ($provide != (exists $required_ids{$pkg->id} ? $required_ids{$pkg->id} : $pkg->id)) { +# log::l($packages->{depslist}[$provide]->name . " is not a leaf because required by " . $pkg->name . " (through require $req)"); + #- $pkg requires $req, provided by $provide, so we can skip $provide + $required_ids{$provide} = $pkg->id; + } } } - [ map { $_->name } grep { !$required_ids{$_->id} } @l ]; + [ map { $_->name } grep { ! exists $required_ids{$_->id} } @l ]; } sub naughtyServers_list { -- cgit v1.2.1