Skip to content

Commit

Permalink
make the script work on OS X
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladimir Kotal committed Feb 21, 2014
1 parent eeab71d commit c276b1e
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions OpenGrok
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,15 @@ Usage()
#
# Runtime Configuration
#
if [ -f "/bin/uname" ]
then
OS_NAME="`/bin/uname -s`"
OS_VERSION="`/bin/uname -r`"
if [ -x "/bin/uname" ]; then
OS_NAME="`/bin/uname -s`"
OS_VERSION="`/bin/uname -r`"
elif [ -x "/usr/bin/uname" ]; then
OS_NAME="`/usr/bin/uname -s`"
OS_VERSION="`/usr/bin/uname -r`"
else
OS_NAME="`/usr/bin/uname -s`"
OS_VERSION="`/usr/bin/uname -r`"
echo "Cannot determine operating system version"
exit 1
fi

# TODO: Handle symlinks correctly (especially in ${0})
Expand Down Expand Up @@ -455,10 +457,11 @@ FindJavaHome()
{
javaHome=""
case "${OS_NAME}:${OS_VERSION}" in
SunOS:5.10) javaHome="/usr/jdk/instances/jdk1.7.0" ;;
SunOS:5.11) javaHome="/usr/jdk/latest" ;;
SunOS:5.12) javaHome="/usr/jdk/latest" ;;
Linux:*)
SunOS:5.10) javaHome="/usr/jdk/instances/jdk1.7.0" ;;
SunOS:5.11) javaHome="/usr/jdk/latest" ;;
SunOS:5.12) javaHome="/usr/jdk/latest" ;;
Darwin:*) javaHome=`/usr/libexec/java_home` ;;
Linux:*)
if [ -f /etc/alternatives/java ]
then
javaHome=`ls -l /etc/alternatives/java | cut -f 2 -d \> `
Expand Down

0 comments on commit c276b1e

Please # to comment.