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
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
${STRIP} ${SAFE_STRIP_FLAGS} "${x}"
fi
fi
+
+ if [[ ${was_not_writable} == "true" ]] ; then
+ chmod u-w "${x}"
+ fi
done