Author: khorgath
Date: Mon Jan 16 20:30:17 2012
New Revision: 1232149
URL: http://svn.apache.org/viewvc?rev=1232149&view=rev
Log:
HCATALOG-216 we should source hcat-env.sh in hcat-config before we determine
where hadoop is (arpitgupta via khorgath)
Modified:
incubator/hcatalog/trunk/CHANGES.txt
incubator/hcatalog/trunk/bin/hcat-config.sh
Modified: incubator/hcatalog/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/incubator/hcatalog/trunk/CHANGES.txt?rev=1232149&r1=1232148&r2=1232149&view=diff
==============================================================================
--- incubator/hcatalog/trunk/CHANGES.txt (original)
+++ incubator/hcatalog/trunk/CHANGES.txt Mon Jan 16 20:30:17 2012
@@ -99,6 +99,8 @@ Trunk (unreleased changes)
OPTIMIZATIONS
BUG FIXES
+ HCAT-216. we should source hcat-env.sh in hcat-config before we determine
where hadoop is (arpitgupta via khorgath)
+
HCAT-213. determine HIVE_CONF_DIR in hive-config.sh based on rpm or tar ball
installs (arpitgupta via khorgath)
HCAT-214. HCat commandline does not set location for config dir correctly
(khorgath)
Modified: incubator/hcatalog/trunk/bin/hcat-config.sh
URL:
http://svn.apache.org/viewvc/incubator/hcatalog/trunk/bin/hcat-config.sh?rev=1232149&r1=1232148&r2=1232149&view=diff
==============================================================================
--- incubator/hcatalog/trunk/bin/hcat-config.sh (original)
+++ incubator/hcatalog/trunk/bin/hcat-config.sh Mon Jan 16 20:30:17 2012
@@ -55,15 +55,21 @@ else
fi
HCAT_CONF_DIR="${HCAT_CONF_DIR:-$DEFAULT_CONF_DIR}"
-if [ -e $HCAT_PREFIX/bin/hadoop ]; then
- HADOOP_PREFIX=$HCAT_PREFIX
-elif [ -e $HADOOP_HOME/bin/hadoop ]; then
+#users can add various env vars to hcat-env.sh in the conf
+#rather than having to export them before running the command
+if [ -f "${HCAT_CONF_DIR}/hcat-env.sh" ]; then
+ . "${HCAT_CONF_DIR}/hcat-env.sh"
+fi
+
+#determine where hadoop is
+#check HADOOP_HOME and then check HADOOP_PREFIX
+if [ -f ${HADOOP_HOME}/bin/hadoop ]; then
HADOOP_PREFIX=$HADOOP_HOME
-else
+#if this is an rpm install check for /usr/bin/hadoop
+elif [ -f ${HCAT_PREFIX}/bin/hadoop ]; then
+ HADOOP_PREFIX=$HCAT_PREFIX
+#otherwise see if HADOOP_PREFIX is defined
+elif [ ! -f ${HADOOP_PREFIX}/bin/hadoop ]; then
echo "Hadoop not found."
exit 1
fi
-
-if [ -f "${HCAT_CONF_DIR}/hcat-env.sh" ]; then
- . "${HCAT_CONF_DIR}/hcat-env.sh"
-fi