[Yum-devel] [PATCH] Fix huge checkConflicts regression due to 4.9.x code conversion.
James Antill
james at and.org
Wed Nov 10 23:29:24 UTC 2010
---
yum/depsolve.py | 5 ++++-
yum/rpmsack.py | 5 +++++
2 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/yum/depsolve.py b/yum/depsolve.py
index b0d1e80..f273cff 100644
--- a/yum/depsolve.py
+++ b/yum/depsolve.py
@@ -1103,8 +1103,11 @@ class Depsolve(object):
for po in self.rpmdb.returnConflictPackages():
if self.tsInfo.getMembersWithState(po.pkgtup, output_states=TS_REMOVE_STATES):
continue
+ conflicts = po.returnPrco('conflicts')
+ if not conflicts: # We broke this due to dbMatch() usage.
+ continue
cpkgs.append(po)
- for conflict in po.returnPrco('conflicts'):
+ for conflict in conflicts:
(r, f, v) = conflict
for conflicting_po in self.tsInfo.getNewProvides(r, f, v):
if conflicting_po.pkgtup[0] == po.pkgtup[0] and conflicting_po.pkgtup[2:] == po.pkgtup[2:]:
diff --git a/yum/rpmsack.py b/yum/rpmsack.py
index e227729..2302cf6 100644
--- a/yum/rpmsack.py
+++ b/yum/rpmsack.py
@@ -40,6 +40,7 @@ import yum.depsolve
class RPMInstalledPackage(YumInstalledPackage):
def __init__(self, rpmhdr, index, rpmdb):
+ self._has_hdr = True
YumInstalledPackage.__init__(self, rpmhdr, yumdb=rpmdb.yumdb)
# NOTE: We keep summary/description/url because it doesn't add much
# and "yum search" uses them all.
@@ -638,6 +639,10 @@ class RPMDBPackageSack(PackageSackBase):
if hdr['name'] == 'gpg-pubkey': # Just in case...
continue
+ if not hdr[rpm.RPMTAG_CONFLICTNAME]:
+ # Pre. rpm-4.9.x the above dbMatch() does nothing.
+ continue
+
po = self._makePackageObject(hdr, mi.instance())
result[po.pkgid] = po
if po._has_hdr:
--
1.7.2.3
More information about the Yum-devel
mailing list