diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-07-04 11:10:26 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-07-04 11:10:26 +0000 |
commit | 8c1a6ae69ad23ff06e474e70f55e2001c113d568 (patch) | |
tree | c62ce91c14288cb7ebddb1cd5bceccadfec7d2e4 /perl-install/pkgs.pm | |
parent | cefb81ce9972d9d39009e6f9b9657168594ea50b (diff) | |
download | drakx-backup-do-not-use-8c1a6ae69ad23ff06e474e70f55e2001c113d568.tar drakx-backup-do-not-use-8c1a6ae69ad23ff06e474e70f55e2001c113d568.tar.gz drakx-backup-do-not-use-8c1a6ae69ad23ff06e474e70f55e2001c113d568.tar.bz2 drakx-backup-do-not-use-8c1a6ae69ad23ff06e474e70f55e2001c113d568.tar.xz drakx-backup-do-not-use-8c1a6ae69ad23ff06e474e70f55e2001c113d568.zip |
(selected_leaves): make it work with loops (eg: mandrake_desk loops with
control-center resulting on none of them being a leaf)
Diffstat (limited to 'perl-install/pkgs.pm')
-rw-r--r-- | perl-install/pkgs.pm | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 2004fb294..c779b7dcf 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -532,7 +532,7 @@ sub getDeps { $arch eq packageArch($pkg) or log::l("ignoring $name-$version-$release.$arch in depslist mismatch arch in hdlist"), next; - $epoch > 0 and $pkg->[$EPOCH] = $epoch; #- only 5% of the distribution use epoch (serial). + $epoch && $epoch > 0 and $pkg->[$EPOCH] = $epoch; #- only 5% of the distribution use epoch (serial). $pkg->[$SIZE_DEPS] = $sizeDeps; #- check position of package in depslist according to precomputed @@ -1493,17 +1493,23 @@ sub remove($$) { sub selected_leaves { my ($packages) = @_; - my %l; + my (%l, %m); $l{$_->[$FILE]} = 1 foreach grep { packageFlagSelected($_) && !packageFlagBase($_) } @{$packages->{depslist}}; - my %m = %l; - foreach (@{$packages->{depslist}}) { - delete $m{$_->[$FILE]} or next; - foreach (map { split '\|' } grep { !/^NOTFOUND_/ } packageDepsId($_)) { - delete $l{$packages->{depslist}[$_][$FILE]}; + do { + %m = %l; + + N: foreach my $p (@{$packages->{depslist}}) { + foreach (packageProvides($p)) { + if ($l{$_->[$FILE]}) { + delete $l{$p->[$FILE]}; + next N; + } + } } - } + } until (%m = %l); + [ map { my @l; $l[$FILE] = $_; packageName(\@l); |