aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@mandriva.com>2009-07-28 13:16:03 +0000
committerChristophe Fergeau <cfergeau@mandriva.com>2009-07-28 13:16:03 +0000
commit0d098574732d935199379e9b5477d664746ad6e4 (patch)
tree835a31dd9c20f53112dcdf6a2343cb18eeff1360
parent53d47517575dbe57541b353cf7a5a14f11a4b9d2 (diff)
downloadperl-URPM-0d098574732d935199379e9b5477d664746ad6e4.tar
perl-URPM-0d098574732d935199379e9b5477d664746ad6e4.tar.gz
perl-URPM-0d098574732d935199379e9b5477d664746ad6e4.tar.bz2
perl-URPM-0d098574732d935199379e9b5477d664746ad6e4.tar.xz
perl-URPM-0d098574732d935199379e9b5477d664746ad6e4.zip
add a backtrack entry "conflicts" for avoided packages in backtrack_selected
Patch from Anssi Hannula, fixes part of bug #52153
-rw-r--r--URPM.pm2
-rw-r--r--URPM/Resolve.pm7
2 files changed, 8 insertions, 1 deletions
diff --git a/URPM.pm b/URPM.pm
index d1d4a13..1c2afb1 100644
--- a/URPM.pm
+++ b/URPM.pm
@@ -839,10 +839,12 @@ B<rejected>: { 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}