From 277e941bfef194a7377251697e1e9b09522c2fb0 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 28 Sep 2007 20:11:53 +0000 Subject: create _find_packages_obsoleting() out of _handle_diff_provides() --- URPM/Resolve.pm | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'URPM') diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm index 0a45cad..0b15eda 100644 --- a/URPM/Resolve.pm +++ b/URPM/Resolve.pm @@ -1023,6 +1023,20 @@ sub _no_unsatisfied_requires { @l == 0; } +#- side-effects: none +sub _find_packages_obsoleting { + my ($urpm, $state, $p) = @_; + + grep { + !$_->flag_skip + && $_->is_arch_compat + && !exists $state->{rejected}->{$_->fullname} + && $_->obsoletes_overlap($p->name . " == " . $p->epoch . ":" . $p->version . "-" . $p->release) + && $_->fullname ne $p->fullname + && (!strict_arch($urpm) || strict_arch_check($p, $_)); + } packages_obsoleting($urpm, $p->name); +} + #- side-effects: $properties #- + those of backtrack_selected_psel_keep ($state->{rejected}, $state->{selected}, $state->{whatrequires}, flag_requested, flag_required) #- + those of resolve_rejected_ ($state->{rejected}, $properties) @@ -1044,15 +1058,9 @@ sub _handle_diff_provides { } @packages; if (!@packages) { - @packages = packages_obsoleting($urpm, $p->name); + @packages = _find_packages_obsoleting($urpm, $state, $p); @packages = grep { - !$_->flag_skip - && $_->is_arch_compat - && !exists $state->{rejected}->{$_->fullname} - && $_->obsoletes_overlap($p->name . " == " . $p->epoch . ":" . $p->version . "-" . $p->release) - && $_->fullname ne $p->fullname - && (!strict_arch($urpm) || strict_arch_check($p, $_)) - && _no_unsatisfied_requires($urpm, $db, $state, $_, $n); + _no_unsatisfied_requires($urpm, $db, $state, $_, $n); } @packages; } -- cgit v1.2.1