[packagekit] [PATCH 1/5] conary: fix search-name

Jesse Zhang zh.jesse at gmail.com
Sat Jan 29 03:59:41 PST 2011


search-name is now provided the values argument in a list instead of a str.
---
 backends/conary/XMLCache.py |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/backends/conary/XMLCache.py b/backends/conary/XMLCache.py
index 2b18030..52af14a 100644
--- a/backends/conary/XMLCache.py
+++ b/backends/conary/XMLCache.py
@@ -119,12 +119,16 @@ class XMLRepo:
                 r.append(pkg)
         return r
 
-    def _searchNamePackage(self, name):
+    def _searchNamePackage(self, searchlist):
+        '''Search in package name
+        '''
         doc = self._open()
         results = []
         for package in doc.findall("Package"):
-            if name.lower() in str(package.find("name").text).lower():
-                results.append(self._generatePackage(package))
+            for s in searchlist:
+                if s.lower() in str(package.find("name").text).lower():
+                    results.append(self._generatePackage(package))
+                    break
         return results
 
     def _searchGroupPackage(self, name):
-- 
1.7.3.4




More information about the PackageKit mailing list