From 55ab494c406947d67ba7d54208b4cd5e981db579 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 10 Oct 2012 20:07:01 -0700 Subject: [PATCH] Add QA_MULTILIB_PATHS for bug #437910. --- bin/misc-functions.sh | 34 +++++++++++++++++++++++++++------- man/ebuild.5 | 7 ++++++- man/make.conf.5 | 6 +++++- 3 files changed, 38 insertions(+), 9 deletions(-) diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index 7db6676a0..4a1c46dc3 100755 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -783,21 +783,41 @@ install_qa_check() { [[ -x /usr/bin/file && -x /usr/bin/find ]] && \ [[ -n ${MULTILIB_STRICT_DIRS} && -n ${MULTILIB_STRICT_DENY} ]] then - local abort=no dir file firstrun=yes + rm -f "${T}/multilib-strict.log" + local abort=no dir file MULTILIB_STRICT_EXEMPT=$(echo ${MULTILIB_STRICT_EXEMPT} | sed -e 's:\([(|)]\):\\\1:g') for dir in ${MULTILIB_STRICT_DIRS} ; do [[ -d ${ED}/${dir} ]] || continue for file in $(find ${ED}/${dir} -type f | grep -v "^${ED}/${dir}/${MULTILIB_STRICT_EXEMPT}"); do if file ${file} | egrep -q "${MULTILIB_STRICT_DENY}" ; then - if [[ ${firstrun} == yes ]] ; then - echo "Files matching a file type that is not allowed:" - firstrun=no - fi - abort=yes - echo " ${file#${ED}//}" + echo "${file#${ED}//}" >> "${T}/multilib-strict.log" fi done done + + if [[ -s ${T}/multilib-strict.log ]] ; then + if [[ ${#QA_MULTILIB_PATHS[@]} -eq 1 ]] ; then + local shopts=$- + set -o noglob + QA_MULTILIB_PATHS=(${QA_MULTILIB_PATHS}) + set +o noglob + set -${shopts} + fi + if [ "${QA_STRICT_MULTILIB_PATHS-unset}" = unset ] ; then + for x in "${QA_MULTILIB_PATHS[@]}" ; do + sed -e "s#^${x#/}\$##" -i "${T}/multilib-strict.log" + done + sed -e "/^\$/d" -i "${T}/multilib-strict.log" + fi + if [[ -s ${T}/multilib-strict.log ]] ; then + abort=yes + echo "Files matching a file type that is not allowed:" + while read -r ; do + echo " ${REPLY}" + done < "${T}/multilib-strict.log" + fi + fi + [[ ${abort} == yes ]] && die "multilib-strict check failed!" fi diff --git a/man/ebuild.5 b/man/ebuild.5 index 0d5e4484d..cca00ddf0 100644 --- a/man/ebuild.5 +++ b/man/ebuild.5 @@ -1,4 +1,4 @@ -.TH "EBUILD" "5" "Sep 2012" "Portage VERSION" "Portage" +.TH "EBUILD" "5" "Oct 2012" "Portage VERSION" "Portage" .SH "NAME" ebuild \- the internal format, variables, and functions in an ebuild script @@ -760,6 +760,11 @@ The paths may contain regular expressions with escape\-quoted special 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_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. +The paths may contain regular expressions with escape\-quoted special characters. +.TP .B QA_PRESTRIPPED This should contain a list of file paths, relative to the image directory, of files that contain pre-stripped binaries. The paths may contain regular diff --git a/man/make.conf.5 b/man/make.conf.5 index 61daa90b6..0f5bd54de 100644 --- a/man/make.conf.5 +++ b/man/make.conf.5 @@ -1,4 +1,4 @@ -.TH "MAKE.CONF" "5" "Sep 2012" "Portage VERSION" "Portage" +.TH "MAKE.CONF" "5" "Oct 2012" "Portage VERSION" "Portage" .SH "NAME" make.conf \- custom settings for Portage .SH "SYNOPSIS" @@ -895,6 +895,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_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). +.TP \fBQA_STRICT_PRESTRIPPED = \fI"set"\fR Set this to cause portage to ignore any \fIQA_PRESTRIPPED\fR override settings from ebuilds. See also \fBebuild\fR(5). -- 2.26.2