Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: bin/, pym/portage/dbapi/
Date: Fri, 30 Mar 2018 02:27:57
Message-Id: 1522362822.cc0349c549b3024615fb8fb5c72c78b9509ee5bb.zmedico@gentoo
1 commit: cc0349c549b3024615fb8fb5c72c78b9509ee5bb
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Thu Mar 29 21:51:13 2018 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Thu Mar 29 22:33:42 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=cc0349c5
7
8 INSTALL_MASK: honor install time config for binary packages (bug 651952)
9
10 For binary packages, honor the INSTALL_MASK configuration that
11 exists at install time, since it might differ from the build time
12 setting.
13
14 Fixes: 3416876c0ee7 ("{,PKG_}INSTALL_MASK: python implementation")
15 Bug: https://bugs.gentoo.org/651952
16
17 bin/misc-functions.sh | 23 +++++++++++++++++++++++
18 bin/phase-functions.sh | 10 +---------
19 pym/portage/dbapi/vartree.py | 5 +++++
20 3 files changed, 29 insertions(+), 9 deletions(-)
21
22 diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
23 index 26f589915..a6330ee93 100755
24 --- a/bin/misc-functions.sh
25 +++ b/bin/misc-functions.sh
26 @@ -323,6 +323,29 @@ postinst_qa_check() {
27 done < <(printf "%s\0" "${qa_checks[@]}" | LC_ALL=C sort -u -z)
28 }
29
30 +preinst_mask() {
31 + # Remove man pages, info pages, docs if requested. This is
32 + # implemented in bash in order to respect INSTALL_MASK settings
33 + # from bashrc.
34 + local f x
35 + for f in man info doc; do
36 + if has no${f} ${FEATURES}; then
37 + INSTALL_MASK+=" /usr/share/${f}"
38 + fi
39 + done
40 +
41 + # Store modified variables in build-info.
42 + cd "${PORTAGE_BUILDDIR}"/build-info || die
43 + set -f
44 +
45 + IFS=$' \t\n\r'
46 + for f in INSTALL_MASK; do
47 + x=$(echo -n ${!f})
48 + [[ -n ${x} ]] && echo "${x}" > "${f}"
49 + done
50 + set +f
51 +}
52 +
53 preinst_sfperms() {
54 if [ -z "${D}" ]; then
55 eerror "${FUNCNAME}: D is unset"
56
57 diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
58 index bdae68f79..3de8d01b5 100644
59 --- a/bin/phase-functions.sh
60 +++ b/bin/phase-functions.sh
61 @@ -661,14 +661,6 @@ __dyn_install() {
62 set -f
63 local f x
64
65 - # remove man pages, info pages, docs if requested
66 - for f in man info doc; do
67 - if has no${f} ${FEATURES} && \
68 - ! has "/usr/share/${f}" ${INSTALL_MASK}; then
69 - INSTALL_MASK+=" /usr/share/${f}"
70 - fi
71 - done
72 -
73 IFS=$' \t\n\r'
74 for f in CATEGORY DEFINED_PHASES FEATURES INHERITED IUSE \
75 PF PKGUSE SLOT KEYWORDS HOMEPAGE DESCRIPTION \
76 @@ -676,7 +668,7 @@ __dyn_install() {
77 CXXFLAGS EXTRA_ECONF EXTRA_EINSTALL EXTRA_MAKE \
78 LDFLAGS LIBCFLAGS LIBCXXFLAGS QA_CONFIGURE_OPTIONS \
79 QA_DESKTOP_FILE QA_PREBUILT PROVIDES_EXCLUDE REQUIRES_EXCLUDE \
80 - INSTALL_MASK PKG_INSTALL_MASK; do
81 + PKG_INSTALL_MASK; do
82
83 x=$(echo -n ${!f})
84 [[ -n $x ]] && echo "$x" > $f
85
86 diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
87 index 378d42dc0..a136c38f1 100644
88 --- a/pym/portage/dbapi/vartree.py
89 +++ b/pym/portage/dbapi/vartree.py
90 @@ -3846,6 +3846,11 @@ class dblink(object):
91 # be useful to avoid collisions in some scenarios.
92 # We cannot detect if this is needed or not here as INSTALL_MASK can be
93 # modified by bashrc files.
94 + phase = MiscFunctionsProcess(background=False,
95 + commands=["preinst_mask"], phase="preinst",
96 + scheduler=self._scheduler, settings=self.settings)
97 + phase.start()
98 + phase.wait()
99 try:
100 with io.open(_unicode_encode(os.path.join(inforoot, "INSTALL_MASK"),
101 encoding=_encodings['fs'], errors='strict'),