Zac Medico
2018-10-01 05:45:18 UTC
The QA_INSTALL_PATHS variable exempts paths from "unexpected paths"
warnings generated by install-qa-check.d/08gentoo-paths. This is
useful for QT packages that are expected to install a directory
named /usr/share/doc/${PN}-${VERSION} (which may differ from the
usual /usr/share/doc/${PF} location as reported in bug 667280).
Bug: https://bugs.gentoo.org/667378
Signed-off-by: Zac Medico <***@gentoo.org>
---
bin/install-qa-check.d/08gentoo-paths | 21 +++++++++++++++++++++
man/ebuild.5 | 7 +++++++
man/make.conf.5 | 4 ++++
3 files changed, 32 insertions(+)
diff --git a/bin/install-qa-check.d/08gentoo-paths b/bin/install-qa-check.d/08gentoo-paths
index 3ee887df0..a00f9f6af 100644
--- a/bin/install-qa-check.d/08gentoo-paths
+++ b/bin/install-qa-check.d/08gentoo-paths
@@ -60,6 +60,27 @@ gentoo_path_check() {
${shopt_save}
+ if [[ ${#bad_paths[@]} -gt 0 && ${QA_INSTALL_PATHS} &&
+ ${QA_STRICT_INSTALL_PATHS-unset} == unset ]]; then
+ local filtered_paths=()
+ local sed_args=()
+ local qa_install_paths
+ if [[ $(declare -p QA_INSTALL_PATHS) == "declare -a "* ]]; then
+ qa_install_paths=("${QA_INSTALL_PATHS[@]}")
+ else
+ set -f
+ qa_install_paths=(${QA_INSTALL_PATHS})
+ set +f
+ fi
+ for x in "${qa_install_paths[@]}"; do
+ sed_args+=(-e "s#^/${x#/}\$##")
+ done
+ while read -r -d ''; do
+ [[ ${REPLY} ]] && filtered_paths+=("${REPLY}")
+ done < <(printf -- '%s\0' "${bad_paths[@]}" | sed -z "${sed_args[@]}")
+ bad_paths=("${filtered_paths[@]}")
+ fi
+
# report
# ------
if [[ -n ${bad_paths[@]} ]]; then
diff --git a/man/ebuild.5 b/man/ebuild.5
index 9f491dd73..01f3e09aa 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -791,6 +791,13 @@ characters.
This variable is intended to be used on files of binary packages which ignore
CFLAGS, CXXFLAGS, FFLAGS, FCFLAGS, and LDFLAGS variables.
.TP
+.B QA_INSTALL_PATHS
+This should contain a list of file paths (may be an array), relative to the
+image directory, of files that are exempt from QA notices regarding ebuilds
+that install files to unusual locations.
+The paths may contain regular expressions with escape\-quoted special
+characters.
+.TP
.B QA_MULTILIB_PATHS
This should contain a list of file paths, relative to the image directory, of
files that should be ignored for the multilib\-strict checks.
diff --git a/man/make.conf.5 b/man/make.conf.5
index a33929143..d97d83767 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -1060,6 +1060,10 @@ settings from ebuilds. See also \fBebuild\fR(5).
Set this to cause portage to ignore any \fIQA_FLAGS_IGNORED\fR override
settings from ebuilds. See also \fBebuild\fR(5).
.TP
+\fBQA_STRICT_INSTALL_PATHS = \fI"set"\fR
+Set this to cause portage to ignore any \fIQA_INSTALL_PATHS\fR override
+settings from ebuilds. See also \fBebuild\fR(5).
+.TP
\fBQA_STRICT_MULTILIB_PATHS = \fI"set"\fR
Set this to cause portage to ignore any \fIQA_MULTILIB_PATHS\fR override
settings from ebuilds. See also \fBebuild\fR(5).
warnings generated by install-qa-check.d/08gentoo-paths. This is
useful for QT packages that are expected to install a directory
named /usr/share/doc/${PN}-${VERSION} (which may differ from the
usual /usr/share/doc/${PF} location as reported in bug 667280).
Bug: https://bugs.gentoo.org/667378
Signed-off-by: Zac Medico <***@gentoo.org>
---
bin/install-qa-check.d/08gentoo-paths | 21 +++++++++++++++++++++
man/ebuild.5 | 7 +++++++
man/make.conf.5 | 4 ++++
3 files changed, 32 insertions(+)
diff --git a/bin/install-qa-check.d/08gentoo-paths b/bin/install-qa-check.d/08gentoo-paths
index 3ee887df0..a00f9f6af 100644
--- a/bin/install-qa-check.d/08gentoo-paths
+++ b/bin/install-qa-check.d/08gentoo-paths
@@ -60,6 +60,27 @@ gentoo_path_check() {
${shopt_save}
+ if [[ ${#bad_paths[@]} -gt 0 && ${QA_INSTALL_PATHS} &&
+ ${QA_STRICT_INSTALL_PATHS-unset} == unset ]]; then
+ local filtered_paths=()
+ local sed_args=()
+ local qa_install_paths
+ if [[ $(declare -p QA_INSTALL_PATHS) == "declare -a "* ]]; then
+ qa_install_paths=("${QA_INSTALL_PATHS[@]}")
+ else
+ set -f
+ qa_install_paths=(${QA_INSTALL_PATHS})
+ set +f
+ fi
+ for x in "${qa_install_paths[@]}"; do
+ sed_args+=(-e "s#^/${x#/}\$##")
+ done
+ while read -r -d ''; do
+ [[ ${REPLY} ]] && filtered_paths+=("${REPLY}")
+ done < <(printf -- '%s\0' "${bad_paths[@]}" | sed -z "${sed_args[@]}")
+ bad_paths=("${filtered_paths[@]}")
+ fi
+
# report
# ------
if [[ -n ${bad_paths[@]} ]]; then
diff --git a/man/ebuild.5 b/man/ebuild.5
index 9f491dd73..01f3e09aa 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -791,6 +791,13 @@ characters.
This variable is intended to be used on files of binary packages which ignore
CFLAGS, CXXFLAGS, FFLAGS, FCFLAGS, and LDFLAGS variables.
.TP
+.B QA_INSTALL_PATHS
+This should contain a list of file paths (may be an array), relative to the
+image directory, of files that are exempt from QA notices regarding ebuilds
+that install files to unusual locations.
+The paths may contain regular expressions with escape\-quoted special
+characters.
+.TP
.B QA_MULTILIB_PATHS
This should contain a list of file paths, relative to the image directory, of
files that should be ignored for the multilib\-strict checks.
diff --git a/man/make.conf.5 b/man/make.conf.5
index a33929143..d97d83767 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -1060,6 +1060,10 @@ settings from ebuilds. See also \fBebuild\fR(5).
Set this to cause portage to ignore any \fIQA_FLAGS_IGNORED\fR override
settings from ebuilds. See also \fBebuild\fR(5).
.TP
+\fBQA_STRICT_INSTALL_PATHS = \fI"set"\fR
+Set this to cause portage to ignore any \fIQA_INSTALL_PATHS\fR override
+settings from ebuilds. See also \fBebuild\fR(5).
+.TP
\fBQA_STRICT_MULTILIB_PATHS = \fI"set"\fR
Set this to cause portage to ignore any \fIQA_MULTILIB_PATHS\fR override
settings from ebuilds. See also \fBebuild\fR(5).
--
2.16.4
2.16.4