diff options
Diffstat (limited to 'portato/backend/portage/sets.py')
-rw-r--r-- | portato/backend/portage/sets.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/portato/backend/portage/sets.py b/portato/backend/portage/sets.py index 53025ab..dd8257d 100644 --- a/portato/backend/portage/sets.py +++ b/portato/backend/portage/sets.py @@ -3,7 +3,7 @@ # File: portato/backend/portage/sets.py # This file is part of the Portato-Project, a graphical portage-frontend. # -# Copyright (C) 2008 René 'Necoro' Neumann +# Copyright (C) 2006-2009 René 'Necoro' Neumann # This is free software. You may redistribute copies of it under the terms of # the GNU General Public License version 2. # There is NO WARRANTY, to the extent permitted by law. @@ -52,7 +52,7 @@ class FilterSet (Set): t = set() for pkg in self.get_list(): if is_regexp and key: - if not re.match(key, pkg, re.I): continue + if not re.search(key, pkg, re.I): continue if not with_version: t.add(portage.dep.dep_getkey(pkg)) @@ -63,12 +63,11 @@ class FilterSet (Set): class PortageSet (FilterSet): def __init__ (self, name): - FilterSet.__init__(self) debug("Loading portage set '%s'", name) - self.portageSet = system.settings.setsconfig.getSets()[name] + self.name = name def get_list(self): - return itt.imap(str, self.portageSet.getAtoms()) + return itt.imap(str, system.settings.setsconfig.getSetAtoms(self.name)) class SystemSet (FilterSet): @@ -86,6 +85,9 @@ class WorldSet (FilterSet): yield cp class InstalledSet (Set): + """For the moment do not use the portage-2.2 @installed set. + It only contains the current slot-cps - and to get the cpvs + via the PortageSet results in an infinite recursion :(.""" def get_pkgs (self, key, is_regexp, masked, with_version, only_cpv): if is_regexp: @@ -95,7 +97,7 @@ class InstalledSet (Set): t = system.settings.vartree.dbapi.cp_all() if key: - t = filter(lambda x: re.match(key, x, re.I), t) + t = filter(lambda x: re.search(key, x, re.I), t) return set(t) else: @@ -111,7 +113,7 @@ class TreeSet (Set): t = system.settings.porttree.dbapi.cp_all() if key: - t = filter(lambda x: re.match(key, x, re.I), t) + t = filter(lambda x: re.search(key, x, re.I), t) elif masked: t = system.settings.porttree.dbapi.xmatch("match-all", key) |