summaryrefslogtreecommitdiffstats
path: root/perl-install/pkgs.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-08-29 15:07:47 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-08-29 15:07:47 +0000
commit5c71ee3cf38c3f8f7c07c67648676e4b7c6650c4 (patch)
treee70d2b453cf934db5a4fcc3bfe59a7117055d7e4 /perl-install/pkgs.pm
parenta90999ed7daa08d9eb92e0b8fa2cc69cfcb4e85b (diff)
downloaddrakx-5c71ee3cf38c3f8f7c07c67648676e4b7c6650c4.tar
drakx-5c71ee3cf38c3f8f7c07c67648676e4b7c6650c4.tar.gz
drakx-5c71ee3cf38c3f8f7c07c67648676e4b7c6650c4.tar.bz2
drakx-5c71ee3cf38c3f8f7c07c67648676e4b7c6650c4.tar.xz
drakx-5c71ee3cf38c3f8f7c07c67648676e4b7c6650c4.zip
on 2002/07/10 (1.347), selected_leaves() behaviour was broken, listing all packages.
restoring it (bugzilla #18000)
Diffstat (limited to 'perl-install/pkgs.pm')
-rw-r--r--perl-install/pkgs.pm15
1 files changed, 11 insertions, 4 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index 08f3087c6..ab8f2c313 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -1258,12 +1258,19 @@ sub remove {
sub selected_leaves {
my ($packages) = @_;
- my @leaves;
+ my $provides = $packages->{provides};
- foreach (@{$packages->{depslist}}) {
- ($_->flag_requested || $_->flag_installed) && !$_->flag_base and push @leaves, $_->name;
+ my @l = grep { ($_->flag_requested || $_->flag_installed) && !$_->flag_base } @{$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;
+ }
}
- \@leaves;
+ [ map { $_->name } grep { !$required_ids{$_->id} } @l ];
}
sub naughtyServers_list {