Skip to content

Commit 3c3533d

Browse files
Yikunsrowen
authored andcommitted
[SPARK-35373][BUILD][FOLLOWUP] Fix "binary operator expected" error on build/mvn
### What changes were proposed in this pull request? change $(command -v curl) to "$(command -v curl)" ### Why are the changes needed? We need change $(command -v curl) to "$(command -v curl)" to make sure it work when `curl` or `wget` is uninstall. othewise raised: `build/mvn: line 56: [: /root/spark/build/apache-maven-3.6.3-bin.tar.gz: binary operator expected` ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? ``` apt remove curl rm -f build/apache-maven-3.6.3-bin.tar.gz rm -r build/apache-maven-3.6.3-bin mvn -v ``` Closes #32608 from Yikun/patch-6. Authored-by: Yikun Jiang <yikunkero@gmail.com> Signed-off-by: Sean Owen <srowen@gmail.com>
1 parent 2bd3254 commit 3c3533d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

build/mvn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ install_app() {
5151
# check if we already have the tarball
5252
# check if we have curl installed
5353
# download application
54-
if [ ! -f "${local_tarball}" -a $(command -v curl) ]; then
54+
if [ ! -f "${local_tarball}" -a "$(command -v curl)" ]; then
5555
echo "exec: curl ${curl_opts} ${remote_tarball}" 1>&2
5656
curl ${curl_opts} "${remote_tarball}" > "${local_tarball}"
5757
if [ ! -z "${checksum_suffix}" ]; then
@@ -60,7 +60,7 @@ install_app() {
6060
fi
6161
fi
6262
# if the file still doesn't exist, lets try `wget` and cross our fingers
63-
if [ ! -f "${local_tarball}" -a $(command -v wget) ]; then
63+
if [ ! -f "${local_tarball}" -a "$(command -v wget)" ]; then
6464
echo "exec: wget ${wget_opts} ${remote_tarball}" 1>&2
6565
wget ${wget_opts} -O "${local_tarball}" "${remote_tarball}"
6666
if [ ! -z "${checksum_suffix}" ]; then

0 commit comments

Comments
 (0)