Bug #251976 - Add a QA_PRESTRIPPED variable for ebuilds to disable warnings about
authorZac Medico <zmedico@gentoo.org>
Thu, 25 Dec 2008 01:27:20 +0000 (01:27 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 25 Dec 2008 01:27:20 +0000 (01:27 -0000)
pre-stripped files. (trunk r12295:12300)

svn path=/main/branches/2.1.6/; revision=12323

bin/prepstrip
man/ebuild.5
man/make.conf.5

index 33bdb220991795414a9b90b544ef778e7adf7b9b..3e447331458e735bce18f6fcd988bc792fc24f12 100755 (executable)
@@ -80,12 +80,25 @@ 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 [[ -n $QA_PRESTRIPPED && -s $log && \
+               ${QA_STRICT_PRESTRIPPED-unset} = unset ]] ; then
+               shopts=$-
+               set -o noglob
+               for x in $QA_PRESTRIPPED ; do
+                       sed -e "s#^${x#/}\$##" -i "$log"
+               done
+               set +o noglob
+               set -$shopts
+       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 1a6a867e03a2d7075434cbbd5ad01b8f519dae80..7a5ec2ca450b96a154beef58373f2ac653c074b5 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
index 07ecba6f83be628df113be53bea5ef655182b03f..b2d447eb90b50e8c911c456ee5d8ad92e906dce4 100644 (file)
@@ -591,6 +591,10 @@ settings from ebuilds.  See also \fBebuild\fR(5).
 Set this to cause portage to ignore any \fIQA_DT_HASH\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).
+.TP
 .B RESUMECOMMAND
 This variable contains the command used for resuming package sources that
 have been partially downloaded.  It should be defined using the same format