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/04 19:04:08 UTC

[4/5] 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/4c1f0ac6
Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/4c1f0ac6
Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/4c1f0ac6

Branch: refs/heads/master
Commit: 4c1f0ac6c8938bfcfafb3f1e70df06c960a5db56
Parents: e279f0f
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 4 01:48:24 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/4c1f0ac6/bin/impala-config.sh
----------------------------------------------------------------------
diff --git a/bin/impala-config.sh b/bin/impala-config.sh
index e527e02..02ec950 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/4c1f0ac6/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