diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-09-17 18:03:03 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-09-17 18:03:03 +0000 |
commit | 9798710de11d8451f613d753cf0051967c753fac (patch) | |
tree | 68ca905b6312e938ecfc379d4a5acbe8725a8de6 | |
parent | 9d68deab4b578925c35a52c7b10b4c4b63c95a71 (diff) | |
download | perl-URPM-9798710de11d8451f613d753cf0051967c753fac.tar perl-URPM-9798710de11d8451f613d753cf0051967c753fac.tar.gz perl-URPM-9798710de11d8451f613d753cf0051967c753fac.tar.bz2 perl-URPM-9798710de11d8451f613d753cf0051967c753fac.tar.xz perl-URPM-9798710de11d8451f613d753cf0051967c753fac.zip |
(resolve_requested_suggests) split it out of resolve_requested()
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | URPM/Resolve.pm | 15 |
2 files changed, 12 insertions, 4 deletions
@@ -1,3 +1,4 @@ +- API: add resolve_requested_suggests() - slightly increase testsuite coverage - update outdated doc diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm index 7a4ea5d..b6ceac6 100644 --- a/URPM/Resolve.pm +++ b/URPM/Resolve.pm @@ -882,7 +882,14 @@ sub resolve_requested { my @selected = resolve_requested__no_suggests($urpm, $db, $state, $requested, %options); if (!$options{no_suggests}) { - my @todo = @selected; + @selected = resolve_requested_suggests($urpm, $db, $state, \@selected, %options); + } + @selected; +} + +sub resolve_requested_suggests { + my ($urpm, $db, $state, $selected, %options) = @_; + my @todo = @$selected; while (@todo) { my $pkg = shift @todo; my %suggests = map { $_ => 1 } $pkg->suggests or next; @@ -908,11 +915,11 @@ sub resolve_requested { my %new_requested = map { $_ => undef } keys %suggests; my @new_selected = resolve_requested__no_suggests_($urpm, $db, $state, \%new_requested, %options); $state->{selected}{$_->id}{suggested} = 1 foreach @new_selected; - push @selected, @new_selected; + push @$selected, @new_selected; push @todo, @new_selected; } - } - @selected; + + @$selected; } #- Resolve dependencies of requested packages; keep resolution state to |