[yum-git] cli.py yum/__init__.py

James Antill james at linux.duke.edu
Tue Feb 5 00:12:02 UTC 2008


 cli.py          |    2 +-
 yum/__init__.py |    6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 42f9f70f16e0d8cddf2f90945a461987513cb47e
Author: James Antill <james at and.org>
Date:   Mon Feb 4 19:11:23 2008 -0500

    Fix pirut search box problem, due to minor API breakage

diff --git a/cli.py b/cli.py
index e67ed22..f8f7bcf 100644
--- a/cli.py
+++ b/cli.py
@@ -674,7 +674,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
         # display the list of matches
             
         searchlist = ['name', 'summary', 'description', 'url']
-        matching = self.searchGenerator(searchlist, args)
+        matching = self.searchGenerator(searchlist, args, showdups=False)
         
         total = 0
         for (po, matched_value) in matching:
diff --git a/yum/__init__.py b/yum/__init__.py
index aa6d55e..b63d088 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -1428,7 +1428,8 @@ class YumBase(depsolve.Depsolve):
         
         return results
     
-    def searchGenerator(self, fields, criteria):
+    # pre 3.2.10 API used to always showdups, so that's the default atm.
+    def searchGenerator(self, fields, criteria, showdups=True):
         """Generator method to lighten memory load for some searches.
            This is the preferred search function to use."""
         sql_fields = []
@@ -1499,7 +1500,8 @@ class YumBase(depsolve.Depsolve):
             for (po, matched) in sorted(sorted_lists[val], key=operator.itemgetter(0)):
                 if (po.name, po.arch) not in yielded:
                     yield (po, matched)
-                    yielded[(po.name, po.arch)] = 1
+                    if not showdups:
+                        yielded[(po.name, po.arch)] = 1
 
 
     def searchPackages(self, fields, criteria, callback=None):



More information about the Yum-cvs-commits mailing list