summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Luther <SebastianLuther@gmx.de>2010-04-13 14:37:49 +0200
committerZac Medico <zmedico@gentoo.org>2010-08-10 18:27:37 -0700
commitc4d225f0bdedd7be72a5b6b2f10345773233cead (patch)
tree2d73e991151d18c01e68cd25db122b39098f0012
parent3230e79815b43fc1c36f46a2b75a2567bfe9efa9 (diff)
downloadportage-c4d225f0bdedd7be72a5b6b2f10345773233cead.tar.gz
portage-c4d225f0bdedd7be72a5b6b2f10345773233cead.tar.bz2
portage-c4d225f0bdedd7be72a5b6b2f10345773233cead.zip
Add missing IUSE check in portage.dep._check_required_use()
-rw-r--r--pym/portage/dep/__init__.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index 9a3667136..a2dbbe9d0 100644
--- a/pym/portage/dep/__init__.py
+++ b/pym/portage/dep/__init__.py
@@ -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])