From: Dan Liew Date: Tue, 7 Jul 2015 15:50:33 +0000 (+0000) Subject: Fix bug in test-release.sh where the script would not exit if any X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=9fb489716232ab01a736d70b763a76fcbf2807be;p=oota-llvm.git Fix bug in test-release.sh where the script would not exit if any of the build stages that are sent through a pipe (e.g. tee) failed. This potentially allowed builds and/or tests to fail without anyone noticing. It appears that for the LLVM 3.6.[01] releases this actually happened for the Ubuntu 14.04LTS binary releases. The essence of the issue is that without ``set -o pipefail`` the following command in bash has a zero exit code. false | tee /dev/null ; exit $? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241599 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/release/test-release.sh b/utils/release/test-release.sh index 04127c8eb98..602c26ace55 100755 --- a/utils/release/test-release.sh +++ b/utils/release/test-release.sh @@ -348,7 +348,11 @@ function package_release() { cd $cwd } -set -e # Exit if any command fails +# Exit if any command fails +# Note: pipefail is necessary for running build commands through +# a pipe (i.e. it changes the output of ``false | tee /dev/null ; echo $?``) +set -e +set -o pipefail if [ "$do_checkout" = "yes" ]; then export_sources