IMPALA-4430: Update build scripts to die hard when IMPALA_HOME has spaces

Change-Id: I08b3d2b3f3e14c568d1672ee86ff2c52e8017b81
Reviewed-on: http://gerrit.cloudera.org:8080/9385
Reviewed-by: Tim Armstrong <tarmstrong@cloudera.com>
Tested-by: Impala Public Jenkins
This commit is contained in:
njanarthanan
2018-02-21 13:39:30 -08:00
committed by Impala Public Jenkins
parent e279f0f250
commit 4c1f0ac6c8
2 changed files with 20 additions and 7 deletions

View File

@@ -45,12 +45,19 @@ if [[ ! -e "$JAVA" ]]; then
return 1
fi
if [ -z "$IMPALA_HOME" ]; then
if ! [[ "'$IMPALA_HOME'" =~ [[:blank:]] ]]; then
if [ -z "$IMPALA_HOME" ]; then
if [[ ! -z "$ZSH_NAME" ]]; then
export IMPALA_HOME=$(dirname "$(cd $(dirname ${(%):-%x}) >/dev/null && pwd)")
else
export IMPALA_HOME=$(dirname "$(cd $(dirname "${BASH_SOURCE[0]}") >/dev/null && pwd)")
fi
fi
fi
if [[ "'$IMPALA_HOME'" =~ [[:blank:]] ]]; then
echo "IMPALA_HOME cannot have spaces in the path"
exit 1
fi
export IMPALA_TOOLCHAIN=${IMPALA_TOOLCHAIN-"$IMPALA_HOME/toolchain"}

View File

@@ -18,13 +18,19 @@
# under the License.
set -euo pipefail
trap 'echo Error in $0 at line $LINENO: $(cd "'$PWD'" && awk "NR == $LINENO" $0)' ERR
# run buildall.sh -help to see options
ROOT=`dirname "$0"`
ROOT=`cd "$ROOT" >/dev/null; pwd`
if [[ "'$ROOT'" =~ [[:blank:]] ]]
then
echo "IMPALA_HOME cannot have spaces in the path"
exit 1
fi
trap 'echo Error in $0 at line $LINENO: $(cd "'$PWD'" && awk "NR == $LINENO" $0)' ERR
# Grab this *before* we source impala-config.sh to see if the caller has
# kerberized environment variables already or not.
NEEDS_RE_SOURCE_NOTE=1