Hi,
 The attached patch looks like it fixes it and makes the results output
MUCH faster when you search for common things like 'devel'.

-sv

diff --git a/yum/__init__.py b/yum/__init__.py
index 8489562..0b92a47 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -1370,7 +1370,7 @@ class YumBase(depsolve.Depsolve):
         
         for s in criteria:
             narrowed_list = []
-            my_sets[s] = []
+            my_sets[s] = {}
             if s.find('%') != -1:
                 continue
             
@@ -1386,7 +1386,7 @@ class YumBase(depsolve.Depsolve):
 
                 if len(tmpvalues) > 0:
                     matched_values[po] = tmpvalues
-                    my_sets[s].append(po)
+                    my_sets[s][(po.name, po.arch)] = po
                     
             for po in self.rpmdb:
                 tmpvalues = []
@@ -1397,15 +1397,19 @@ class YumBase(depsolve.Depsolve):
 
                 if len(tmpvalues) > 0:
                     matched_values[po] = tmpvalues
-                    my_sets[s].append(po)
-        
+                    my_sets[s][(po.name, po.arch)] = po
+                    #my_sets[s].append(po)
+                    
+            # close our rpmdb connection so we can ctrl-c, kthxbai                    
+            self.closeRpmDB()
+            
         for pkg in matched_values:
             if scores.has_key(pkg):
                 continue
             count = 0
             
             for this_set in my_sets.itervalues():
-                if pkg in this_set:
+                if this_set.has_key((pkg.name, pkg.arch)):
                     count += 1
             
             scores[pkg] = count
_______________________________________________
Yum-devel mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel

Reply via email to