diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2006-01-24 11:57:20 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2006-01-24 11:57:20 +0000 |
commit | cb76a5870235859c0060daad78d28e2a33fe79aa (patch) | |
tree | 7d5b1ebd710af763313a0fd90393509bafb2c7f5 | |
parent | bb1a3951592955a14d20875f2ec45e294141c05e (diff) | |
download | drakx-cb76a5870235859c0060daad78d28e2a33fe79aa.tar drakx-cb76a5870235859c0060daad78d28e2a33fe79aa.tar.gz drakx-cb76a5870235859c0060daad78d28e2a33fe79aa.tar.bz2 drakx-cb76a5870235859c0060daad78d28e2a33fe79aa.tar.xz drakx-cb76a5870235859c0060daad78d28e2a33fe79aa.zip |
fix selected_leaves() dropping all packages in a circular reference
(including short circular references like amarok-engine-arts -> libamarokarts.so -> amarok-engine-arts)
-rw-r--r-- | perl-install/pkgs.pm | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index bb6efaf3d..00920c079 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -1397,14 +1397,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 { |