summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-07-10 23:08:40 +0000
committerZac Medico <zmedico@gentoo.org>2007-07-10 23:08:40 +0000
commit328c229156fabe3e3b9e20b27d6dabdd46c17d3a (patch)
tree24a68e3da2afae61f4de9feee9eec268eecd7d78
parent178a0f08155ba34e1050f78b6bf6aaac37bfb9b9 (diff)
downloadportage-328c229156fabe3e3b9e20b27d6dabdd46c17d3a.tar.gz
portage-328c229156fabe3e3b9e20b27d6dabdd46c17d3a.tar.bz2
portage-328c229156fabe3e3b9e20b27d6dabdd46c17d3a.zip
For bug #184843, allow USE_EXPAND variables to pass through if none of their flags are in IUSE. This allows packages that support LINGUAS but don't declare it in IUSE to use the variable outside of the USE_EXPAND context.
svn path=/main/trunk/; revision=7218
-rw-r--r--pym/portage/__init__.py59
1 files changed, 37 insertions, 22 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index b91f64086..da9f499ab 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -2075,34 +2075,49 @@ class config(object):
# like LINGUAS.
var_split = [ x for x in var_split if x in expand_flags ]
var_split.extend(expand_flags.difference(var_split))
- if (var_split or var in self) and \
- "*" not in var_split:
+ has_wildcard = "*" in var_split
+ if has_wildcard:
+ var_split = [ x for x in var_split if x != "*" ]
+ has_iuse = False
+ for x in iuse:
+ if x.startswith(prefix):
+ has_iuse = True
+ break
+ if has_wildcard:
+ # * means to enable everything in IUSE that's not masked
+ if has_iuse:
+ for x in iuse:
+ if x.startswith(prefix) and x not in self.usemask:
+ suffix = x[prefix_len:]
+ if suffix in var_split:
+ continue
+ var_split.append(suffix)
+ usesplit.append(x)
+ else:
+ # If there is a wildcard and no matching flags in IUSE then
+ # LINGUAS should be unset so that all .mo files are
+ # installed.
+ var_split = []
+ if var_split:
+ self[var] = " ".join(var_split)
+ else:
# Don't export empty USE_EXPAND vars unless the user config
# exports them as empty. This is required for vars such as
# LINGUAS, where unset and empty have different meanings.
- self[var] = " ".join(var_split)
- elif "*" in var_split:
- # * means to enable everything in IUSE that's not masked
- filtered_split = []
- for x in var_split:
- if x == "*":
- continue
- if (prefix + x) in iuse:
- filtered_split.append(x)
- var_split = filtered_split
- for x in iuse:
- if x.startswith(prefix) and x not in self.usemask:
- suffix = x[prefix_len:]
- if suffix in var_split:
- continue
- var_split.append(suffix)
- usesplit.append(x)
- if var_split:
- self[var] = " ".join(var_split)
- elif var in self:
+ if has_wildcard:
# ebuild.sh will see this and unset the variable so
# that things like LINGUAS work properly
self[var] = "*"
+ else:
+ if has_iuse:
+ self[var] = ""
+ else:
+ # It's not in IUSE, so just allow the variable content
+ # to pass through if it is defined somewhere. This
+ # allows packages that support LINGUAS but don't
+ # declare it in IUSE to use the variable outside of the
+ # USE_EXPAND context.
+ pass
# Pre-Pend ARCH variable to USE settings so '-*' in env doesn't kill arch.
if self.configdict["defaults"].has_key("ARCH"):