summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-05 19:35:37 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-05 19:35:37 -0700
commit7c38e75dd8460f7a1ddafce7bd9d3f9a87d0c4e9 (patch)
tree3230b691608359a0cd52dfbf8770ba80e7e57dad /pym
parent7d92c18b49fabc98f75ca55c51acd2b849c39f5c (diff)
downloadportage-7c38e75dd8460f7a1ddafce7bd9d3f9a87d0c4e9.tar.gz
portage-7c38e75dd8460f7a1ddafce7bd9d3f9a87d0c4e9.tar.bz2
portage-7c38e75dd8460f7a1ddafce7bd9d3f9a87d0c4e9.zip
Bug #331271 - Fix USE_EXPAND wildcards so that the USE="linguas_*
-linguas_en_US" case is handled correctly.
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/package/ebuild/config.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index bfff1cc44..ba3e91c97 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -2273,6 +2273,9 @@ class config(object):
# For optimal performance, use slice
# comparison instead of startswith().
+ iuse = self.configdict["pkg"].get("IUSE")
+ if iuse is not None:
+ iuse = [x.lstrip("+-") for x in iuse.split()]
myflags = set()
for curdb in self.uvlist:
cur_use_expand = [x for x in use_expand if x in curdb]
@@ -2301,7 +2304,24 @@ class config(object):
myflags.discard(x[1:])
continue
- myflags.add(x)
+ if iuse is not None and x[-2:] == '_*':
+ # Expand wildcards here, so that cases like
+ # USE="linguas_* -linguas_en_US" work correctly.
+ prefix = x[:-1]
+ prefix_len = len(prefix)
+ has_iuse = False
+ for y in iuse:
+ if y[:prefix_len] == prefix:
+ has_iuse = True
+ myflags.add(y)
+ if not has_iuse:
+ # There are no matching IUSE, so allow the
+ # wildcard to pass through. This allows
+ # linguas_* to trigger unset LINGUAS in
+ # cases when no linguas_ flags are in IUSE.
+ myflags.add(x)
+ else:
+ myflags.add(x)
for var in cur_use_expand:
var_lower = var.lower()