From da786bd2529e27c15c593512b0ea3792647f3f78 Mon Sep 17 00:00:00 2001 From: Jakob Homan Date: Wed, 2 Feb 2011 15:17:31 -0800 Subject: [PATCH] Improve the howl.sh to have Apache license, remove un-used variable, and check for the definition of required environmental variables. --- howl/howl.sh | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/howl/howl.sh b/howl/howl.sh index 374fc7b3..4f122c4d 100755 --- a/howl/howl.sh +++ b/howl/howl.sh @@ -1,18 +1,44 @@ #!/usr/bin/env bash -HOWL_DIR=`dirname "$0"` +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. HOWL_JAR_LOC=`find . -name "howl*.jar"` -HADOOP_CLASSPATH=$HADOOP_CLASSPATH:${HOWL_JAR_LOC}:../lib/commons-cli-2.0-SNAPSHOT.jar:../build/cli/hive-cli-0.7.0.jar:../ql/lib/antlr-runtime-3.0.1.jar +if [ "$HOWL_JAR_LOC" == "" ] +then + echo "Unable to find Howl jar. Exiting." + exit 1 +fi -export HADOOP_CLASSPATH=$HADOOP_CLASSPATH +if [ ! "$HADOOP_HOME" ] +then + echo "HADOOP_HOME is not defined. Exiting." + exit 1 +fi -for f in `ls ../build/dist/lib/*.jar`; do - HADOOP_CLASSPATH=$HADOOP_CLASSPATH:$f + +HADOOP_CLASSPATH=$HADOOP_CLASSPATH:${HOWL_JAR_LOC}:../lib/commons-cli-2.0-SNAPSHOT.jar:../build/cli/hive-cli-0.7.0.jar:../ql/lib/antlr-runtime-3.0.1.jar + +for f in `ls ../build/dist/lib/*.jar`; do + HADOOP_CLASSPATH=$HADOOP_CLASSPATH:$f done -HADOOP_OPTS="$HADOOP_OPTS -Dhive.metastore.uris=thrift://localhost:9083 " +export HADOOP_CLASSPATH=$HADOOP_CLASSPATH + +HADOOP_OPTS="$HADOOP_OPTS -Dhive.metastore.uris=thrift://localhost:9083 " export HADOOP_OPTS=$HADOOP_OPTS