diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-05-25 19:15:20 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-05-25 19:15:20 +0000 |
commit | aa91534ed6e2ba85cd91993f3f4855c6b5df3976 (patch) | |
tree | fb86cfd42cd47656ea3ff6748dfa5cb68c90b0e5 /pym/portage.py | |
parent | bcf23f7e36ccbd6ba6274b152c1de1ee2485078c (diff) | |
download | portage-aa91534ed6e2ba85cd91993f3f4855c6b5df3976.tar.gz portage-aa91534ed6e2ba85cd91993f3f4855c6b5df3976.tar.bz2 portage-aa91534ed6e2ba85cd91993f3f4855c6b5df3976.zip |
For bug #179766, expand USE_EXPAND variables inside the USE incremental loop so that USE"-*" will not always destroy them. (trunk r6623)
svn path=/main/branches/2.1.2/; revision=6624
Diffstat (limited to 'pym/portage.py')
-rw-r--r-- | pym/portage.py | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/pym/portage.py b/pym/portage.py index 8fda7ba13..d6c6a0b82 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -1860,26 +1860,7 @@ class config: else: self.configdict["auto"]["USE"] = "" - use_expand_protected = [] use_expand = self.get("USE_EXPAND", "").split() - 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] == "-": - 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) if not self.uvlist: for x in self["USE_ORDER"].split(":"): @@ -1887,11 +1868,12 @@ class config: self.uvlist.append(self.configdict[x]) self.uvlist.reverse() - myflags = use_expand_protected[:] + myflags = [] for curdb in self.uvlist: - if "USE" not in curdb: + cur_use_expand = [x for x in use_expand if x in curdb] + mysplit = curdb.get("USE", "").split() + if not mysplit and not cur_use_expand: continue - mysplit = curdb["USE"].split() for x in mysplit: if x == "-*": myflags = [] @@ -1911,8 +1893,27 @@ class config: pass continue - if x not in myflags: - myflags.append(x) + myflags.append(x) + + for var in cur_use_expand: + var_lower = var.lower() + if var not in myincrementals: + prefix = var_lower + "_" + myflags = [x for x in myflags if not x.startswith(prefix)] + 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) + x = x[1:] + if x[0] == "-": + writemsg(colorize("BAD", "Invalid '-' operator in " + \ + "non-incremental variable '%s': '%s'\n" % (var, x)), + noiselevel=-1) + continue + myflags.append(var_lower + "_" + x) myflags = set(myflags) myflags.update(self.useforce) |