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 1SU3Ma-0001tr-KP for garchives@archives.gentoo.org; Mon, 14 May 2012 22:03:32 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 60330E09EA; Mon, 14 May 2012 22:03:20 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 2F7E7E09EA for ; Mon, 14 May 2012 22:03:20 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 95D9D1B405B for ; Mon, 14 May 2012 22:03:19 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id EE7E0E5429 for ; Mon, 14 May 2012 22:03:17 +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: <1337032958.ad944275b88a50d2a1f694826b127cceb9221e78.zmedico@gentoo> 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: ad944275b88a50d2a1f694826b127cceb9221e78 X-VCS-Branch: master Date: Mon, 14 May 2012 22:03:17 +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: aefc5429-3331-425e-91cc-62438104569e X-Archives-Hash: fc9db0605814bff561ffb3a457b5a358 commit: ad944275b88a50d2a1f694826b127cceb9221e78 Author: Zac Medico gentoo org> AuthorDate: Mon May 14 20:53:36 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon May 14 22:02:38 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Dad944275 prepstrip: fix hardlink handling for subshells --- bin/ebuild-helpers/prepstrip | 29 +++++++++++++++++------------ 1 files changed, 17 insertions(+), 12 deletions(-) diff --git a/bin/ebuild-helpers/prepstrip b/bin/ebuild-helpers/prepstrip index a58a83b..6f2c742 100755 --- a/bin/ebuild-helpers/prepstrip +++ b/bin/ebuild-helpers/prepstrip @@ -67,16 +67,15 @@ multijob_init # Setup $T filesystem layout that we care about. tmpdir=3D"${T}/prepstrip" rm -rf "${tmpdir}" -mkdir -p "${tmpdir}"/{splitdebug,sources} - -unset ${!INODE_*} +mkdir -p "${tmpdir}"/{inodes,splitdebug,sources} =20 # Usage: inode_var_name: -inode_var_name() { +inode_file_link() { + echo -n "${tmpdir}/inodes/" if [[ ${USERLAND} =3D=3D "BSD" ]] ; then - stat -f 'INODE_%d_%i' "$1" + stat -f '%i' "$1" else - stat -c 'INODE_%d_%i' "$1" + stat -c '%i' "$1" fi } =20 @@ -94,8 +93,7 @@ save_elf_sources() { fi =20 local x=3D$1 - local inode=3D$(inode_var_name "${x}") - [[ -n ${!inode} ]] && return 0 + [[ -f $(inode_file_link "${x}") ]] && return 0 =20 # since we're editing the ELF here, we should recompute the build-id # (the -i flag below). save that output so we don't need to recompute @@ -124,11 +122,10 @@ save_elf_debug() { =20 mkdir -p "${y%/*}" =20 - local inode=3D$(inode_var_name "${x}") - if [[ -n ${!inode} ]] ; then - ln "${ED}usr/lib/debug/${!inode:${#D}}.debug" "${y}" + local inode=3D$(inode_file_link "${x}") + if [[ -f ${inode} ]] ; then + ln "${inode}" "${y}" else - eval ${inode}=3D\${x} if [[ -n ${splitdebug} ]] ; then mv "${splitdebug}" "${y}" else @@ -140,6 +137,12 @@ save_elf_debug() { local args=3D"a-x,o-w" [[ -g ${x} || -u ${x} ]] && args+=3D",go-r" chmod ${args} "${y}" + if ! ln "${y}" "${inode}" ; then + # This means a parallel process has already created the + # inode link. So, replace ${y} with a link to that inode. + rm -f "${y}" + ln "${inode}" "${y}" + fi fi =20 # if we don't already have build-id from debugedit, look it up @@ -304,3 +307,5 @@ then >> "${emptydir}"/.keepdir done < <(find "${D}${prepstrip_sources_dir}/" -type d -empty -print0) fi + +rm -rf "${tmpdir}"