Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-portage-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-portage-dev] [PATCH 1/3] portage.package.ebuild.config: Move FEATURES=no* handling there
Date: Sun, 22 May 2016 06:56:23
Message-Id: 20160522065604.10593-2-mgorny@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH 0/3] INSTALL_MASK redesign, part I by "Michał Górny"
1 Move the code responsible for adding additional paths to INSTALL_MASK
2 into portage.package.ebuild.config.
3 ---
4 bin/misc-functions.sh | 13 -------------
5 pym/portage/package/ebuild/config.py | 10 ++++++++++
6 2 files changed, 10 insertions(+), 13 deletions(-)
7
8 diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
9 index 58755a1..b42e1d6 100755
10 --- a/bin/misc-functions.sh
11 +++ b/bin/misc-functions.sh
12 @@ -314,20 +314,7 @@ preinst_mask() {
13 # in there in case any tools were built with -pg in CFLAGS.
14 cd "${T}"
15
16 - # remove man pages, info pages, docs if requested
17 - local f
18 - for f in man info doc; do
19 - if has no${f} $FEATURES; then
20 - INSTALL_MASK="${INSTALL_MASK} /usr/share/${f}"
21 - fi
22 - done
23 -
24 install_mask "${ED}" "${INSTALL_MASK}"
25 -
26 - # remove share dir if unnessesary
27 - if has nodoc $FEATURES || has noman $FEATURES || has noinfo $FEATURES; then
28 - rmdir "${ED}usr/share" &> /dev/null
29 - fi
30 }
31
32 preinst_sfperms() {
33 diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
34 index 45b7d08..fcc7ce5 100644
35 --- a/pym/portage/package/ebuild/config.py
36 +++ b/pym/portage/package/ebuild/config.py
37 @@ -1773,6 +1773,16 @@ class config(object):
38 # setcpv triggers lazy instantiation of things like _use_manager.
39 _eapi_cache.clear()
40
41 + # Prepare the final value of INSTALL_MASK
42 + install_mask = self["INSTALL_MASK"].split()
43 + if 'nodoc' in self.features:
44 + install_mask.append("/usr/share/doc")
45 + if 'noinfo' in self.features:
46 + install_mask.append("/usr/share/info")
47 + if 'noman' in self.features:
48 + install_mask.append("/usr/share/man")
49 + self["INSTALL_MASK"] = ' '.join(install_mask)
50 +
51 def _grab_pkg_env(self, penv, container, protected_keys=None):
52 if protected_keys is None:
53 protected_keys = ()
54 --
55 2.8.3

Replies