[packagekit] [PATCH 2/5] conary: fix search-group
Jesse Zhang
zh.jesse at gmail.com
Sat Jan 29 03:59:42 PST 2011
search-group is now provided the values argument in a list.
---
backends/conary/XMLCache.py | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/backends/conary/XMLCache.py b/backends/conary/XMLCache.py
index 52af14a..25a4060 100644
--- a/backends/conary/XMLCache.py
+++ b/backends/conary/XMLCache.py
@@ -131,16 +131,21 @@ class XMLRepo:
break
return results
- def _searchGroupPackage(self, name):
+ def _searchGroupPackage(self, searchlist):
+ '''Search in package category
+ '''
doc = self._open()
- results_group = []
+ results = []
for package in doc.findall("Package"):
- pkg = self._generatePackage(package)
- if pkg.has_key("category"):
- group = getGroup(pkg["category"])
- if name.lower() == group:
- results_group.append(pkg)
- return results_group
+ category = package.findall("category")
+ if not category:
+ continue
+ for s in searchlist:
+ if s.lower() in mapGroup([c.text for c in category]):
+ results.append(self._generatePackage(package))
+ break
+
+ return results
def _searchDetailsPackage(self, name):
--
1.7.3.4
More information about the PackageKit
mailing list