check_required_use: improve missing IUSE error
authorZac Medico <zmedico@gentoo.org>
Sat, 19 Feb 2011 22:53:45 +0000 (14:53 -0800)
committerZac Medico <zmedico@gentoo.org>
Sun, 20 Feb 2011 00:03:24 +0000 (16:03 -0800)
This will fix bug #355629.

pym/portage/dep/__init__.py

index a8d05f1f72d3f9ebed1186ac5326c7ee01ca2cd7..a92b481d1e4308e0c958486141e9fdfffb90282c 100644 (file)
@@ -2145,8 +2145,10 @@ def check_required_use(required_use, use, iuse_match):
                        is_negated = False
 
                if not flag or not iuse_match(flag):
-                       raise InvalidDependString(
-                               _("malformed syntax: '%s'") % required_use)
+                       msg = _("USE flag '%s' is not in IUSE") \
+                               % (flag,)
+                       e = InvalidData(msg, category='IUSE.missing')
+                       raise InvalidDependString(msg, errors=(e,))
 
                return (flag in use and not is_negated) or \
                        (flag not in use and is_negated)