From: Zac Medico Date: Sat, 7 Jul 2007 14:11:16 +0000 (-0000) Subject: `find` can accept a list of paths so condense this nested for loop, and dont split... X-Git-Tag: v2.1.3~80 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4f9985069351f9e39b3efe04f979614066cdc841;p=portage.git `find` can accept a list of paths so condense this nested for loop, and dont split off debug information for ET_REL files as these are never pulled in via debug utilities (and can trigger weird behavior in binutils when linked into things, like glibcs crt1.o) (trunk r7189) svn path=/main/branches/2.1.2/; revision=7190 --- diff --git a/bin/prepstrip b/bin/prepstrip index 4e4e78923..539eba2f1 100755 --- a/bin/prepstrip +++ b/bin/prepstrip @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 1999-2006 Gentoo Foundation +# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ @@ -51,7 +51,6 @@ save_elf_debug() { ${OBJCOPY} --only-keep-debug "${x}" "${y}" ${OBJCOPY} --add-gnu-debuglink="${y}" "${x}" chmod a-x,o-w "${y}" - } # The existance of the section .symtab tells us that a binary is stripped. @@ -66,7 +65,10 @@ if [[ -n "${f}" ]] ; then fi # Now we look for unstripped binaries. -for x in $(scanelf -yqRBF '#k%F' -k '.symtab' "$@") $(for y in "$@"; do find "${y}" -type f -name '*.a' -print ; done); do +for x in \ + $(scanelf -yqRBF '#k%F' -k '.symtab' "$@") \ + $(find "$@" -type f -name '*.a') +do if [[ ${banner} -eq 1 ]] ; then [[ -z ${NOSTRIP} ]] && vecho "strip: ${STRIP} ${PORTAGE_STRIP_FLAGS}" banner=0 @@ -91,7 +93,7 @@ for x in $(scanelf -yqRBF '#k%F' -k '.symtab' "$@") $(for y in "$@"; do find "${ [[ ${stripitbaby} -eq 1 ]] && ${STRIP} -g "${x}" elif [[ ${f} == *"SB executable"* || ${f} == *"SB shared object"* || ${f} == *"SB relocatable"* ]] ; then vecho " ${x:${#D}}" - save_elf_debug "${x}" + [[ ${f} != *"SB relocatable"* ]] && save_elf_debug "${x}" [[ -n ${NOSTRIP} ]] && continue if [[ ${stripitbaby} -eq 1 ]] ; then [[ ${f} == *"SB relocatable"* ]] \