From 54b24a2b30c0eea22a4bfb126ec3cbaadbcfa3b1 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Sat, 6 Dec 2008 20:52:14 +0000 Subject: [PATCH] Implementing a workaround for a problem found by darkside: http://archives.gentoo.org/gentoo-alt/msg_fdb765f2e49f7bcad828a06b994f15be.xml Just temporarily make to be stripped objects writable, if they are not, to have strip succeed in doing its job. svn path=/main/branches/prefix/; revision=12170 --- bin/prepstrip | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/bin/prepstrip b/bin/prepstrip index 8ab6b37cd..a31239745 100755 --- a/bin/prepstrip +++ b/bin/prepstrip @@ -116,6 +116,15 @@ do strip_this=false fi + # 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=false + if [[ ! -w ${x} ]] ; then + was_not_writable=true + 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 @@ -143,4 +152,8 @@ do ${STRIP} ${SAFE_STRIP_FLAGS} "${x}" fi fi + + if [[ ${was_not_writable} == "true" ]] ; then + chmod u-w "${x}" + fi done -- 2.26.2