Update of /cvsroot/squirrel-sql/sql12/app/cmd
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv19188/app/cmd
Modified Files:
squirrel-sql.sh
Log Message:
Bugfix 2939376: Documented the algorithm for finding the java executable to use and made the logic less terse/confusing. Merged the case statements into one case statement.
Index: squirrel-sql.sh
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/app/cmd/squirrel-sql.sh,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** squirrel-sql.sh 23 Mar 2009 01:22:58 -0000 1.24
--- squirrel-sql.sh 7 Feb 2010 22:12:25 -0000 1.25
***************
*** 1,22 ****
#! /bin/sh
- [ ${JAVA_HOME} ] && JAVA=${JAVA_HOME}/bin/java || [ %JAVA_HOME ] && JAVA=%JAVA_HOME/bin/java || JAVA=java
! # Are we running within Cygwin on some version of Windows?
cygwin=false;
macosx=false;
-
- case "`uname -s`" in
- CYGWIN*) cygwin=true ;;
- esac
case "`uname -s`" in
! Darwin) macosx=true;;
esac
# SQuirreL home.
if $macosx ; then
! SQUIRREL_SQL_HOME='%INSTALL_PATH/Contents/Resources/Java'
else
! SQUIRREL_SQL_HOME='%INSTALL_PATH'
fi
--- 1,39 ----
#! /bin/sh
! # IZPACK_JAVA_HOME is filtered in by the IzPack installer when this script is installed
! IZPACK_JAVA_HOME=%JAVA_HOME
!
! # We detect the java executable to use according to the following algorithm:
! #
! # 1. If it is located in JAVA_HOME, then we use that; or
! # 2. If the one used by the IzPack installer is available then use that, otherwise
! # 3. Use the java that is in the command path.
! #
! if [ -d "$JAVA_HOME" -a -x "$JAVA_HOME/bin/java" ]; then
! JAVACMD="$JAVA_HOME/bin/java"
! elif [ -d "$IZPACK_JAVA_HOME" -a -x "$IZPACK_JAVA_HOME/bin/java" ]; then
! JAVACMD="$IZPACK_JAVA_HOME/bin/java"
! else
! JAVACMD=java
! fi
!
! # Are we running within Cygwin on some version of Windows or on Mac OS X?
cygwin=false;
macosx=false;
case "`uname -s`" in
! CYGWIN*)
! cygwin=true
! ;;
! Darwin*)
! macosx=true
! ;;
esac
# SQuirreL home.
if $macosx ; then
! SQUIRREL_SQL_HOME='%INSTALL_PATH/Contents/Resources/Java'
else
! SQUIRREL_SQL_HOME='%INSTALL_PATH'
fi
***************
*** 32,41 ****
# Check to see if the JVM meets the minimum required to run SQuirreL and inform the user if not and skip
# launch. versioncheck.jar is a special jar file which has been compiled with javac version 1.2.2, which
! # should be able to be run by that version of higher. The arguments to JavaVersionChecker below specify the
# minimum acceptable version (first arg) and any other acceptable subsequent versions. <MAJOR>.<MINOR> should
# be all that is necessary for the version form.
! $JAVA -cp "$UNIX_STYLE_HOME/lib/versioncheck.jar" JavaVersionChecker 1.6 1.7
if [ "$?" = "1" ]; then
! exit
fi
--- 49,58 ----
# Check to see if the JVM meets the minimum required to run SQuirreL and inform the user if not and skip
# launch. versioncheck.jar is a special jar file which has been compiled with javac version 1.2.2, which
! # should be able to be run by that version or higher. The arguments to JavaVersionChecker below specify the
# minimum acceptable version (first arg) and any other acceptable subsequent versions. <MAJOR>.<MINOR> should
# be all that is necessary for the version form.
! $JAVACMD -cp "$UNIX_STYLE_HOME/lib/versioncheck.jar" JavaVersionChecker 1.6 1.7
if [ "$?" = "1" ]; then
! exit
fi
***************
*** 51,55 ****
UPDATE_CP=$TMP_CP
for a in "$UNIX_STYLE_HOME"/update/downloads/core/*; do
! UPDATE_CP="$a":"$UPDATE_CP"
done
--- 68,72 ----
UPDATE_CP=$TMP_CP
for a in "$UNIX_STYLE_HOME"/update/downloads/core/*; do
! UPDATE_CP="$a":"$UPDATE_CP"
done
***************
*** 68,89 ****
if $macosx ; then
! # Define mac-specific system properties if running on Mac OS X
! MACOSX_UPDATER_PROPS="-Dapple.laf.useScreenMenuBar=true -Dcom.apple.mrj.application.apple.menu.about.name=SQuirreLSQLUpdater"
! MACOSX_SQUIRREL_PROPS="-Dapple.laf.useScreenMenuBar=true -Dcom.apple.mrj.application.apple.menu.about.name=SQuirreLSQL"
! NATIVE_LAF_PROP="--native-laf"
fi
# Check for updates and prompt to apply if any are available
if [ -f "$UNIX_STYLE_HOME/update/downloads/core/squirrel-sql.jar" -a -f "$UNIX_STYLE_HOME/update/changeList.xml" ]; then
! $JAVA -cp "$UPDATE_CP" $MACOSX_UPDATER_PROPS -Dlog4j.defaultInitOverride=true -Dprompt=true net.sourceforge.squirrel_sql.client.update.gui.installer.PreLaunchUpdateApplication -l "$UNIX_STYLE_HOME/update-log4j.properties"
fi
if $macosx ; then
! # macosx provides unknown args to the script, causing SQuirreL to bail..
! SCRIPT_ARGS=""
else
! SCRIPT_ARGS="$1 $2 $3 $4 $5 $6 $7 $8 $9"
fi
# Launch SQuirreL application
! $JAVA -Xmx256m -cp "$TMP_CP" $MACOSX_SQUIRREL_PROPS net.sourceforge.squirrel_sql.client.Main --log-config-file "$UNIX_STYLE_HOME"/log4j.properties --squirrel-home "$UNIX_STYLE_HOME" $NATIVE_LAF_PROP $SCRIPT_ARGS
--- 85,106 ----
if $macosx ; then
! # Define mac-specific system properties if running on Mac OS X
! MACOSX_UPDATER_PROPS="-Dapple.laf.useScreenMenuBar=true -Dcom.apple.mrj.application.apple.menu.about.name=SQuirreLSQLUpdater"
! MACOSX_SQUIRREL_PROPS="-Dapple.laf.useScreenMenuBar=true -Dcom.apple.mrj.application.apple.menu.about.name=SQuirreLSQL"
! NATIVE_LAF_PROP="--native-laf"
fi
# Check for updates and prompt to apply if any are available
if [ -f "$UNIX_STYLE_HOME/update/downloads/core/squirrel-sql.jar" -a -f "$UNIX_STYLE_HOME/update/changeList.xml" ]; then
! $JAVACMD -cp "$UPDATE_CP" $MACOSX_UPDATER_PROPS -Dlog4j.defaultInitOverride=true -Dprompt=true net.sourceforge.squirrel_sql.client.update.gui.installer.PreLaunchUpdateApplication -l "$UNIX_STYLE_HOME/update-log4j.properties"
fi
if $macosx ; then
! # macosx provides unknown args to the script, causing SQuirreL to bail..
! SCRIPT_ARGS=""
else
! SCRIPT_ARGS="$1 $2 $3 $4 $5 $6 $7 $8 $9"
fi
# Launch SQuirreL application
! $JAVACMD -Xmx256m -cp "$TMP_CP" $MACOSX_SQUIRREL_PROPS net.sourceforge.squirrel_sql.client.Main --log-config-file "$UNIX_STYLE_HOME"/log4j.properties --squirrel-home "$UNIX_STYLE_HOME" $NATIVE_LAF_PROP $SCRIPT_ARGS
|