bigtop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mackror...@apache.org
Subject git commit: BIGTOP-1011. bigtop-detect-javahome has a quirky search order
Date Fri, 12 Jul 2013 16:38:39 GMT
Updated Branches:
  refs/heads/master 95abc29d5 -> c0beeb553


BIGTOP-1011. bigtop-detect-javahome has a quirky search order


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

Branch: refs/heads/master
Commit: c0beeb553c93fd24d8ae377eec65adddfb1b6a38
Parents: 95abc29
Author: Sean Mackrory <mackrorysd@apache.org>
Authored: Fri Jul 12 08:44:59 2013 -0700
Committer: Sean Mackrory <sean@cloudera.com>
Committed: Fri Jul 12 08:45:10 2013 -0700

----------------------------------------------------------------------
 .../src/common/bigtop-utils/bigtop-detect-javahome    | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/bigtop/blob/c0beeb55/bigtop-packages/src/common/bigtop-utils/bigtop-detect-javahome
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/common/bigtop-utils/bigtop-detect-javahome b/bigtop-packages/src/common/bigtop-utils/bigtop-detect-javahome
index de64e1d..21b15ef 100644
--- a/bigtop-packages/src/common/bigtop-utils/bigtop-detect-javahome
+++ b/bigtop-packages/src/common/bigtop-utils/bigtop-detect-javahome
@@ -21,11 +21,11 @@
 
 # attempt to find java
 if [ -z "$JAVA_HOME" ]; then
-  for candidate in \
+  for candidate_regex in \
     /usr/lib/j2sdk1.6-sun \
     /usr/lib/jvm/java-6-sun \
     /usr/lib/jvm/java-1.6.0-sun-1.6.0.* \
-    /usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/ \
+    /usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre \
     /usr/lib/jvm/j2sdk1.6-oracle \
     /usr/lib/jvm/j2sdk1.6-oracle/jre \
     /usr/java/jdk1.6* \
@@ -45,10 +45,12 @@ if [ -z "$JAVA_HOME" ]; then
     /usr/lib/jvm/java-1.6.0-openjdk \
     /usr/lib/jvm/java-1.6.0-openjdk-* \
     /usr/lib/jvm/jre-1.6.0-openjdk* ; do
-    if [ -e $candidate/bin/java ]; then
-      export JAVA_HOME=$candidate
-      break
-    fi
+      for candidate in `ls -rd $candidate_regex 2>/dev/null`; do
+        if [ -e $candidate/bin/java ]; then
+          export JAVA_HOME=$candidate
+          break
+        fi
+      done
   done
 fi
 


Mime
View raw message