Update of /cvsroot/squirrel-sql/sql12/app/cmd
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv13693/app/cmd
Modified Files:
squirrel-sql.sh
Log Message:
2965617 (Fail to open session with RSyntax editor): rebuild the classpath from lib/ folder after updater runs to add any new jars to the CLASSPATH variable.
Index: squirrel-sql.sh
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/app/cmd/squirrel-sql.sh,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** squirrel-sql.sh 7 Feb 2010 22:19:42 -0000 1.26
--- squirrel-sql.sh 13 Mar 2010 15:41:50 -0000 1.27
***************
*** 1,4 ****
--- 1,24 ----
#! /bin/sh
+ # This function sets a global variable named "CP" to a command-path separated list of jars located beneath the
+ # specified folder. If the specified folder contains a lib directory, then jars beneath the lib folder are
+ # @ added as well as the squirrel-sql.jar file located in the directory specified as the first argument to
+ # this function.
+ buildCPFromDir()
+ {
+ if [ -d "$1"/lib ]; then
+ # First entry in classpath is the Squirrel application.
+ CP="$1/squirrel-sql.jar"
+
+ # Then add all library jars to the classpath.
+ for a in "$1"/lib/*; do
+ CP="$CP":"$a"
+ done
+ else
+ for a in "$1"/*; do
+ CP="$CP":"$a"
+ done
+ fi
+ }
# IZPACK_JAVA_HOME is filtered in by the IzPack installer when this script is installed
***************
*** 57,74 ****
fi
! # First entry in classpath is the Squirrel application.
! TMP_CP="$UNIX_STYLE_HOME/squirrel-sql.jar"
!
! # Then add all library jars to the classpath.
! for a in "$UNIX_STYLE_HOME"/lib/*; do
! TMP_CP="$TMP_CP":"$a"
! done
# Set the update app's classpath to use jars in download area first, then the installed jars
! UPDATE_CP=$TMP_CP
! for a in "$UNIX_STYLE_HOME"/update/downloads/core/*; do
! UPDATE_CP="$a":"$UPDATE_CP"
! done
!
# Now add the system classpath to the classpath. If running
--- 77,87 ----
fi
! # Build a command-path separated list of installed jars from the lib folder and squirrel-sql.jar
! buildCPFromDir "$UNIX_STYLE_HOME"
! TMP_CP=$CP
# Set the update app's classpath to use jars in download area first, then the installed jars
! buildCPFromDir "$UNIX_STYLE_HOME/update/downloads/core"
! UPDATE_CP=$CP:$TMP_CP
# Now add the system classpath to the classpath. If running
***************
*** 103,106 ****
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
--- 116,123 ----
fi
+ # Now, pickup all jars once again from the installation and lib directories in case any new jars were
+ # downloaded during the update process. The variable "CP" is assigned this value.
+ buildCPFromDir "$UNIX_STYLE_HOME"
+
# Launch SQuirreL application
! $JAVACMD -Xmx256m -cp "$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
|