Add _emerge.Package.iuse.get_missing_iuse to return missing IUSE flags. Restore origi...
authorSebastian Luther <SebastianLuther@gmx.de>
Tue, 25 May 2010 11:30:15 +0000 (13:30 +0200)
committerZac Medico <zmedico@gentoo.org>
Tue, 25 May 2010 11:43:46 +0000 (04:43 -0700)
pym/_emerge/Package.py
pym/_emerge/depgraph.py

index 0eba4b65a1b9506e4bfe4eab6a6855ef9dcab873..963bfd9f0ac94b2b08fd14d997f4fe56ae3727a1 100644 (file)
@@ -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:
index ec3da77d76f4c3aa404bc7e1a7c252fa7e67a1b7..1c69076690a77911c77fa7b42503ed5b73e0832d 100644 (file)
@@ -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.