From 13a04cf5e6f0acd61285129a79793bf6c8acfbbb Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 26 May 2007 21:17:58 +0000 Subject: [PATCH] Fix logic for USE_EXPAND variables that are incremental (there are none currently). (trunk r6635) svn path=/main/branches/2.1.2/; revision=6636 --- pym/portage.py | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/pym/portage.py b/pym/portage.py index 676eee148..03733fa91 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -1894,23 +1894,31 @@ class config: for var in cur_use_expand: var_lower = var.lower() - if var not in myincrementals: + is_not_incremental = var not in myincrementals + if is_not_incremental: prefix = var_lower + "_" for x in list(myflags): if x.startswith(prefix): myflags.remove(x) for x in curdb[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) + if is_not_incremental: + writemsg(colorize("BAD", "Invalid '+' " + \ + "operator in non-incremental variable " + \ + "'%s': '%s'\n" % (var, x)), noiselevel=-1) + continue + else: + writemsg(colorize("BAD", "Invalid '+' " + \ + "operator in incremental variable " + \ + "'%s': '%s'\n" % (var, x)), noiselevel=-1) x = x[1:] if x[0] == "-": - writemsg(colorize("BAD", "Invalid '-' operator in " + \ - "non-incremental variable '%s': '%s'\n" % (var, x)), - noiselevel=-1) + if is_not_incremental: + writemsg(colorize("BAD", "Invalid '-' " + \ + "operator in non-incremental variable " + \ + "'%s': '%s'\n" % (var, x)), noiselevel=-1) + continue + myflags.discard(var_lower + "_" + x[1:]) continue myflags.add(var_lower + "_" + x) -- 2.26.2