[yum-commits] yum/packages.py yum/sqlitesack.py
James Antill
james at osuosl.org
Tue Mar 25 17:50:33 UTC 2014
yum/packages.py | 2 +-
yum/sqlitesack.py | 12 +++++++++++-
2 files changed, 12 insertions(+), 2 deletions(-)
New commits:
commit b4bad8817d5b5b522e800befbbd3bb83683846c1
Author: James Antill <james at and.org>
Date: Tue Mar 25 13:50:09 2014 -0400
Check for the new weak deps. tables. BZ 1080569.
diff --git a/yum/packages.py b/yum/packages.py
index ccac9da..69c612f 100644
--- a/yum/packages.py
+++ b/yum/packages.py
@@ -1197,7 +1197,7 @@ class YumAvailablePackage(PackageObject, RpmBase):
def _dump_pco(self, pcotype):
msg = ""
- mylist = getattr(self, pcotype)
+ mylist = self.returnPrco(pcotype)
if mylist: msg = "\n <rpm:%s>\n" % pcotype
for (name, flags, (e,v,r)) in sorted(mylist):
pcostring = ''' <rpm:entry name="%s"''' % misc.to_xml(name, attrib=True)
diff --git a/yum/sqlitesack.py b/yum/sqlitesack.py
index 2da5a44..c11c818 100644
--- a/yum/sqlitesack.py
+++ b/yum/sqlitesack.py
@@ -391,7 +391,17 @@ class YumAvailablePackageSqlite(YumAvailablePackage, PackageObject, RpmBase):
# pkg not installed so we don't know require flags yet
# returning all requires should work in most cases
prcotype = 'requires'
- if isinstance(self.prco[prcotype], tuple):
+
+ # Check for the new weak deps. tables...
+ sql_table_exists = True
+ if prcotype in ('suggests', 'enhances', 'recommends', 'supplements'):
+ cur = self._sql_MD('primary', "PRAGMA index_info(%s)" % prcotype)
+ for ob in cur:
+ break
+ else:
+ sql_table_exists = False
+
+ if sql_table_exists and isinstance(self.prco[prcotype], tuple):
sql = "SELECT name, version, release, epoch, flags " \
"FROM %s WHERE pkgKey = ?" % prcotype
cur = self._sql_MD('primary', sql, (self.pkgKey,))
More information about the Yum-commits
mailing list