diff options
author | Christophe Fergeau <cfergeau@mandriva.com> | 2009-07-28 13:13:04 +0000 |
---|---|---|
committer | Christophe Fergeau <cfergeau@mandriva.com> | 2009-07-28 13:13:04 +0000 |
commit | d1d666428ac197ed53d0af999ef1328c1a02c213 (patch) | |
tree | 74dc8cb77c861bd45a5c39f2d966c03ca7c19288 /URPM/Resolve.pm | |
parent | 12bdae7779a82ecf0d9aceb1f7ec03a4c5f98dc1 (diff) | |
download | perl-URPM-d1d666428ac197ed53d0af999ef1328c1a02c213.tar perl-URPM-d1d666428ac197ed53d0af999ef1328c1a02c213.tar.gz perl-URPM-d1d666428ac197ed53d0af999ef1328c1a02c213.tar.bz2 perl-URPM-d1d666428ac197ed53d0af999ef1328c1a02c213.tar.xz perl-URPM-d1d666428ac197ed53d0af999ef1328c1a02c213.zip |
keep psel/promote info and remove deadlocked pkg instead of aborting upgrade
Patch from Anssi Hannula, fixes bug #52105
lib64gcj9 has to be removed (conflicts), therefore so does libgcj9-src (x86_64)
that depends on it. Installed java-1.5.0-gcj-src depends on libgcj9-src, so
perl-URPM tries to promote the i586 libgcj9-src for it. However, strict_arch
check prohibits changing the arch, so it falls back to backtracking.
Backtracking finds libgcj9-src again and tries to select it; however, it drops
$dep->{psel} and $dep->{promote}, so when it fails again, perl-URPM does not
know java-1.5.0-gcj-src should also be removed due to the failed promotion.
This patch changes the code in backtrack_selected in two ways:
1) When a replacement package is found, keep {promote} and {psel} info, so that
when backtrack_selected is run the second time it correctly handles the failed
promotion.
2) When such a replacement fails as well and the deadlock protection is
triggered, do not switch to keep mode for the package that caused the promotion
(it would unselect all the packages involved in the update that caused the
promotion). Instead proceed to remove it as usual.
The patch introduces no failures on the urpmi testsuite.
Diffstat (limited to 'URPM/Resolve.pm')
-rw-r--r-- | URPM/Resolve.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm index 801929b..1f23552 100644 --- a/URPM/Resolve.pm +++ b/URPM/Resolve.pm @@ -561,9 +561,7 @@ sub backtrack_selected { if (defined $dep->{required}) { #- avoid deadlock here... - if (exists $state->{backtrack}{deadlock}{$dep->{required}}) { - $options{keep} = 1; #- force keeping package to that backtrack is doing something. - } else { + if (!exists $state->{backtrack}{deadlock}{$dep->{required}}) { $state->{backtrack}{deadlock}{$dep->{required}} = undef; #- search for all possible packages, first is to try the selection, then if it is @@ -593,6 +591,8 @@ sub backtrack_selected { return { required => $_->id, exists $dep->{from} ? (from => $dep->{from}) : @{[]}, exists $dep->{requested} ? (requested => $dep->{requested}) : @{[]}, + exists $dep->{promote} ? (promote => $dep->{promote}) : @{[]}, + exists $dep->{psel} ? (psel => $dep->{psel}) : @{[]}, }; } } |