Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Cc: Zac Medico <zmedico@g.o>
Subject: [gentoo-portage-dev] [PATCH] Support QA{,_STRICT}_INSTALL_PATHS variables (bug 667378)
Date: Mon, 01 Oct 2018 05:45:57
Message-Id: 20181001054518.5638-1-zmedico@gentoo.org
1 The QA_INSTALL_PATHS variable exempts paths from "unexpected paths"
2 warnings generated by install-qa-check.d/08gentoo-paths. This is
3 useful for QT packages that are expected to install a directory
4 named /usr/share/doc/${PN}-${VERSION} (which may differ from the
5 usual /usr/share/doc/${PF} location as reported in bug 667280).
6
7 Bug: https://bugs.gentoo.org/667378
8 Signed-off-by: Zac Medico <zmedico@g.o>
9 ---
10 bin/install-qa-check.d/08gentoo-paths | 21 +++++++++++++++++++++
11 man/ebuild.5 | 7 +++++++
12 man/make.conf.5 | 4 ++++
13 3 files changed, 32 insertions(+)
14
15 diff --git a/bin/install-qa-check.d/08gentoo-paths b/bin/install-qa-check.d/08gentoo-paths
16 index 3ee887df0..a00f9f6af 100644
17 --- a/bin/install-qa-check.d/08gentoo-paths
18 +++ b/bin/install-qa-check.d/08gentoo-paths
19 @@ -60,6 +60,27 @@ gentoo_path_check() {
20
21 ${shopt_save}
22
23 + if [[ ${#bad_paths[@]} -gt 0 && ${QA_INSTALL_PATHS} &&
24 + ${QA_STRICT_INSTALL_PATHS-unset} == unset ]]; then
25 + local filtered_paths=()
26 + local sed_args=()
27 + local qa_install_paths
28 + if [[ $(declare -p QA_INSTALL_PATHS) == "declare -a "* ]]; then
29 + qa_install_paths=("${QA_INSTALL_PATHS[@]}")
30 + else
31 + set -f
32 + qa_install_paths=(${QA_INSTALL_PATHS})
33 + set +f
34 + fi
35 + for x in "${qa_install_paths[@]}"; do
36 + sed_args+=(-e "s#^/${x#/}\$##")
37 + done
38 + while read -r -d ''; do
39 + [[ ${REPLY} ]] && filtered_paths+=("${REPLY}")
40 + done < <(printf -- '%s\0' "${bad_paths[@]}" | sed -z "${sed_args[@]}")
41 + bad_paths=("${filtered_paths[@]}")
42 + fi
43 +
44 # report
45 # ------
46 if [[ -n ${bad_paths[@]} ]]; then
47 diff --git a/man/ebuild.5 b/man/ebuild.5
48 index 9f491dd73..01f3e09aa 100644
49 --- a/man/ebuild.5
50 +++ b/man/ebuild.5
51 @@ -791,6 +791,13 @@ characters.
52 This variable is intended to be used on files of binary packages which ignore
53 CFLAGS, CXXFLAGS, FFLAGS, FCFLAGS, and LDFLAGS variables.
54 .TP
55 +.B QA_INSTALL_PATHS
56 +This should contain a list of file paths (may be an array), relative to the
57 +image directory, of files that are exempt from QA notices regarding ebuilds
58 +that install files to unusual locations.
59 +The paths may contain regular expressions with escape\-quoted special
60 +characters.
61 +.TP
62 .B QA_MULTILIB_PATHS
63 This should contain a list of file paths, relative to the image directory, of
64 files that should be ignored for the multilib\-strict checks.
65 diff --git a/man/make.conf.5 b/man/make.conf.5
66 index a33929143..d97d83767 100644
67 --- a/man/make.conf.5
68 +++ b/man/make.conf.5
69 @@ -1060,6 +1060,10 @@ settings from ebuilds. See also \fBebuild\fR(5).
70 Set this to cause portage to ignore any \fIQA_FLAGS_IGNORED\fR override
71 settings from ebuilds. See also \fBebuild\fR(5).
72 .TP
73 +\fBQA_STRICT_INSTALL_PATHS = \fI"set"\fR
74 +Set this to cause portage to ignore any \fIQA_INSTALL_PATHS\fR override
75 +settings from ebuilds. See also \fBebuild\fR(5).
76 +.TP
77 \fBQA_STRICT_MULTILIB_PATHS = \fI"set"\fR
78 Set this to cause portage to ignore any \fIQA_MULTILIB_PATHS\fR override
79 settings from ebuilds. See also \fBebuild\fR(5).
80 --
81 2.16.4

Replies