From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Rcn8i-0003j2-1N for garchives@archives.gentoo.org; Tue, 20 Dec 2011 00:01:04 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B108D21C08C; Tue, 20 Dec 2011 00:00:55 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 7213E21C08C for ; Tue, 20 Dec 2011 00:00:55 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B17B31B400B for ; Tue, 20 Dec 2011 00:00:54 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id CB3F980042 for ; Tue, 20 Dec 2011 00:00:53 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: Subject: [gentoo-commits] proj/portage:master commit in: bin/ebuild-helpers/ X-VCS-Repository: proj/portage X-VCS-Files: bin/ebuild-helpers/prepstrip X-VCS-Directories: bin/ebuild-helpers/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: b135c01eff4ea89d16ae711271cc215388d08d17 Date: Tue, 20 Dec 2011 00:00:53 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: d793d0b2-0860-44a7-88d4-7d1731dd04da X-Archives-Hash: dad90f279a039accb224c452753ad173 commit: b135c01eff4ea89d16ae711271cc215388d08d17 Author: Zac Medico gentoo org> AuthorDate: Tue Dec 20 00:00:38 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Tue Dec 20 00:00:38 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Db135c01e prepstrip: merge diff from prefix branch NOTE: Debug files must be installed in ${EPREFIX}/usr/lib/debug/${EPREFIX} (note that ${EPREFIX} occurs twice in this path) in order for gdb's debug-file-directory lookup to work correctly. --- bin/ebuild-helpers/prepstrip | 35 ++++++++++++++++++++++++++--------- 1 files changed, 26 insertions(+), 9 deletions(-) diff --git a/bin/ebuild-helpers/prepstrip b/bin/ebuild-helpers/prepstrip index 15eed84..241caaf 100755 --- a/bin/ebuild-helpers/prepstrip +++ b/bin/ebuild-helpers/prepstrip @@ -19,7 +19,7 @@ exp_tf FEATURES installsources nostrip splitdebug exp_tf RESTRICT binchecks installsources strip =20 [[ " ${FEATURES} " =3D=3D *" force-prefix "* ]] || \ - case "$EAPI" in 0|1|2) ED=3D${D} ;; esac + case "$EAPI" in 0|1|2) EPREFIX=3D ED=3D${D} ;; esac =20 banner=3Dfalse SKIP_STRIP=3Dfalse @@ -57,7 +57,7 @@ case $(${STRIP} --version 2>/dev/null) in esac : ${PORTAGE_STRIP_FLAGS=3D${SAFE_STRIP_FLAGS} ${DEF_STRIP_FLAGS}} =20 -prepstrip_sources_dir=3D/usr/src/debug/${CATEGORY}/${PF} +prepstrip_sources_dir=3D${EPREFIX}/usr/src/debug/${CATEGORY}/${PF} =20 type -P debugedit >/dev/null && debugedit_found=3Dtrue || debugedit_foun= d=3Dfalse debugedit_warned=3Dfalse @@ -101,8 +101,12 @@ save_elf_sources() { save_elf_debug() { ${FEATURES_splitdebug} || return 0 =20 + # NOTE: Debug files must be installed in + # ${EPREFIX}/usr/lib/debug/${EPREFIX} (note that ${EPREFIX} occurs + # twice in this path) in order for gdb's debug-file-directory + # lookup to work correctly. local x=3D$1 - local y=3D"${ED}usr/lib/debug/${x:${#ED}}.debug" + local y=3D${ED}usr/lib/debug/${x:${#D}}.debug =20 # dont save debug info twice [[ ${x} =3D=3D *".debug" ]] && return 0 @@ -111,7 +115,7 @@ save_elf_debug() { =20 local inode=3D$(inode_var_name "$x") if [[ -n ${!inode} ]] ; then - ln "${ED}usr/lib/debug/${!inode:${#ED}}.debug" "$y" + ln "${ED}usr/lib/debug/${!inode:${#D}}.debug" "$y" else eval $inode=3D\$x if [[ -e ${T}/prepstrip.split.debug ]] ; then @@ -135,8 +139,8 @@ save_elf_debug() { local buildid_dir=3D"${ED}usr/lib/debug/.build-id/${buildid:0:2}" local buildid_file=3D"${buildid_dir}/${buildid:2}" mkdir -p "${buildid_dir}" - ln -s "../../${x:${#ED}}.debug" "${buildid_file}.debug" - ln -s "/${x:${#ED}}" "${buildid_file}" + ln -s "../../${x:${#D}}.debug" "${buildid_file}.debug" + ln -s "/${x:${#D}}" "${buildid_file}" fi } =20 @@ -216,6 +220,15 @@ do strip_this=3Dfalse fi =20 + # In Prefix we are usually an unprivileged user, so we can't strip + # unwritable objects. Make them temporarily writable for the + # stripping. + was_not_writable=3Dfalse + if [[ -n ${EPREFIX} && ! -w ${x} ]] ; then + was_not_writable=3Dtrue + chmod u+w "${x}" + fi + # only split debug info for final linked objects # or kernel modules as debuginfo for intermediatary # files (think crt*.o from gcc/glibc) is useless and @@ -234,6 +247,10 @@ do elif [[ ${f} =3D=3D *"SB relocatable"* ]] ; then process_elf "${x}" ${SAFE_STRIP_FLAGS} fi + + if ${was_not_writable} ; then + chmod u-w "${x}" + fi done =20 if [[ -s ${T}/debug.sources ]] && \ @@ -242,10 +259,10 @@ if [[ -s ${T}/debug.sources ]] && \ ${debugedit_found} then vecho "installsources: rsyncing source files" - [[ -d ${ED}${prepstrip_sources_dir} ]] || mkdir -p "${ED}${prepstrip_so= urces_dir}" + [[ -d ${D}${prepstrip_sources_dir} ]] || mkdir -p "${D}${prepstrip_sour= ces_dir}" grep -zv '/<[^/>]*>$' "${T}"/debug.sources | \ (cd "${WORKDIR}"; LANG=3DC sort -z -u | \ - rsync -tL0 --files-from=3D- "${WORKDIR}/" "${ED}${prepstrip_sources_di= r}/" ) + rsync -tL0 --files-from=3D- "${WORKDIR}/" "${D}${prepstrip_sources_dir= }/" ) =20 # Preserve directory structure. # Needed after running save_elf_sources. @@ -253,5 +270,5 @@ then while read -r -d $'\0' emptydir do >> "$emptydir"/.keepdir - done < <(find "${ED}${prepstrip_sources_dir}/" -type d -empty -print0) + done < <(find "${D}${prepstrip_sources_dir}/" -type d -empty -print0) fi