summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-08-04 05:30:47 +0000
committerZac Medico <zmedico@gentoo.org>2006-08-04 05:30:47 +0000
commit4387d7989e2a91ef9cf78bafbaa266d70544f22a (patch)
tree10e73942583847cc4855976eee308f73e2ae65ef /bin/prepstrip
parentFix STRIP_MASK logic so that a match results in stripitbaby=0. (diff)
downloadportage-multirepo-4387d7989e2a91ef9cf78bafbaa266d70544f22a.tar.gz
portage-multirepo-4387d7989e2a91ef9cf78bafbaa266d70544f22a.tar.bz2
portage-multirepo-4387d7989e2a91ef9cf78bafbaa266d70544f22a.zip
Fix the installsources feature so that it works even with splitdebug or nostrip. Thanks to Olivier Crete <tester@gentoo.org> for this patch from bug #136197.
svn path=/main/trunk/; revision=4136
Diffstat (limited to 'bin/prepstrip')
-rwxr-xr-xbin/prepstrip26
1 files changed, 15 insertions, 11 deletions
diff --git a/bin/prepstrip b/bin/prepstrip
index b43d3bad..deaa017e 100755
--- a/bin/prepstrip
+++ b/bin/prepstrip
@@ -5,10 +5,12 @@
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+unset NOSTRIP
if hasq nostrip ${FEATURES} ${RESTRICT} || \
hasq strip ${RESTRICT}
then
- exit 0
+ NOSTRIP=1
+ hasq installsources ${FEATURES} || exit 0
fi
STRIP=${STRIP:-${CHOST}-strip}
@@ -24,7 +26,16 @@ save_elf_debug() {
local x=$1
local y="${D}usr/lib/debug/${x:${#D}}.debug"
+ if hasq installsources ${FEATURES} && [ -x /usr/bin/debugedit ] ; then
+ debugedit -b "${WORKDIR}" -d /usr/src/debug/${PF} -l "${T}"/debug.sources "${x}"
+ if [[ -s ${T}/debug.sources ]] ; then
+ [[ -d ${D}/usr/src/debug/${PF} ]] || mkdir -p "${D}/usr/src/debug/${PF}"
+ cat "${T}"/debug.sources | (cd "${WORKDIR}"; LANG=C sort -z -u | rsync -a0 --files-from=- "${WORKDIR}/" "${D}/usr/src/debug/${PF}/" )
+ fi
+ fi
+
hasq splitdebug ${FEATURES} || return 0
+ [[ -z "${NOSTRIP}" ]] || return 0
# dont save debug info twice.
[[ ${x:7} == ".debug" ]] && return 0
@@ -34,15 +45,6 @@ save_elf_debug() {
${OBJCOPY} --add-gnu-debuglink="${y}" "${x}"
chmod a-x,o-w "${y}"
- hasq installsources ${FEATURES} || return 0
-
- if [[ -x "/usr/bin/debugedit" ]] ; then
- debugedit -b "${WORKDIR}" -d /usr/src/debug/${PF} -l "${T}"/debug.sources "${x}"
- if [[ -s ${T}/debug.sources ]] ; then
- [[ -d ${D}/usr/src/debug/${PF} ]] || mkdir -p "${D}/usr/src/debug/${PF}"
- cat "${T}"/debug.sources | (cd "${WORKDIR}"; LANG=C sort -z -u | rsync -a0 --files-from=- "${WORKDIR}/" "${D}/usr/src/debug/${PF}/" )
- fi
- fi
}
# The existance of the section .symtab tells us that a binary is stripped.
@@ -58,7 +60,7 @@ 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
if [[ ${banner} -eq 1 ]] ; then
- vecho "strip: ${STRIP} ${PORTAGE_STRIP_FLAGS}"
+ [[ -z ${NOSTRIP} ]] && vecho "strip: ${STRIP} ${PORTAGE_STRIP_FLAGS}"
banner=0
fi
@@ -77,11 +79,13 @@ for x in $(scanelf -yqRBF '#k%F' -k '.symtab' "$@") $(for y in "$@"; do find "${
if [[ ${f} == *"current ar archive"* ]] ; then
vecho " ${x:${#D}}"
+ [[ -n ${NOSTRIP} ]] && continue
[[ ${stripitbaby} -eq 1 ]] && ${STRIP} -g "${x}"
fi
if [[ ${f} == *"SB executable"* || ${f} == *"SB shared object"* ]] ; then
vecho " ${x:${#D}}"
save_elf_debug "${x}"
+ [[ -n ${NOSTRIP} ]] && continue
[[ ${stripitbaby} -eq 1 ]] && ${STRIP} ${PORTAGE_STRIP_FLAGS} "${x}"
fi
done