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: Thu, 15 Mar 2018 19:22:27
Message-Id: 20180315192212.13454-2-mgorny@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH 0/3] INSTALL_MASK refurbishing resubmit 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 7643af7b5..6a5c2ea05 100755
10 --- a/bin/misc-functions.sh
11 +++ b/bin/misc-functions.sh
12 @@ -375,20 +375,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 3dc64a067..3f575fcaf 100644
35 --- a/pym/portage/package/ebuild/config.py
36 +++ b/pym/portage/package/ebuild/config.py
37 @@ -2465,6 +2465,16 @@ class config(object):
38 myflags.difference_update(self.usemask)
39 self.configlist[-1]["USE"]= " ".join(sorted(myflags))
40
41 + # Prepare the final value of INSTALL_MASK
42 + install_mask = self.get("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 if self.mycpv is None:
52 # Generate global USE_EXPAND variables settings that are
53 # consistent with USE, for display by emerge --info. For
54 --
55 2.16.2