From: Sebastian Luther Date: Tue, 25 May 2010 11:30:15 +0000 (+0200) Subject: Add _emerge.Package.iuse.get_missing_iuse to return missing IUSE flags. Restore origi... X-Git-Tag: v2.2_rc68~574 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4669853d73ee647a1e44a96d04f74b92e480a6ef;p=portage.git Add _emerge.Package.iuse.get_missing_iuse to return missing IUSE flags. Restore original behavior of is_valid_flag. --- diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py index 0eba4b65a..963bfd9f0 100644 --- a/pym/_emerge/Package.py +++ b/pym/_emerge/Package.py @@ -215,6 +215,19 @@ class Package(Task): if isinstance(flags, basestring): flags = [flags] missing_iuse = [] + 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_missing_iuse(self, flags): + """ + @returns: A list of flags missing from IUSE. + """ + if isinstance(flags, basestring): + flags = [flags] + missing_iuse = [] for flag in flags: if not flag in self.all and \ self._iuse_implicit_regex.match(flag) is None: diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index ec3da77d7..1c6907669 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -2245,7 +2245,7 @@ class depgraph(object): missing_iuse_reasons = [] for pkg in missing_use: use = pkg.use.enabled - missing_iuse = pkg.iuse.is_valid_flag(atom.use.required) + missing_iuse = pkg.iuse.get_missing_iuse(atom.use.required) mreasons = [] if missing_iuse: mreasons.append("Missing IUSE: %s" % " ".join(missing_iuse)) @@ -2618,7 +2618,7 @@ class depgraph(object): found_available_arg = True if atom.use: - missing_iuse = pkg.iuse.is_valid_flag(atom.use.required) + missing_iuse = pkg.iuse.get_missing_iuse(atom.use.required) if missing_iuse: # Don't add this to packages_with_invalid_use_config # since IUSE cannot be adjusted by the user.