summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/pkgs.pm22
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);