You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ta...@apache.org on 2018/04/12 05:28:33 UTC
[20/28] impala git commit: IMPALA-4430: Update build scripts to die
hard when IMPALA_HOME has spaces
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 <ta...@cloudera.com>
Tested-by: Impala Public Jenkins
Project: http://git-wip-us.apache.org/repos/asf/impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/impala/commit/100fb2ce
Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/100fb2ce
Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/100fb2ce
Branch: refs/heads/2.x
Commit: 100fb2ce208e86863b413de2f4ece9c43cf90fd0
Parents: e1123eb
Author: njanarthanan <nj...@cloudera.com>
Authored: Wed Feb 21 13:39:30 2018 -0800
Committer: Impala Public Jenkins <im...@gerrit.cloudera.org>
Committed: Wed Apr 11 22:56:00 2018 +0000
----------------------------------------------------------------------
bin/impala-config.sh | 17 ++++++++++++-----
buildall.sh | 10 ++++++++--
2 files changed, 20 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/impala/blob/100fb2ce/bin/impala-config.sh
----------------------------------------------------------------------
diff --git a/bin/impala-config.sh b/bin/impala-config.sh
index 621586e..b2d9d15 100755
--- a/bin/impala-config.sh
+++ b/bin/impala-config.sh
@@ -45,14 +45,21 @@ if [[ ! -e "$JAVA" ]]; then
return 1
fi
-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)")
+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"}
if [ -z "$IMPALA_TOOLCHAIN" ]; then
echo "IMPALA_TOOLCHAIN must be specified. Please set it to a valid directory or"\
http://git-wip-us.apache.org/repos/asf/impala/blob/100fb2ce/buildall.sh
----------------------------------------------------------------------
diff --git a/buildall.sh b/buildall.sh
index d14c2ea..9d8b15e 100755
--- a/buildall.sh
+++ b/buildall.sh
@@ -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