Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: Re: [gentoo-portage-dev] [PATCH 1/3] portage.package.ebuild.config: Move FEATURES=no* handling there
Date: Sun, 12 Jun 2016 07:28:22
Message-Id: 575D0F0E.7090700@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [PATCH 1/3] portage.package.ebuild.config: Move FEATURES=no* handling there by Zac Medico
1 On 06/12/2016 12:19 AM, Zac Medico wrote:
2 > On 05/21/2016 11:56 PM, Michał Górny wrote:
3 >> diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
4 >> index 45b7d08..fcc7ce5 100644
5 >> --- a/pym/portage/package/ebuild/config.py
6 >> +++ b/pym/portage/package/ebuild/config.py
7 >> @@ -1773,6 +1773,16 @@ class config(object):
8 >> # setcpv triggers lazy instantiation of things like _use_manager.
9 >> _eapi_cache.clear()
10 >>
11 >> + # Prepare the final value of INSTALL_MASK
12 >> + install_mask = self["INSTALL_MASK"].split()
13 >> + if 'nodoc' in self.features:
14 >> + install_mask.append("/usr/share/doc")
15 >> + if 'noinfo' in self.features:
16 >> + install_mask.append("/usr/share/info")
17 >> + if 'noman' in self.features:
18 >> + install_mask.append("/usr/share/man")
19 >> + self["INSTALL_MASK"] = ' '.join(install_mask)
20 >> +
21 >> def _grab_pkg_env(self, penv, container, protected_keys=None):
22 >> if protected_keys is None:
23 >> protected_keys = ()
24 >>
25 >
26 > I'm concerned that these values can be appended more than once, causing
27 > the variable to contain duplicate values, because setcpv only calls
28 > reset when the has_changed variable is True. So, we only want to call
29 > this code when has_changed is True. In fact, this code can go
30 > immediately after the reset call here:
31 >
32 > if has_changed:
33 > self.reset(keeping_pkg=1)
34 >
35
36 Actually, it's more tricky than that, because we need to account for
37 both global FEATURES settings and package.env FEATURES settings, and my
38 above statements do not account for the global settings.
39
40 Also need to consider the case where these features are enabled
41 globally, and then *disabled* via package.env!
42 --
43 Thanks,
44 Zac

Replies