summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-08-07 22:33:41 +0000
committerZac Medico <zmedico@gentoo.org>2006-08-07 22:33:41 +0000
commit8ddf20cb214f75dbf4a5ee54624276a3636c4d14 (patch)
tree906efbc5440a71280136f35cd0dedef53ffd9a2f
parent898d16b8531408ee8efee21494cc53fd097aa684 (diff)
downloadportage-8ddf20cb214f75dbf4a5ee54624276a3636c4d14.tar.gz
portage-8ddf20cb214f75dbf4a5ee54624276a3636c4d14.tar.bz2
portage-8ddf20cb214f75dbf4a5ee54624276a3636c4d14.zip
When performing expansion of USE_EXPAND variables, display warnings about invalid use of incremental operators.
svn path=/main/trunk/; revision=4187
-rw-r--r--pym/portage.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 2c5841ef6..eac43287d 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -1509,12 +1509,19 @@ class config:
for var in use_expand:
var_lower = var.lower()
for x in self.get(var, "").split():
+ # Any incremental USE_EXPAND variables have already been
+ # processed, so leading +/- operators are invalid here.
if x[0] == "+":
+ writemsg(colorize("BAD", "Invalid '+' operator in " + \
+ "non-incremental variable '%s': '%s'\n" % (var, x)),
+ noiselevel=-1)
x = x[1:]
if x[0] == "-":
- mystr = "-" + var_lower + "_" + x[1:]
- else:
- mystr = var_lower + "_" + x
+ writemsg(colorize("BAD", "Invalid '-' operator in " + \
+ "non-incremental variable '%s': '%s'\n" % (var, x)),
+ noiselevel=-1)
+ continue
+ mystr = var_lower + "_" + x
if mystr not in use_expand_protected:
use_expand_protected.append(mystr)