Move the code responsible for adding additional paths to INSTALL_MASK
into portage.package.ebuild.config.
---
 bin/misc-functions.sh                | 13 -------------
 pym/portage/package/ebuild/config.py | 10 ++++++++++
 2 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 7643af7b5..6a5c2ea05 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -375,20 +375,7 @@ preinst_mask() {
        # in there in case any tools were built with -pg in CFLAGS.
        cd "${T}"
 
-       # remove man pages, info pages, docs if requested
-       local f
-       for f in man info doc; do
-               if has no${f} $FEATURES; then
-                       INSTALL_MASK="${INSTALL_MASK} /usr/share/${f}"
-               fi
-       done
-
        install_mask "${ED}" "${INSTALL_MASK}"
-
-       # remove share dir if unnessesary
-       if has nodoc $FEATURES || has noman $FEATURES || has noinfo $FEATURES; 
then
-               rmdir "${ED%/}/usr/share" &> /dev/null
-       fi
 }
 
 preinst_sfperms() {
diff --git a/pym/portage/package/ebuild/config.py 
b/pym/portage/package/ebuild/config.py
index 3dc64a067..3f575fcaf 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -2465,6 +2465,16 @@ class config(object):
                myflags.difference_update(self.usemask)
                self.configlist[-1]["USE"]= " ".join(sorted(myflags))
 
+               # Prepare the final value of INSTALL_MASK
+               install_mask = self.get("INSTALL_MASK", '').split()
+               if 'nodoc' in self.features:
+                       install_mask.append("/usr/share/doc")
+               if 'noinfo' in self.features:
+                       install_mask.append("/usr/share/info")
+               if 'noman' in self.features:
+                       install_mask.append("/usr/share/man")
+               self["INSTALL_MASK"] = ' '.join(install_mask)
+
                if self.mycpv is None:
                        # Generate global USE_EXPAND variables settings that are
                        # consistent with USE, for display by emerge --info. For
-- 
2.16.2


Reply via email to