Skip to content
Snippets Groups Projects
Commit 26c816e7 authored by David Y. Ross's avatar David Y. Ross Committed by Andrew Or
Browse files

SPARK-5747: Fix wordsplitting bugs in make-distribution.sh

The `$MVN` command variable may have spaces, so when referring to it, must wrap in quotes.

Author: David Y. Ross <dyross@gmail.com>

Closes #4540 from dyross/dyr-fix-make-distribution2 and squashes the following commits:

5a41596 [David Y. Ross] SPARK-5747: Fix wordsplitting bugs in make-distribution.sh
parent 947b8bd8
No related branches found
No related tags found
No related merge requests found
...@@ -98,9 +98,9 @@ done ...@@ -98,9 +98,9 @@ done
if [ -z "$JAVA_HOME" ]; then if [ -z "$JAVA_HOME" ]; then
# Fall back on JAVA_HOME from rpm, if found # Fall back on JAVA_HOME from rpm, if found
if [ $(command -v rpm) ]; then if [ $(command -v rpm) ]; then
RPM_JAVA_HOME=$(rpm -E %java_home 2>/dev/null) RPM_JAVA_HOME="$(rpm -E %java_home 2>/dev/null)"
if [ "$RPM_JAVA_HOME" != "%java_home" ]; then if [ "$RPM_JAVA_HOME" != "%java_home" ]; then
JAVA_HOME=$RPM_JAVA_HOME JAVA_HOME="$RPM_JAVA_HOME"
echo "No JAVA_HOME set, proceeding with '$JAVA_HOME' learned from rpm" echo "No JAVA_HOME set, proceeding with '$JAVA_HOME' learned from rpm"
fi fi
fi fi
...@@ -113,24 +113,24 @@ fi ...@@ -113,24 +113,24 @@ fi
if [ $(command -v git) ]; then if [ $(command -v git) ]; then
GITREV=$(git rev-parse --short HEAD 2>/dev/null || :) GITREV=$(git rev-parse --short HEAD 2>/dev/null || :)
if [ ! -z $GITREV ]; then if [ ! -z "$GITREV" ]; then
GITREVSTRING=" (git revision $GITREV)" GITREVSTRING=" (git revision $GITREV)"
fi fi
unset GITREV unset GITREV
fi fi
if [ ! $(command -v $MVN) ] ; then if [ ! $(command -v "$MVN") ] ; then
echo -e "Could not locate Maven command: '$MVN'." echo -e "Could not locate Maven command: '$MVN'."
echo -e "Specify the Maven command with the --mvn flag" echo -e "Specify the Maven command with the --mvn flag"
exit -1; exit -1;
fi fi
VERSION=$($MVN help:evaluate -Dexpression=project.version 2>/dev/null | grep -v "INFO" | tail -n 1) VERSION=$("$MVN" help:evaluate -Dexpression=project.version 2>/dev/null | grep -v "INFO" | tail -n 1)
SPARK_HADOOP_VERSION=$($MVN help:evaluate -Dexpression=hadoop.version $@ 2>/dev/null\ SPARK_HADOOP_VERSION=$("$MVN" help:evaluate -Dexpression=hadoop.version $@ 2>/dev/null\
| grep -v "INFO"\ | grep -v "INFO"\
| tail -n 1) | tail -n 1)
SPARK_HIVE=$($MVN help:evaluate -Dexpression=project.activeProfiles -pl sql/hive $@ 2>/dev/null\ SPARK_HIVE=$("$MVN" help:evaluate -Dexpression=project.activeProfiles -pl sql/hive $@ 2>/dev/null\
| grep -v "INFO"\ | grep -v "INFO"\
| fgrep --count "<id>hive</id>";\ | fgrep --count "<id>hive</id>";\
# Reset exit status to 0, otherwise the script stops here if the last grep finds nothing\ # Reset exit status to 0, otherwise the script stops here if the last grep finds nothing\
...@@ -147,7 +147,7 @@ if [[ ! "$JAVA_VERSION" =~ "1.6" && -z "$SKIP_JAVA_TEST" ]]; then ...@@ -147,7 +147,7 @@ if [[ ! "$JAVA_VERSION" =~ "1.6" && -z "$SKIP_JAVA_TEST" ]]; then
echo "Output from 'java -version' was:" echo "Output from 'java -version' was:"
echo "$JAVA_VERSION" echo "$JAVA_VERSION"
read -p "Would you like to continue anyways? [y,n]: " -r read -p "Would you like to continue anyways? [y,n]: " -r
if [[ ! $REPLY =~ ^[Yy]$ ]]; then if [[ ! "$REPLY" =~ ^[Yy]$ ]]; then
echo "Okay, exiting." echo "Okay, exiting."
exit 1 exit 1
fi fi
...@@ -232,7 +232,7 @@ cp -r "$SPARK_HOME/ec2" "$DISTDIR" ...@@ -232,7 +232,7 @@ cp -r "$SPARK_HOME/ec2" "$DISTDIR"
if [ "$SPARK_TACHYON" == "true" ]; then if [ "$SPARK_TACHYON" == "true" ]; then
TMPD=`mktemp -d 2>/dev/null || mktemp -d -t 'disttmp'` TMPD=`mktemp -d 2>/dev/null || mktemp -d -t 'disttmp'`
pushd $TMPD > /dev/null pushd "$TMPD" > /dev/null
echo "Fetching tachyon tgz" echo "Fetching tachyon tgz"
TACHYON_DL="${TACHYON_TGZ}.part" TACHYON_DL="${TACHYON_TGZ}.part"
...@@ -259,7 +259,7 @@ if [ "$SPARK_TACHYON" == "true" ]; then ...@@ -259,7 +259,7 @@ if [ "$SPARK_TACHYON" == "true" ]; then
fi fi
popd > /dev/null popd > /dev/null
rm -rf $TMPD rm -rf "$TMPD"
fi fi
if [ "$MAKE_TGZ" == "true" ]; then if [ "$MAKE_TGZ" == "true" ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment