commit:     2f3cde1d67e04cf01dae8ec8b1f2bf0515c153df
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 28 17:09:50 2014 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sun Sep 28 17:09:50 2014 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2f3cde1d

install_qa_check_macho: introduce QA_IGNORE_INSTALL_NAME_FILES

Add QA_IGNORE_INSTALL_NAME_FILES containing a list for file to treat as
non-fatal when they have failures with install_names.

---
 bin/misc-functions.sh | 32 +++++++++++++++++++++++++-------
 man/ebuild.5          |  6 ++++++
 2 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 9ce9df6..d92103f 100644
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -1084,6 +1084,27 @@ install_qa_check_macho() {
                install_name=${l%%;*}; l=${l#*;}
                needed=${l%%;*}; l=${l#*;}
 
+               ignore=
+               qa_var="QA_IGNORE_INSTALL_NAME_FILES_${ARCH/-/_}"
+               eval "[[ -n \${!qa_var} ]] &&
+                       QA_IGNORE_INSTALL_NAME_FILES=(\"\${${qa_var}[@]}\")"
+
+               if [[ ${#QA_IGNORE_INSTALL_NAME_FILES[@]} -gt 1 ]] ; then
+                       for x in "${QA_IGNORE_INSTALL_NAME_FILES[@]}" ; do
+                               [[ ${obj##*/} == ${x} ]] && \
+                                       ignore=true
+                       done
+               else
+                       local shopts=$-
+                       set -o noglob
+                       for x in ${QA_IGNORE_INSTALL_NAME_FILES} ; do
+                               [[ ${obj##*/} == ${x} ]] && \
+                                       ignore=true
+                       done
+                       set +o noglob
+                       set -${shopts}
+               fi
+
                # See if the self-reference install_name points to an existing
                # and to be installed file.  This usually is a symlink for the
                # major version.
@@ -1103,23 +1124,20 @@ install_qa_check_macho() {
                        # remember we are in an implicit subshell, that's
                        # why we touch a file here ... ideally we should be
                        # able to die correctly/nicely here
-                       touch "${T}"/.install_name_check_failed
+                       [[ -z ${ignore} && touch 
"${T}"/.install_name_check_failed
                fi
 
                # this is ugly, paths with spaces won't work
                for lib in ${needed//,/ } ; do
                        if [[ ${lib} == ${D}* ]] ; then
                                eqawarn "QA Notice: install_name references 
\${D}: ${lib} in ${obj}"
-                               touch "${T}"/.install_name_check_failed
+                               [[ -z ${ignore} && touch 
"${T}"/.install_name_check_failed
                        elif [[ ${lib} == ${S}* ]] ; then
                                eqawarn "QA Notice: install_name references 
\${S}: ${lib} in ${obj}"
-                               touch "${T}"/.install_name_check_failed
+                               [[ -z ${ignore} && touch 
"${T}"/.install_name_check_failed
                        elif ! install_name_is_relative ${lib} && [[ ! -e 
${lib} && ! -e ${D}${lib} ]] ; then
                                eqawarn "QA Notice: invalid reference to ${lib} 
in ${obj}"
-                               # remember we are in an implicit subshell, 
that's
-                               # why we touch a file here ... ideally we 
should be
-                               # able to die correctly/nicely here
-                               touch "${T}"/.install_name_check_failed
+                               [[ -z ${ignore} && touch 
"${T}"/.install_name_check_failed
                        fi
                done
 

diff --git a/man/ebuild.5 b/man/ebuild.5
index 89bd6a2..708e9d4 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -777,6 +777,12 @@ 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_IGNORE_INSTALL_NAME_FILES
+This should contain a list of file names (without path) that should be
+ignored in the install_name check.  That is, if these files point to
+something not available in the image directory or live filesystem, these
+files are ignored, albeit being broken.
+.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.

Reply via email to