This is an automated email from the ASF dual-hosted git repository.

srowen pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new aac4274  [SPARK-35373][BUILD][FOLLOWUP] Fix "binary operator expected" 
error on build/mvn
aac4274 is described below

commit aac4274f3c8fdf399de1639adbcafa0b202878d7
Author: Yikun Jiang <yikunk...@gmail.com>
AuthorDate: Thu May 20 12:25:23 2021 -0500

    [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 <yikunk...@gmail.com>
    Signed-off-by: Sean Owen <sro...@gmail.com>
    (cherry picked from commit 3c3533d845bd121a9e094ac6c17a0fb3684e269c)
    Signed-off-by: Sean Owen <sro...@gmail.com>
---
 build/mvn | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/build/mvn b/build/mvn
index e62abf3..7c1cb2b 100755
--- a/build/mvn
+++ b/build/mvn
@@ -51,7 +51,7 @@ install_app() {
     # check if we already have the tarball
     # check if we have curl installed
     # download application
-    if [ ! -f "${local_tarball}" -a $(command -v curl) ]; then
+    if [ ! -f "${local_tarball}" -a "$(command -v curl)" ]; then
       echo "exec: curl ${curl_opts} ${remote_tarball}" 1>&2
       curl ${curl_opts} "${remote_tarball}" > "${local_tarball}"
       if [ ! -z "${checksum_suffix}" ]; then
@@ -60,7 +60,7 @@ install_app() {
       fi
     fi
     # if the file still doesn't exist, lets try `wget` and cross our fingers
-    if [ ! -f "${local_tarball}" -a $(command -v wget) ]; then
+    if [ ! -f "${local_tarball}" -a "$(command -v wget)" ]; then
       echo "exec: wget ${wget_opts} ${remote_tarball}" 1>&2
       wget ${wget_opts} -O "${local_tarball}" "${remote_tarball}"
       if [ ! -z "${checksum_suffix}" ]; then

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to