[llvm] r309568 - [docker] Fix unmatched quote problem in here-document on older versions of bash

Don Hinton via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 08:18:57 PDT 2017


Author: dhinton
Date: Mon Jul 31 08:18:57 2017
New Revision: 309568

URL: http://llvm.org/viewvc/llvm-project?rev=309568&view=rev
Log:
[docker] Fix unmatched quote problem in here-document on older versions of bash

Summary:
When outputing usage, emit here-document directly instead of
saving in a variable first -- avoids problem with bash 3.2.57 where an
unmatched ' in the here-document results in the following error:

./build_docker_image.sh: line 135: unexpected EOF while looking for matching `''

bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin16)

Differential Revision: https://reviews.llvm.org/D36064

Modified:
    llvm/trunk/utils/docker/build_docker_image.sh
    llvm/trunk/utils/docker/scripts/build_install_llvm.sh

Modified: llvm/trunk/utils/docker/build_docker_image.sh
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/docker/build_docker_image.sh?rev=309568&r1=309567&r2=309568&view=diff
==============================================================================
--- llvm/trunk/utils/docker/build_docker_image.sh (original)
+++ llvm/trunk/utils/docker/build_docker_image.sh Mon Jul 31 08:18:57 2017
@@ -15,7 +15,7 @@ DOCKER_TAG=""
 BUILDSCRIPT_ARGS=""
 
 function show_usage() {
-  usage=$(cat << EOF
+  cat << EOF
 Usage: build_docker_image.sh [options] [-- [cmake_args]...]
 
 Available options:
@@ -64,8 +64,6 @@ $ ./build_docker_image.sh -s debian8 -d
     -DCLANG_ENABLE_BOOTSTRAP=ON \ 
     -DCLANG_BOOTSTRAP_TARGETS="install-clang;install-clang-headers"
 EOF
-)
-  echo "$usage"
 }
 
 SEEN_INSTALL_TARGET=0

Modified: llvm/trunk/utils/docker/scripts/build_install_llvm.sh
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/docker/scripts/build_install_llvm.sh?rev=309568&r1=309567&r2=309568&view=diff
==============================================================================
--- llvm/trunk/utils/docker/scripts/build_install_llvm.sh (original)
+++ llvm/trunk/utils/docker/scripts/build_install_llvm.sh Mon Jul 31 08:18:57 2017
@@ -11,7 +11,7 @@
 set -e
 
 function show_usage() {
-  usage=$(cat << EOF
+  cat << EOF
 Usage: build_install_llvm.sh [options] -- [cmake-args]
 
 Checkout svn sources and run cmake with the specified arguments. Used
@@ -37,8 +37,6 @@ Required options: At least one --install
 
 All options after '--' are passed to CMake invocation.
 EOF
-)
-  echo "$usage"
 }
 
 LLVM_SVN_REV=""




More information about the llvm-commits mailing list