From 1761bba3dce60a01beb9d2ea5cdc7a8922c39c20 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Wed, 22 Jul 2015 00:48:46 +0000 Subject: [PATCH] Merging r242722: ------------------------------------------------------------------------ r242722 | dim | 2015-07-20 15:24:40 -0700 (Mon, 20 Jul 2015) | 6 lines Avoid early pipefail exits due to grep failures in stage comparisons. If objects or executables did not contain any RPATH, grep would return nonzero, and the whole stage comparison loop would unexpectedly exit. Fix this by checking the grep result explicitly. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_37@242861 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/release/test-release.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/utils/release/test-release.sh b/utils/release/test-release.sh index 96489261bbd..3ecae5ade03 100755 --- a/utils/release/test-release.sh +++ b/utils/release/test-release.sh @@ -343,10 +343,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