diff options
author | 2010-08-05 19:35:37 -0700 | |
---|---|---|
committer | 2010-08-05 19:35:37 -0700 | |
commit | 7c38e75dd8460f7a1ddafce7bd9d3f9a87d0c4e9 (patch) | |
tree | 3230b691608359a0cd52dfbf8770ba80e7e57dad | |
parent | Bug #331271 - Fix USE_EXPAND wildcards so that the USE="linguas_en_US (diff) | |
download | portage-multirepo-7c38e75dd8460f7a1ddafce7bd9d3f9a87d0c4e9.tar.gz portage-multirepo-7c38e75dd8460f7a1ddafce7bd9d3f9a87d0c4e9.tar.bz2 portage-multirepo-7c38e75dd8460f7a1ddafce7bd9d3f9a87d0c4e9.zip |
Bug #331271 - Fix USE_EXPAND wildcards so that the USE="linguas_*
-linguas_en_US" case is handled correctly.
-rw-r--r-- | pym/portage/package/ebuild/config.py | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py index bfff1cc4..ba3e91c9 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() |