Repository: spark
Updated Branches:
  refs/heads/master 54e7b456d -> b38034e87


Fix command spaces issue in make-distribution.sh

Storing command in variables is tricky in bash, use an array
to handle all issues with spaces, quoting, etc.
See: http://mywiki.wooledge.org/BashFAQ/050

Author: David Y. Ross <[email protected]>

Closes #4126 from dyross/dyr-fix-make-distribution and squashes the following 
commits:

4ce522b [David Y. Ross] Fix command spaces issue in make-distribution.sh


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/b38034e8
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/b38034e8
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/b38034e8

Branch: refs/heads/master
Commit: b38034e878546a12c6d52f17fc961fd1a2453b97
Parents: 54e7b45
Author: David Y. Ross <[email protected]>
Authored: Mon Jan 26 14:26:10 2015 -0800
Committer: Patrick Wendell <[email protected]>
Committed: Mon Jan 26 14:26:10 2015 -0800

----------------------------------------------------------------------
 make-distribution.sh | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/b38034e8/make-distribution.sh
----------------------------------------------------------------------
diff --git a/make-distribution.sh b/make-distribution.sh
index 4e2f400..0adca78 100755
--- a/make-distribution.sh
+++ b/make-distribution.sh
@@ -115,7 +115,7 @@ if which git &>/dev/null; then
     unset GITREV
 fi
 
-if ! which $MVN &>/dev/null; then
+if ! which "$MVN" &>/dev/null; then
     echo -e "Could not locate Maven command: '$MVN'."
     echo -e "Specify the Maven command with the --mvn flag"
     exit -1;
@@ -171,13 +171,16 @@ cd "$SPARK_HOME"
 
 export MAVEN_OPTS="-Xmx2g -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=512m"
 
-BUILD_COMMAND="$MVN clean package -DskipTests $@"
+# Store the command as an array because $MVN variable might have spaces in it.
+# Normal quoting tricks don't work.
+# See: http://mywiki.wooledge.org/BashFAQ/050
+BUILD_COMMAND=("$MVN" clean package -DskipTests $@)
 
 # Actually build the jar
 echo -e "\nBuilding with..."
-echo -e "\$ $BUILD_COMMAND\n"
+echo -e "\$ ${BUILD_COMMAND[@]}\n"
 
-${BUILD_COMMAND}
+"${BUILD_COMMAND[@]}"
 
 # Make directories
 rm -rf "$DISTDIR"


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to