aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-09-11 13:32:50 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-09-11 13:32:50 +0000
commit49c3eab1c7be20df2a1e7674e66c0250cd700500 (patch)
tree833bc7db92ed0797c2e60450c2a50ff0c0eb206f
parentbd27c3852b91d0be9642de56f719f7183f374acc (diff)
downloadperl-URPM-49c3eab1c7be20df2a1e7674e66c0250cd700500.tar
perl-URPM-49c3eab1c7be20df2a1e7674e66c0250cd700500.tar.gz
perl-URPM-49c3eab1c7be20df2a1e7674e66c0250cd700500.tar.bz2
perl-URPM-49c3eab1c7be20df2a1e7674e66c0250cd700500.tar.xz
perl-URPM-49c3eab1c7be20df2a1e7674e66c0250cd700500.zip
simplify
-rw-r--r--URPM/Resolve.pm13
1 files changed, 6 insertions, 7 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index 032268d..c5f4743 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -358,8 +358,7 @@ sub backtrack_selected {
my @l = map { $urpm->search($_, strict_fullname => 1) }
keys %{($state->{rejected}{$_->fullname} || {})->{closure}};
- $options{keep_unrequested_dependencies} ? disable_selected($urpm, $db, $state, @l) :
- disable_selected_unrequested_dependencies($urpm, $db, $state, @l);
+ disable_selected_unrequested_dependencies($urpm, $db, $state, $options{keep_unrequested_dependencies}, @l);
return { required => $_->id,
exists $dep->{from} ? (from => $dep->{from}) : @{[]},
@@ -380,8 +379,7 @@ sub backtrack_selected {
#- all selection tree, re-enabling removed and obsoleted packages as well.
unless (exists $state->{rejected}{$dep->{from}->fullname}) {
#- package is not currently rejected, compute the closure now.
- my @l = $options{keep_unrequested_dependencies} ? disable_selected($urpm, $db, $state, $dep->{from}) :
- disable_selected_unrequested_dependencies($urpm, $db, $state, $dep->{from});
+ my @l = disable_selected_unrequested_dependencies($urpm, $db, $state, $options{keep_unrequested_dependencies}, $dep->{from});
foreach (@l) {
#- disable all these packages in order to avoid selecting them again.
$_->fullname eq $dep->{from}->fullname or
@@ -400,8 +398,7 @@ sub backtrack_selected {
#- we shouldn't try to remove packages, so psel which leads to this need to be unselected.
unless (exists $state->{rejected}{$dep->{psel}->fullname}) {
#- package is not currently rejected, compute the closure now.
- my @l = $options{keep_unrequested_dependencies} ? disable_selected($urpm, $db, $state, $dep->{psel}) :
- disable_selected_unrequested_dependencies($urpm, $db, $state, $dep->{psel});
+ my @l = disable_selected_unrequested_dependencies($urpm, $db, $state, $options{keep_unrequested_dependencies}, $dep->{psel});
foreach (@l) {
#- disable all these packages in order to avoid selecting them again.
$_->fullname eq $dep->{psel}->fullname or
@@ -1039,7 +1036,7 @@ sub disable_selected {
#- determine dependencies that can safely been removed and are not requested
sub disable_selected_unrequested_dependencies {
- my ($urpm, $db, $state, @pkgs_todo) = @_;
+ my ($urpm, $db, $state, $keep_unrequested_dependencies, @pkgs_todo) = @_;
my @all_unselected;
#- disable selected packages, then extend unselection to all required packages
@@ -1050,6 +1047,8 @@ sub disable_selected_unrequested_dependencies {
#- keep in the packages that had to be unselected.
@all_unselected or push @all_unselected, @unselected;
+ $keep_unrequested_dependencies and last; #- do not recurse
+
#- search for unrequested required packages.
foreach (@unselected) {
foreach ($_->requires_nosense) {