Bug #251976 - Add a QA_PRESTRIPPED variable for ebuilds to disable warnings about
authorZac Medico <zmedico@gentoo.org>
Wed, 24 Dec 2008 03:43:44 +0000 (03:43 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 24 Dec 2008 03:43:44 +0000 (03:43 -0000)
pre-stripped files.

svn path=/main/trunk/; revision=12296

bin/prepstrip
man/ebuild.5

index 33bdb220991795414a9b90b544ef778e7adf7b9b..4fb0760cd7987512aafa7bae561c0f0f91c42f6d 100755 (executable)
@@ -80,12 +80,30 @@ save_elf_debug() {
 # They prevent us from getting the splitdebug data.
 if ! hasq binchecks ${RESTRICT} && \
        ! hasq strip ${RESTRICT} ; then
-       f=$(scanelf -yqRBF '#k%F' -k '!.symtab' "$@")
-       if [[ -n ${f} ]] ; then
+       log=$T/scanelf-already-stripped.log
+       scanelf -yqRBF '#k%F' -k '!.symtab' "$@" | sed -e "s#^$D##" > "$log"
+       if [[ -s $log && ${QA_STRICT_PRESTRIPPED-unset} = unset ]] ; then
+               if [[ ${#QA_DT_HASH[@]} -gt 1 ]] ; then
+                       for x in "${QA_PRESTRIPPED[@]}" ; do
+                               sed -e "s#^${x#/}\$##" -i "$log"
+                       done
+               else
+                       local shopts=$-
+                       set -o noglob
+                       for x in $QA_PRESTRIPPED ; do
+                               sed -e "s#^${x#/}\$##" -i "$log"
+                       done
+                       set +o noglob
+                       set -$shopts
+               fi
+       fi
+       sed -e "/^\$/d" -e "s#^#/#" -i "$log"
+       if [[ -s $log ]] ; then
                vecho -e "\a\n"
                eqawarn "QA Notice: Pre-stripped files found:"
-               eqawarn "${f}"
-               echo "${f}" > "${T}"/scanelf-already-stripped.log
+               eqawarn "$(<"$log")"
+       else
+               rm -f "$log"
        fi
 fi
 
index 02069b44e0ffcb5906f51c1af6a11999494aec61..7e9a477fcec7738141605e766e03b5c5d380ec48 100644 (file)
@@ -484,6 +484,11 @@ The paths may contain regular expressions.
 This should contain a list of file paths, relative to the image directory, of
 files that contain .hash sections. The paths may contain regular expressions
 with escape\-quoted special characters.
+.TP
+\fBQA_PRESTRIPPED\fR
+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
+expressions with escape\-quoted special characters.
 .SH "PORTAGE DECLARATIONS"
 .TP
 .B inherit