[lldb-dev] [3.7 Release] RC1 has been tagged, Testing Phase I begins
Dimitry Andric
dimitry at andric.com
Mon Jul 20 15:15:52 PDT 2015
On 20 Jul 2015, at 23:34, Hans Wennborg <hans at chromium.org> wrote:
>
> On Sun, Jul 19, 2015 at 8:32 AM, Dimitry Andric <dimitry at andric.com> wrote:
...
>> The line can be replaced with this instead:
>>
>> rpath=`objdump -x $Candidate | sed -ne'/RPATH/{s/^ *RPATH *//;p;}'`
>
> How about just guarding it with an if statement? I'm worried about
> adding non-obvious commands to the script, both for making it harder
> to understand and for portability.
It should be portable enough, as this works with with BSD and GNU sed,
but it may indeed be harder to understand. So how about this:
Index: test-release.sh
===================================================================
--- test-release.sh (revision 242721)
+++ test-release.sh (working copy)
@@ -359,10 +359,12 @@ function clean_RPATH() {
local InstallPath="$1"
for Candidate in `find $InstallPath/{bin,lib} -type f`; do
if file $Candidate | grep ELF | egrep 'executable|shared object' > /dev/null 2>&1 ; then
- rpath=`objdump -x $Candidate | grep 'RPATH' | sed -e's/^ *RPATH *//'`
- if [ -n "$rpath" ]; then
- newrpath=`echo $rpath | sed -e's/.*\(\$ORIGIN[^:]*\).*/\1/'`
- chrpath -r $newrpath $Candidate 2>&1 > /dev/null 2>&1
+ if rpath=`objdump -x $Candidate | grep 'RPATH'` ; then
+ rpath=`echo $rpath | sed -e's/^ *RPATH *//'`
+ if [ -n "$rpath" ]; then
+ newrpath=`echo $rpath | sed -e's/.*\(\$ORIGIN[^:]*\).*/\1/'`
+ chrpath -r $newrpath $Candidate 2>&1 > /dev/null 2>&1
+ fi
fi
fi
done
-Dimitry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20150721/b981615d/attachment.sig>
More information about the lldb-dev
mailing list