diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2008-07-09 21:49:33 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2008-07-09 21:49:33 +0200 |
commit | 09f790063e70515fbcb828676f639740b1c67885 (patch) | |
tree | 32ba2166c2d786ff969dddf4bfcd8b7882a96ec5 /portato/backend | |
parent | 9eb714ea374b04cc8beed223106f1c9615accc60 (diff) | |
download | portato-09f790063e70515fbcb828676f639740b1c67885.tar.gz portato-09f790063e70515fbcb828676f639740b1c67885.tar.bz2 portato-09f790063e70515fbcb828676f639740b1c67885.zip |
Make update_world set compatible
Diffstat (limited to '')
-rw-r--r-- | portato/backend/portage/system.py | 14 | ||||
-rw-r--r-- | portato/backend/portage/system_22.py | 7 |
2 files changed, 14 insertions, 7 deletions
diff --git a/portato/backend/portage/system.py b/portato/backend/portage/system.py index 229bcc9..246f20c 100644 --- a/portato/backend/portage/system.py +++ b/portato/backend/portage/system.py @@ -20,6 +20,7 @@ except ImportError: import portage_dep from collections import defaultdict +import itertools as itt from . import VERSION from .package import PortagePackage @@ -45,8 +46,11 @@ class PortageSystem (SystemInterface): def has_set_support (self): return False - def get_sets (self): - return (("world", "The world set."), ("system", "The system set.")) + def get_sets (self, description = False): + if description: + return (("world", "The world set."), ("system", "The system set.")) + else: + return ("world", "system") def get_version (self): return "Portage %s" % portage.VERSION @@ -342,9 +346,9 @@ class PortageSystem (SystemInterface): packages = [x for x in packages if x is not None and not x.is_installed()] return packages - def update_world (self, newuse = False, deep = False): - packages = self.find_packages(pkgSet="world", with_version = False) - packages.extend(self.find_packages(pkgSet = "system", with_version = False)) + def update_world (self, sets = ("world", "system"), newuse = False, deep = False): + packages = set() + map(packages.add, itt.chain(*(self.find_packages(pkgSet = s, with_version = False) for s in sets))) states = [(["RDEPEND", "PDEPEND"], True)] if self.with_bdeps(): diff --git a/portato/backend/portage/system_22.py b/portato/backend/portage/system_22.py index 88d968b..289849c 100644 --- a/portato/backend/portage/system_22.py +++ b/portato/backend/portage/system_22.py @@ -33,8 +33,11 @@ class PortageSystem_22 (PortageSystem): def has_set_support (self): return True - def get_sets (self): - return ((name, set.description) for name, set in self.settings.setsconfig.getSets().iteritems()) + 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 new_package (self, cpv): return PortagePackage_22(cpv) |