From 0d098574732d935199379e9b5477d664746ad6e4 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Tue, 28 Jul 2009 13:16:03 +0000 Subject: add a backtrack entry "conflicts" for avoided packages in backtrack_selected Patch from Anssi Hannula, fixes part of bug #52153 --- URPM.pm | 2 ++ URPM/Resolve.pm | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/URPM.pm b/URPM.pm index d1d4a13..1c2afb1 100644 --- a/URPM.pm +++ b/URPM.pm @@ -839,10 +839,12 @@ B: { fullname => { backtrack => { # those info are only used to display why package is unselected promote => [ name ], keep => [ fullname ], unsatisfied => [ id|property ], + conflicts => [ fullname ], }, closure => { fullname => { old_requested => bool, unsatisfied => [ id|property ], conflicts => property }, + avoid => bool }, }, } } diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm index f10695c..a0dd92e 100644 --- a/URPM/Resolve.pm +++ b/URPM/Resolve.pm @@ -575,6 +575,11 @@ sub backtrack_selected { if ($state->{rejected}{$_->fullname}) { #- keep in mind a backtrack has happening here... exists $dep->{promote} and _add_rejected_backtrack($state, $_, { promote => [ $dep->{promote} ] }); + + my $closure = $state->{rejected}{$_->fullname}{closure} || {}; + foreach my $p (grep { exists $closure->{$_}{avoid} } keys %$closure) { + _add_rejected_backtrack($state, $_, { conflicts => [ $p ] }) + } #- backtrack callback should return a strictly positive value if the selection of the new #- package is prefered over the currently selected package. next; @@ -723,7 +728,7 @@ sub _set_rejected_from { $pkg->fullname ne $from_pkg->fullname or return; - $state->{rejected}{$pkg->fullname}{closure}{$from_pkg->fullname} ||= undef; + $state->{rejected}{$pkg->fullname}{closure}{$from_pkg->fullname}{avoid} ||= undef; } #- side-effects: $state->{rejected} -- cgit v1.2.1