[yum-cvs] yum/yum sqlitesack.py,1.69,1.70
Seth Vidal
skvidal at linux.duke.edu
Wed Feb 28 06:49:23 UTC 2007
Update of /home/groups/yum/cvs/yum/yum
In directory login1.linux.duke.edu:/tmp/cvs-serv8211/yum
Modified Files:
sqlitesack.py
Log Message:
check excludeArch query to use not in (range)
Index: sqlitesack.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/sqlitesack.py,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -r1.69 -r1.70
--- sqlitesack.py 28 Feb 2007 05:46:56 -0000 1.69
+++ sqlitesack.py 28 Feb 2007 06:49:21 -0000 1.70
@@ -359,7 +359,7 @@
if len(pkgId_list) == 0:
return pkgs
pkgid_query = str(tuple(pkgId_list))
- print pkgid_query
+
for (rep,cache) in self.primarydb.items():
cur = cache.cursor()
executeSQL(cur, "select * from packages where pkgId in ?", (pkgid_query,))
@@ -646,15 +646,13 @@
def excludeArchs(self, archlist):
"""excludes incompatible arches - archlist is a list of compat arches"""
- tmpstring = "select * from packages WHERE "
- for arch in archlist:
- tmpstring = tmpstring + 'arch != "%s" AND ' % arch
-
- last = tmpstring.rfind('AND') # clip that last AND
- querystring = tmpstring[:last]
+ arch_query = str(tuple(archlist))
+
for (rep, cache) in self.primarydb.items():
cur = cache.cursor()
- executeSQL(cur, querystring)
+ myq = "select pkgId from packages where arch not in %s" % arch_query
+ executeSQL(cur, myq)
+ #executeSQL(cur, "select pkgId from packages where arch not in ?", (arch_query,))
for row in cur.fetchall():
obj = self.pc(rep,row)
self.delPackage(obj)
More information about the Yum-cvs-commits
mailing list