[Yum-devel] [PATCH] Fix for obsoleting pkgs. we are trying to install
James Antill
james at and.org
Tue May 18 20:17:22 UTC 2010
---
yum/__init__.py | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/yum/__init__.py b/yum/__init__.py
index 612b6ab..f5f2b51 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -2882,7 +2882,18 @@ class YumBase(depsolve.Depsolve):
we should install instead. Or None if there isn't one. """
thispkgobsdict = self.up.checkForObsolete([po.pkgtup])
if po.pkgtup in thispkgobsdict:
- obsoleting = thispkgobsdict[po.pkgtup][0]
+ obsoleting = thispkgobsdict[po.pkgtup]
+ oobsoleting = []
+ # We want to keep the arch. of the obsoleted pkg. if possible.
+ for opkgtup in obsoleting:
+ if not canCoinstall(po.arch, opkgtup[1]):
+ oobsoleting.append(opkgtup)
+ if oobsoleting:
+ obsoleting = oobsoleting
+ # NOTE: if we move from noarch => multilib. then the ordering
+ # here seems to always prefer i386 over x86_64 which is wrong.
+ # Need to sort by arch?
+ obsoleting = obsoleting[0]
obsoleting_pkg = self.getPackageObject(obsoleting)
return obsoleting_pkg
return None
--
1.7.0.1
More information about the Yum-devel
mailing list