summaryrefslogtreecommitdiff
path: root/portato/backend
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--portato/backend/portage/sets.py8
-rw-r--r--portato/backend/portage/system_22.py15
2 files changed, 13 insertions, 10 deletions
diff --git a/portato/backend/portage/sets.py b/portato/backend/portage/sets.py
index 53025ab..d8ea832 100644
--- a/portato/backend/portage/sets.py
+++ b/portato/backend/portage/sets.py
@@ -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:
diff --git a/portato/backend/portage/system_22.py b/portato/backend/portage/system_22.py
index 8ce3cd9..7e0198c 100644
--- a/portato/backend/portage/system_22.py
+++ b/portato/backend/portage/system_22.py
@@ -32,10 +32,10 @@ class PortageSystem_22 (PortageSystem):
self.local_use_descs = defaultdict(dict)
self.setmap = {
- self.SET_ALL : syssets.AllSet,
- self.SET_INSTALLED : syssets.InstalledSet,
- self.SET_UNINSTALLED : syssets.UninstalledSet,
- self.SET_TREE : syssets.TreeSet
+ self.SET_ALL : syssets.AllSet(),
+ self.SET_INSTALLED : syssets.InstalledSet(),
+ self.SET_UNINSTALLED : syssets.UninstalledSet(),
+ self.SET_TREE : syssets.TreeSet()
}
def get_update_option (self):
@@ -56,9 +56,10 @@ class PortageSystem_22 (PortageSystem):
s = self.setmap.get(pkgSet, None)
if s is None:
- return syssets.PortageSet(pkgSet)
- else:
- return s()
+ s = syssets.PortageSet(pkgSet)
+ self.setmap[pkgSet] = s
+
+ return s
def new_package (self, cpv):
return PortagePackage_22(cpv)