1 |
Dnia 12 czerwca 2016 09:28:14 CEST, Zac Medico <zmedico@g.o> napisał(a): |
2 |
>On 06/12/2016 12:19 AM, Zac Medico wrote: |
3 |
>> On 05/21/2016 11:56 PM, Michał Górny wrote: |
4 |
>>> diff --git a/pym/portage/package/ebuild/config.py |
5 |
>b/pym/portage/package/ebuild/config.py |
6 |
>>> index 45b7d08..fcc7ce5 100644 |
7 |
>>> --- a/pym/portage/package/ebuild/config.py |
8 |
>>> +++ b/pym/portage/package/ebuild/config.py |
9 |
>>> @@ -1773,6 +1773,16 @@ class config(object): |
10 |
>>> # setcpv triggers lazy instantiation of things like _use_manager. |
11 |
>>> _eapi_cache.clear() |
12 |
>>> |
13 |
>>> + # Prepare the final value of INSTALL_MASK |
14 |
>>> + install_mask = self["INSTALL_MASK"].split() |
15 |
>>> + if 'nodoc' in self.features: |
16 |
>>> + install_mask.append("/usr/share/doc") |
17 |
>>> + if 'noinfo' in self.features: |
18 |
>>> + install_mask.append("/usr/share/info") |
19 |
>>> + if 'noman' in self.features: |
20 |
>>> + install_mask.append("/usr/share/man") |
21 |
>>> + self["INSTALL_MASK"] = ' '.join(install_mask) |
22 |
>>> + |
23 |
>>> def _grab_pkg_env(self, penv, container, protected_keys=None): |
24 |
>>> if protected_keys is None: |
25 |
>>> protected_keys = () |
26 |
>>> |
27 |
>> |
28 |
>> I'm concerned that these values can be appended more than once, |
29 |
>causing |
30 |
>> the variable to contain duplicate values, because setcpv only calls |
31 |
>> reset when the has_changed variable is True. So, we only want to call |
32 |
>> this code when has_changed is True. In fact, this code can go |
33 |
>> immediately after the reset call here: |
34 |
>> |
35 |
>> if has_changed: |
36 |
>> self.reset(keeping_pkg=1) |
37 |
>> |
38 |
> |
39 |
>Actually, it's more tricky than that, because we need to account for |
40 |
>both global FEATURES settings and package.env FEATURES settings, and my |
41 |
>above statements do not account for the global settings. |
42 |
> |
43 |
>Also need to consider the case where these features are enabled |
44 |
>globally, and then *disabled* via package.env! |
45 |
|
46 |
Then maybe we should just ban them and tell people to use INSTALL_MASK directly instead. Their behavior is quite unclear anyway, considering later possible exclusions. |
47 |
|
48 |
|
49 |
-- |
50 |
Best regards, |
51 |
Michał Górny (by phone) |