Add missing IUSE check in portage.dep._check_required_use()
authorSebastian Luther <SebastianLuther@gmx.de>
Tue, 13 Apr 2010 12:37:49 +0000 (14:37 +0200)
committerZac Medico <zmedico@gentoo.org>
Wed, 11 Aug 2010 01:27:37 +0000 (18:27 -0700)
pym/portage/dep/__init__.py

index 9a3667136f69af8cc834fd21f9915f5b8dcb985f..a2dbbe9d0bf09ff4d1e9eec63e04a26d3e8083d8 100644 (file)
@@ -1493,8 +1493,20 @@ def _check_required_use(constraints, use, iuse):
                                unsat.append([constraint, constraints[id+1]])
                else:
                        #a simple use flag i.e. A or !A
-                       if (constraint[0] == "!" and constraint[1:] not in use) or \
-                               (constraint[0] != "!" and constraint in use):
+                       if constraint[0] == "!":
+                               flag = constraint[1:]
+                               not_operator = True
+                       else:
+                               flag = constraint
+                               not_operator = False
+
+                       if not flag in iuse:
+                               raise portage.exception.InvalidRequiredUseString(
+                                       ("check_required_use(): '%s' contains the use flag '%s', which" + \
+                                       " is not in IUSE") % (constraints, flag))
+                                       
+                       if (not_operator and flag not in use) or \
+                               (not not_operator and constraint in use):
                                sat.append([constraint])
                        else:
                                unsat.append([constraint])