[llvm] r242722 - Avoid early pipefail exits due to grep failures in stage comparisons.

Dimitry Andric dimitry at andric.com
Mon Jul 20 15:24:40 PDT 2015


Author: dim
Date: Mon Jul 20 17:24:40 2015
New Revision: 242722

URL: http://llvm.org/viewvc/llvm-project?rev=242722&view=rev
Log:
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.

Modified:
    llvm/trunk/utils/release/test-release.sh

Modified: llvm/trunk/utils/release/test-release.sh
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/release/test-release.sh?rev=242722&r1=242721&r2=242722&view=diff
==============================================================================
--- llvm/trunk/utils/release/test-release.sh (original)
+++ llvm/trunk/utils/release/test-release.sh Mon Jul 20 17:24:40 2015
@@ -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





More information about the llvm-commits mailing list