diff options
-rw-r--r-- | perl-install/pkgs.pm | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 6c6c6d1eb..84c38a6ad 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -616,7 +616,7 @@ sub read_rpmsrate { (?: \s*\|\|\s* (?: !\s*)? [0-9A-Z_]+(?:".*?")?)* ) (?:\s+|$) - )(.*)/x) { + )(.*)/x) { #@")) { ($t, $flag, $data) = ($1,$2,$3); while ($flag =~ s,^\s*(("[^"]*"|[^"\s]*)*)\s+,$1,) {} my $ok = 0; @@ -1342,4 +1342,23 @@ sub remove($$) { @{$toRemove || []} = (); } +sub selected_leaves { + my ($packages) = @_; + my %l; + $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]}; + } + } + [ map { + my @l; $l[$FILE] = $_; + packageName(\@l); + } grep { $l{$_} } keys %l ]; +} + 1; |