Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: "Michał Górny" <mgorny@g.o>, gentoo-portage-dev@l.g.o
Cc: Zac Medico <zmedico@g.o>
Subject: Re: [gentoo-portage-dev] [PATCH] INSTALL_MASK: honor install time config for binary packages (bug 651952)
Date: Sun, 01 Apr 2018 16:06:37
Message-Id: a83527b1-2b34-a9ae-dc3b-6aa8705a502a@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [PATCH] INSTALL_MASK: honor install time config for binary packages (bug 651952) by "Michał Górny"
1 On 04/01/2018 06:54 AM, Michał Górny wrote:
2 > W dniu czw, 29.03.2018 o godzinie 15∶34 -0700, użytkownik Zac Medico
3 > napisał:
4 >> For binary packages, honor the INSTALL_MASK configuration that
5 >> exists at install time, since it might differ from the build time
6 >> setting.
7 >>
8 >> Fixes: 3416876c0ee7 ("{,PKG_}INSTALL_MASK: python implementation")
9 >> Bug: https://bugs.gentoo.org/651952
10 >> ---
11 >> bin/misc-functions.sh | 23 +++++++++++++++++++++++
12 >> bin/phase-functions.sh | 10 +---------
13 >> pym/portage/dbapi/vartree.py | 5 +++++
14 >> 3 files changed, 29 insertions(+), 9 deletions(-)
15 >>
16 >> diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
17 >> index 26f589915..a6330ee93 100755
18 >> --- a/bin/misc-functions.sh
19 >> +++ b/bin/misc-functions.sh
20 >> @@ -323,6 +323,29 @@ postinst_qa_check() {
21 >> done < <(printf "%s\0" "${qa_checks[@]}" | LC_ALL=C sort -u -z)
22 >> }
23 >>
24 >> +preinst_mask() {
25 >> + # Remove man pages, info pages, docs if requested. This is
26 >> + # implemented in bash in order to respect INSTALL_MASK settings
27 >> + # from bashrc.
28 >> + local f x
29 >> + for f in man info doc; do
30 >> + if has no${f} ${FEATURES}; then
31 >> + INSTALL_MASK+=" /usr/share/${f}"
32 >> + fi
33 >> + done
34 >> +
35 >> + # Store modified variables in build-info.
36 >> + cd "${PORTAGE_BUILDDIR}"/build-info || die
37 >> + set -f
38 >> +
39 >> + IFS=$' \t\n\r'
40 >> + for f in INSTALL_MASK; do
41 >
42 > This loop along with the whole indirection is entirely pointless, given
43 > that you're processing exactly one variable.
44
45 I did this for consistency with the related loop in dyn_install, since
46 we might save values of other variables from the binary package
47 environment. In fact, I think we should record DOC_SYMLINKS_DIR here,
48 since it affects CONTENTS, much like INSTALL_MASK.
49
50 >> + x=$(echo -n ${!f})
51 >> + [[ -n ${x} ]] && echo "${x}" > "${f}"
52 >
53 > There's probably no point in this [[ -n ... ]], as that:
54 >
55 > a. requires you to special-handle missing INSTALL_MASK file, while it's
56 > easier to just ensure that it's there (and I think you requested
57 > the same thing from me before you rewritten my commit into breakage),
58 >
59 > b. makes it impossible to distinguish packages from before INSTALL_MASK
60 > storing was added from those where it is empty.
61
62 Maybe this only matters within the context of bug 364633 [1], and for
63 that I think we need to introduce a separate CONTENTS.INSTALL_MASK file
64 so that we can easily toggle collision-protect behavior to use
65 CONTENTS.INSTALL_MASK when desired.
66
67 [1] https://bugs.gentoo.org/364633
68 --
69 Thanks,
70 Zac

Attachments

File name MIME type
signature.asc application/pgp-signature