From: Zac Medico Date: Mon, 10 Dec 2012 22:05:09 +0000 (-0800) Subject: prepstrip: handle objcopy failure, bug #446774 X-Git-Tag: v2.2.0_alpha148~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d08f5efd56c19afab3e4538baf91fe4d6d7ecb1b;p=portage.git prepstrip: handle objcopy failure, bug #446774 --- diff --git a/bin/ebuild-helpers/prepstrip b/bin/ebuild-helpers/prepstrip index dd8805277..6a09ff457 100755 --- a/bin/ebuild-helpers/prepstrip +++ b/bin/ebuild-helpers/prepstrip @@ -124,10 +124,14 @@ save_elf_debug() { ${OBJCOPY} ${objcopy_flags} "${x}" "${y}" ${OBJCOPY} --add-gnu-debuglink="${y}" "${x}" fi - local args="a-x,o-w" - [[ -g ${x} || -u ${x} ]] && args+=",go-r" - chmod ${args} "${y}" - ln "${y}" "${inode_debug}" || die "ln failed unexpectedly" + # Only do the following if the debug file was + # successfully created (see bug #446774). + if [ $? -eq 0 ] ; then + local args="a-x,o-w" + [[ -g ${x} || -u ${x} ]] && args+=",go-r" + chmod ${args} "${y}" + ln "${y}" "${inode_debug}" || die "ln failed unexpectedly" + fi fi # if we don't already have build-id from debugedit, look it up