diff options
author | 2010-05-25 13:00:58 +0200 | |
---|---|---|
committer | 2010-05-25 04:43:46 -0700 | |
commit | 124f4789fb81c5671848df4b789bb44e812c8591 (patch) | |
tree | 2119c6c1ca36106db9c5ec0bd119cad68b6f7516 | |
parent | _emerge.depgraph._show_unsatisfied_dep(): properly check if something belongs... (diff) | |
download | portage-idfetch-124f4789fb81c5671848df4b789bb44e812c8591.tar.gz portage-idfetch-124f4789fb81c5671848df4b789bb44e812c8591.tar.bz2 portage-idfetch-124f4789fb81c5671848df4b789bb44e812c8591.zip |
Allow _emerge.Package.iuse.is_valid_flag() to take a list of flags
-rw-r--r-- | pym/_emerge/Package.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py index b7501860..93b86f10 100644 --- a/pym/_emerge/Package.py +++ b/pym/_emerge/Package.py @@ -207,13 +207,18 @@ class Package(Task): self.disabled = frozenset(disabled) self.all = frozenset(chain(enabled, disabled, other)) - def is_valid_flag(self, flag): + def is_valid_flag(self, flags): """ - @returns: True if flag is a valid USE value which may + @returns: True if all flags are valid USE values which may be specified in USE dependencies, False otherwise. """ - return flag in self.all or \ - self._iuse_implicit_regex.match(flag) is not None + if isinstance(flags, basestring): + flags = [flags] + for flag in flags: + if not flag in self.all and \ + self._iuse_implicit_regex.match(flag) is None: + return False + return True def _get_hash_key(self): hash_key = getattr(self, "_hash_key", None) |