diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2008-07-09 23:24:18 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2008-07-09 23:24:18 +0200 |
commit | b166a860bc1d645208b6ecab5270b64fca34188b (patch) | |
tree | bed4d3025498d668f88fdb5ab07949f9b3890e27 /portato/backend/portage/system_22.py | |
parent | 107c4cc0c8f0039224505d29707ccc7eda4f5afb (diff) | |
parent | c592c0a400099e442508ec09284e188d03fb5444 (diff) | |
download | portato-b166a860bc1d645208b6ecab5270b64fca34188b.tar.gz portato-b166a860bc1d645208b6ecab5270b64fca34188b.tar.bz2 portato-b166a860bc1d645208b6ecab5270b64fca34188b.zip |
Merged in the portage-2.2 branch
Diffstat (limited to 'portato/backend/portage/system_22.py')
-rw-r--r-- | portato/backend/portage/system_22.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/portato/backend/portage/system_22.py b/portato/backend/portage/system_22.py index be27186..18e3b4e 100644 --- a/portato/backend/portage/system_22.py +++ b/portato/backend/portage/system_22.py @@ -20,6 +20,7 @@ from collections import defaultdict from .package_22 import PortagePackage_22 from .settings_22 import PortageSettings_22 from .system import PortageSystem +from . import sets as syssets class PortageSystem_22 (PortageSystem): @@ -30,5 +31,31 @@ class PortageSystem_22 (PortageSystem): self.use_descs = {} 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 + } + + def has_set_support (self): + return True + + def get_sets (self, description = False): + if description: + return ((name, set.description) for name, set in self.settings.setsconfig.getSets().iteritems()) + else: + return tuple(self.settings.setsconfig.getSets()) + + def _get_set (self, pkgSet): + pkgSet = pkgSet.lower() + if pkgSet == "": pkgSet = self.SET_ALL + + s = self.setmap.get(pkgSet, None) + if s is None: + return syssets.PortageSet(pkgSet) + else: + return s() + def new_package (self, cpv): return PortagePackage_22(cpv) |