[yum-cvs] yum/yum sqlitesack.py,1.63,1.64

Seth Vidal skvidal at linux.duke.edu
Mon Feb 26 06:35:15 UTC 2007


Update of /home/groups/yum/cvs/yum/yum
In directory login1.linux.duke.edu:/tmp/cvs-serv5091/yum

Modified Files:
	sqlitesack.py 
Log Message:

combine the selects into a single statement.


Index: sqlitesack.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/sqlitesack.py,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- sqlitesack.py	24 Feb 2007 08:05:46 -0000	1.63
+++ sqlitesack.py	26 Feb 2007 06:35:13 -0000	1.64
@@ -339,21 +339,17 @@
             return results
 
 
-        # FIXME - combine these two lookups
         # If it is a filename, search the primary.xml file info
         for (rep,cache) in self.primarydb.items():
             cur = cache.cursor()
-            executeSQL(cur, "select * from files where name = ?" , (name,))
-            files = cur.fetchall()
-            for res in files:
-                executeSQL(cur, "select * from packages where pkgKey = ?" , (res['pkgKey'],))
-                for x in cur.fetchall():
-                    pkg = self.db2class(x)
-                    if (self.excludes[rep].has_key(pkg.pkgId)):
-                        continue
-                                            
-                    pkg.files = {name: res['type']}
-                    results.append(self.pc(rep,pkg))
+            executeSQL(cur, "select packages.* from files,packages where files.name = ? and files.pkgKey = packages.pkgKey" , (name,))
+            for x in cur.fetchall():
+                pkg = self.db2class(x)
+                if (self.excludes[rep].has_key(pkg.pkgId)):
+                    continue
+                                        
+                #pkg.files = {name: res['type']}
+                results.append(self.pc(rep,pkg))
 
         matched = 0
         globs = ['.*bin\/.*', '^\/etc\/.*', '^\/usr\/lib\/sendmail$']




More information about the Yum-cvs-commits mailing list