IMPALA-6809: Allow bootstrap_system.sh in non ~/Impala directory Testing: - Ran bootstrap_development.sh with IMPALA_HOME set to non ~/Impala directory - Ran bootstrap_development.sh with IMPALA_HOME not set
Change-Id: I3241c180b5fb28f1b5f939200f72461ad6fd7d7a Reviewed-on: http://gerrit.cloudera.org:8080/9994 Reviewed-by: Fredy Wijaya <[email protected]> Reviewed-by: Philip Zeyliger <[email protected]> Tested-by: Impala Public Jenkins <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/impala/repo Commit: http://git-wip-us.apache.org/repos/asf/impala/commit/b173c530 Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/b173c530 Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/b173c530 Branch: refs/heads/2.x Commit: b173c530dda06c00bb7a258fa0b0a37d8c103c69 Parents: eb92c14 Author: Fredy Wijaya <[email protected]> Authored: Wed Apr 11 09:02:48 2018 -0700 Committer: Impala Public Jenkins <[email protected]> Committed: Wed Apr 18 21:17:47 2018 +0000 ---------------------------------------------------------------------- bin/bootstrap_system.sh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/impala/blob/b173c530/bin/bootstrap_system.sh ---------------------------------------------------------------------- diff --git a/bin/bootstrap_system.sh b/bin/bootstrap_system.sh index 3f88dd3..bce161b 100755 --- a/bin/bootstrap_system.sh +++ b/bin/bootstrap_system.sh @@ -22,6 +22,8 @@ # configurations, so it is best to run this in a fresh install. It also sets up the # ~/.bashrc for the calling user and impala-config-local.sh with some environment # variables to make Impala compile and run after this script is complete. +# When IMPALA_HOME is set, the script will bootstrap Impala development in the +# location specified. # # The intended user is a person who wants to start contributing code to Impala. This # script serves as an executable reference point for how to get started. @@ -98,11 +100,13 @@ apt-get --yes install git echo ">>> Checking out Impala" # If there is no Impala git repo, get one now -if ! [[ -d ~/Impala ]] + +: ${IMPALA_HOME:=~/Impala} +if ! [[ -d "$IMPALA_HOME" ]] then - time -p git clone https://git-wip-us.apache.org/repos/asf/impala.git ~/Impala + time -p git clone https://git-wip-us.apache.org/repos/asf/impala.git "$IMPALA_HOME" fi -cd ~/Impala +cd "$IMPALA_HOME" SET_IMPALA_HOME="export IMPALA_HOME=$(pwd)" echo "$SET_IMPALA_HOME" >> ~/.bashrc eval "$SET_IMPALA_HOME" @@ -199,17 +203,19 @@ echo "* - nofile 1048576" | sudo tee -a /etc/security/limits.conf # LZO is not needed to compile or run Impala, but it is needed for the data load echo ">>> Checking out Impala-lzo" -if ! [[ -d ~/Impala-lzo ]] +: ${IMPALA_LZO_HOME:="${IMPALA_HOME}/../Impala-lzo"} +if ! [[ -d "$IMPALA_LZO_HOME" ]] then - git clone https://github.com/cloudera/impala-lzo.git ~/Impala-lzo + git clone https://github.com/cloudera/impala-lzo.git "$IMPALA_LZO_HOME" fi echo ">>> Checking out and building hadoop-lzo" -if ! [[ -d ~/hadoop-lzo ]] +: ${HADOOP_LZO_HOME:="${IMPALA_HOME}/../hadoop-lzo"} +if ! [[ -d "$HADOOP_LZO_HOME" ]] then - git clone https://github.com/cloudera/hadoop-lzo.git ~/hadoop-lzo + git clone https://github.com/cloudera/hadoop-lzo.git "$HADOOP_LZO_HOME" fi -cd ~/hadoop-lzo/ +cd "$HADOOP_LZO_HOME" time -p ant package cd "$IMPALA_HOME"
