From 8ddf20cb214f75dbf4a5ee54624276a3636c4d14 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 7 Aug 2006 22:33:41 +0000 Subject: [PATCH] When performing expansion of USE_EXPAND variables, display warnings about invalid use of incremental operators. svn path=/main/trunk/; revision=4187 --- pym/portage.py | 13 ++++++++++--- 1 file 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) -- 2.26.2