Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions make-distribution.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ done
if [ -z "$JAVA_HOME" ]; then
# Fall back on JAVA_HOME from rpm, if found
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
JAVA_HOME=$RPM_JAVA_HOME
JAVA_HOME="$RPM_JAVA_HOME"
echo "No JAVA_HOME set, proceeding with '$JAVA_HOME' learned from rpm"
fi
fi
Expand All @@ -113,24 +113,24 @@ fi

if [ $(command -v git) ]; then
GITREV=$(git rev-parse --short HEAD 2>/dev/null || :)
if [ ! -z $GITREV ]; then
if [ ! -z "$GITREV" ]; then
GITREVSTRING=" (git revision $GITREV)"
fi
unset GITREV
fi


if [ ! $(command -v $MVN) ] ; then
if [ ! $(command -v "$MVN") ] ; then
echo -e "Could not locate Maven command: '$MVN'."
echo -e "Specify the Maven command with the --mvn flag"
exit -1;
fi

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\
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\
| grep -v "INFO"\
| 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"\
| fgrep --count "<id>hive</id>";\
# Reset exit status to 0, otherwise the script stops here if the last grep finds nothing\
Expand All @@ -147,7 +147,7 @@ if [[ ! "$JAVA_VERSION" =~ "1.6" && -z "$SKIP_JAVA_TEST" ]]; then
echo "Output from 'java -version' was:"
echo "$JAVA_VERSION"
read -p "Would you like to continue anyways? [y,n]: " -r
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
if [[ ! "$REPLY" =~ ^[Yy]$ ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are using the Bash-specific [[ ... ]] syntax here, there is actually no word splitting, so the original line should be safe. But I don't think it hurts to quote $REPLY anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll leave it quoted since it's consistent with other places. But thanks for the note.

echo "Okay, exiting."
exit 1
fi
Expand Down Expand Up @@ -232,7 +232,7 @@ cp -r "$SPARK_HOME/ec2" "$DISTDIR"
if [ "$SPARK_TACHYON" == "true" ]; then
TMPD=`mktemp -d 2>/dev/null || mktemp -d -t 'disttmp'`

pushd $TMPD > /dev/null
pushd "$TMPD" > /dev/null
echo "Fetching tachyon tgz"

TACHYON_DL="${TACHYON_TGZ}.part"
Expand All @@ -259,7 +259,7 @@ if [ "$SPARK_TACHYON" == "true" ]; then
fi

popd > /dev/null
rm -rf $TMPD
rm -rf "$TMPD"
fi

if [ "$MAKE_TGZ" == "true" ]; then
Expand Down