Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/
Date: Wed, 27 Feb 2013 00:27:58
Message-Id: 1361924860.207554dd7d2796f1fa4da41725154d17048a194d.zmedico@gentoo
1 commit: 207554dd7d2796f1fa4da41725154d17048a194d
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 27 00:27:40 2013 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 27 00:27:40 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=207554dd
7
8 config: unset LINGUAS if appropriate, bug #459350
9
10 ---
11 pym/portage/package/ebuild/config.py | 34 +++++++++++++++++++++++++++++-----
12 1 files changed, 29 insertions(+), 5 deletions(-)
13
14 diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
15 index fb7b741..2ac59f0 100644
16 --- a/pym/portage/package/ebuild/config.py
17 +++ b/pym/portage/package/ebuild/config.py
18 @@ -1183,8 +1183,11 @@ class config(object):
19 the previously calculated USE settings.
20 """
21
22 - def __init__(self, use, usemask, iuse_implicit,
23 + def __init__(self, settings, unfiltered_use,
24 + use, usemask, iuse_implicit,
25 use_expand_split, use_expand_dict):
26 + self._settings = settings
27 + self._unfiltered_use = unfiltered_use
28 self._use = use
29 self._usemask = usemask
30 self._iuse_implicit = iuse_implicit
31 @@ -1239,13 +1242,32 @@ class config(object):
32 # Don't export empty USE_EXPAND vars unless the user config
33 # exports them as empty. This is required for vars such as
34 # LINGUAS, where unset and empty have different meanings.
35 + # The special '*' token is understood by ebuild.sh, which
36 + # will unset the variable so that things like LINGUAS work
37 + # properly (see bug #459350).
38 if has_wildcard:
39 - # ebuild.sh will see this and unset the variable so
40 - # that things like LINGUAS work properly
41 value = '*'
42 else:
43 if has_iuse:
44 - value = ''
45 + already_set = False
46 + # Skip the first 'env' configdict, in order to
47 + # avoid infinite recursion here, since that dict's
48 + # __getitem__ calls the current __getitem__.
49 + for d in self._settings.lookuplist[1:]:
50 + if key in d:
51 + already_set = True
52 + break
53 +
54 + if not already_set:
55 + for x in self._unfiltered_use:
56 + if x[:prefix_len] == prefix:
57 + already_set = True
58 + break
59 +
60 + if already_set:
61 + value = ''
62 + else:
63 + value = '*'
64 else:
65 # It's not in IUSE, so just allow the variable content
66 # to pass through if it is defined somewhere. This
67 @@ -1501,6 +1523,7 @@ class config(object):
68 # be done for every setcpv() call since practically every
69 # package has different IUSE.
70 use = set(self["USE"].split())
71 + unfiltered_use = frozenset(use)
72 if explicit_iuse is None:
73 explicit_iuse = frozenset(x.lstrip("+-") for x in iuse.split())
74
75 @@ -1585,7 +1608,8 @@ class config(object):
76 # comparison instead of startswith().
77 use_expand_split = set(x.lower() for \
78 x in self.get('USE_EXPAND', '').split())
79 - lazy_use_expand = self._lazy_use_expand(use, self.usemask,
80 + lazy_use_expand = self._lazy_use_expand(
81 + self, unfiltered_use, use, self.usemask,
82 portage_iuse, use_expand_split, self._use_expand_dict)
83
84 use_expand_iuses = {}