Add QA_MULTILIB_PATHS for bug #437910.
authorZac Medico <zmedico@gentoo.org>
Thu, 11 Oct 2012 03:07:01 +0000 (20:07 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 11 Oct 2012 03:08:08 +0000 (20:08 -0700)
bin/misc-functions.sh
man/ebuild.5
man/make.conf.5

index 7db6676a0ec5416978b12aee596442bdfa3f4ef6..4a1c46dc3c6fe7033ce9ed3dbae0ab3ef2ebe3ca 100755 (executable)
@@ -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
 
index 0d5e4484d7967f093dc745a210a67697b7b4807d..cca00ddf051ff37950adf2217e5da84b06b66464 100644 (file)
@@ -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
index 61daa90b6a68ba6831e4f3a3b96189557a11e33b..0f5bd54de3795f311362b9d783f0423ca03ea7ef 100644 (file)
@@ -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).