[yum-cvs] yum/yum __init__.py,1.289,1.290

James Bowes jbowes at linux.duke.edu
Wed Feb 28 15:13:54 UTC 2007


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

Modified Files:
	__init__.py 
Log Message:
During yum search, only output the package name, ver, etc once per match


Index: __init__.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/__init__.py,v
retrieving revision 1.289
retrieving revision 1.290
diff -u -r1.289 -r1.290
--- __init__.py	27 Feb 2007 05:32:11 -0000	1.289
+++ __init__.py	28 Feb 2007 15:13:52 -0000	1.290
@@ -1164,24 +1164,24 @@
                 narrowed_list.extend(sack.searchPrimaryFields(sql_fields, s))
                 
             for po in narrowed_list:
+                tmpvalues = []
                 for field in fields:
-                    tmpvalues = []
                     value = getattr(po, field)
                     if value and value.find(s) != -1:
                         tmpvalues.append(value)
 
-                    if len(tmpvalues) > 0:
-                        yield (po, tmpvalues)
+                if len(tmpvalues) > 0:
+                    yield (po, tmpvalues)
         
             for po in self.rpmdb:
+                tmpvalues = []
                 for field in fields:
-                    tmpvalues = []
                     value = getattr(po, field)
                     if value and value.find(s) != -1:
                         tmpvalues.append(value)
 
-                    if len(tmpvalues) > 0:
-                        yield (po, tmpvalues)
+                if len(tmpvalues) > 0:
+                    yield (po, tmpvalues)
 
     def searchPackages(self, fields, criteria, callback=None):
         """Search specified fields for matches to criteria




More information about the Yum-cvs-commits mailing list