sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject git commit: SQOOP-1070: Shell scripts should not rely on $PATH if $JAVA_HOME is set
Date Sun, 09 Jun 2013 15:07:28 GMT
Updated Branches:
  refs/heads/sqoop2 662f18a0a -> 6d1779a05


SQOOP-1070: Shell scripts should not rely on $PATH if $JAVA_HOME is set

(Sean Mackrory via Jarek Jarcec Cecho)


Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/6d1779a0
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/6d1779a0
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/6d1779a0

Branch: refs/heads/sqoop2
Commit: 6d1779a050f695e5702d6430beb18afb3813ec7c
Parents: 662f18a
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Sun Jun 9 08:04:59 2013 -0700
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Sun Jun 9 08:04:59 2013 -0700

----------------------------------------------------------------------
 dist/src/main/bin/sqoop.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/6d1779a0/dist/src/main/bin/sqoop.sh
----------------------------------------------------------------------
diff --git a/dist/src/main/bin/sqoop.sh b/dist/src/main/bin/sqoop.sh
index 9f07bb1..88adb04 100755
--- a/dist/src/main/bin/sqoop.sh
+++ b/dist/src/main/bin/sqoop.sh
@@ -102,7 +102,12 @@ case $COMMAND in
     # We need to change current directory back to original as optional user side script
     # might be specified with relative path.
     cd ${OLD_DIR}
-    java -classpath ${CLASSPATH} org.apache.sqoop.client.shell.SqoopShell $2
+
+    EXEC_JAVA='java'
+    if [ -n "${JAVA_HOME}" ] ; then
+        EXEC_JAVA="${JAVA_HOME}/bin/java"
+    fi
+    ${EXEC_JAVA} -classpath ${CLASSPATH} org.apache.sqoop.client.shell.SqoopShell $2
     ;;
 
   *)


Mime
View raw message