Skip to content

Commit 1e4f602

Browse files
committedJul 31, 2017
[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 llvm-svn: 309568
1 parent 84ae336 commit 1e4f602

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed
 

‎llvm/utils/docker/build_docker_image.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ DOCKER_TAG=""
1515
BUILDSCRIPT_ARGS=""
1616

1717
function show_usage() {
18-
usage=$(cat << EOF
18+
cat << EOF
1919
Usage: build_docker_image.sh [options] [-- [cmake_args]...]
2020
2121
Available options:
@@ -64,8 +64,6 @@ $ ./build_docker_image.sh -s debian8 -d mydocker/clang-debian8 -t "latest" \
6464
-DCLANG_ENABLE_BOOTSTRAP=ON \
6565
-DCLANG_BOOTSTRAP_TARGETS="install-clang;install-clang-headers"
6666
EOF
67-
)
68-
echo "$usage"
6967
}
7068

7169
SEEN_INSTALL_TARGET=0

‎llvm/utils/docker/scripts/build_install_llvm.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
set -e
1212

1313
function show_usage() {
14-
usage=$(cat << EOF
14+
cat << EOF
1515
Usage: build_install_llvm.sh [options] -- [cmake-args]
1616
1717
Checkout svn sources and run cmake with the specified arguments. Used
@@ -37,8 +37,6 @@ Required options: At least one --install-target.
3737
3838
All options after '--' are passed to CMake invocation.
3939
EOF
40-
)
41-
echo "$usage"
4240
}
4341

4442
LLVM_SVN_REV=""

0 commit comments

Comments
 (0)
Please sign in to comment.