diff --git hcatalog/bin/hcat hcatalog/bin/hcat index 455f108..f59a58a 100644 --- hcatalog/bin/hcat +++ hcatalog/bin/hcat @@ -34,8 +34,14 @@ done bin=`dirname "$this"` script=`basename "$this"` bin=`unset CDPATH; cd "$bin"; pwd` -this="$bin/$script" +this="$bin/$script" +#to preserve value of 'this' since any other file that defines 'this' and is sourced +#here (e.g. hcat-config.sh) will overwrite it +this_hcat=$this +function echoerr() { + echo "${this_hcat}: $@" 1>&2 +} if [ -e "$bin/../libexec/hcat-config.sh" ]; then . "$bin"/../libexec/hcat-config.sh @@ -60,7 +66,8 @@ done # check for hive in the path HIVE_IN_PATH=`which hive 2>/dev/null` -if [ -f ${HIVE_IN_PATH} ]; then +# looks like [ -f '' ] is true... +if [ -n ${HIVE_IN_PATH} ]; then #dir of hive scrip HIVE_DIR=`dirname "$HIVE_IN_PATH"` #one level up for base dir @@ -70,8 +77,14 @@ fi # HIVE_HOME env variable overrides hive in the path HIVE_HOME=${HIVE_HOME:-$HIVE_DIR} +#if hive is not in path and not set by env, set it to default in build tree +if [ -n ${HIVE_HOME} ]; then + HIVE_HOME="${bin}/../.." + echoerr "HIVE_HOME is not defined; assuming ${HIVE_HOME}"; +fi + if [ "$HIVE_HOME" == "" ]; then - echo "Cannot find hive installation: \$HIVE_HOME must be set or hive must be in the path"; + echo "${this_hcat}: Cannot find hive installation: \$HIVE_HOME must be set or hive must be in the path"; exit 4; fi @@ -87,13 +100,13 @@ fi HIVE_LIB_DIR=${HIVE_HOME}/lib if [ ! -d "$HIVE_LIB_DIR" ]; then - echo "Cannot find lib dir within HIVE_HOME : $HIVE_LIB_DIR"; + echo "${this_hcat}: Cannot find lib dir within HIVE_HOME : $HIVE_LIB_DIR"; exit 4; fi HIVE_CONF_DIR=${HIVE_CONF_DIR:-$HIVE_HOME/conf} if [ ! -d "$HIVE_CONF_DIR" ]; then - echo "Cannot find conf dir within HIVE_HOME : $HIVE_CONF_DIR"; + echo "${this_hcat}: Cannot find conf dir within HIVE_HOME : $HIVE_CONF_DIR"; exit 4; fi diff --git hcatalog/build-support/ant/deploy.xml hcatalog/build-support/ant/deploy.xml index b4b05d4..5ede3d0 100644 --- hcatalog/build-support/ant/deploy.xml +++ hcatalog/build-support/ant/deploy.xml @@ -69,7 +69,7 @@ <_mvnpublish module="testutils" /> - + + + + diff --git hcatalog/build.xml hcatalog/build.xml index 516b462..a716385 100644 --- hcatalog/build.xml +++ hcatalog/build.xml @@ -28,6 +28,8 @@ +