tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From patri...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/jasper/src/bin jasper.bat jasper.sh jspc.bat jspc.sh jpappend.bat
Date Tue, 15 Jan 2002 02:55:39 GMT
patrickl    02/01/14 18:55:39

  Modified:    catalina/src/bin catalina.bat catalina.sh cpappend.bat
                        digest.bat digest.sh shutdown.bat shutdown.sh
                        startup.bat startup.sh tool-wrapper.bat
                        tool-wrapper.sh
               jasper/src/bin jasper.bat jasper.sh jspc.bat jspc.sh
  Added:       catalina/src/bin setclasspath.bat setclasspath.sh
  Removed:     jasper/src/bin jpappend.bat
  Log:
  Refactor the various Catalina and Jasper shell scripts to implement the
  following improvements:
  1. The ability to handle spaces in the CATALINA_HOME, JASPER_HOME, or JAVA_HOME
     environment variables for both Windows and Unix.
  2. Enable jdb and jpda support on Windows (these were only available on Unix
     previously) and made the Unix version work with 1.3 and 1.4 JDKs.
  3. Enable the scripts to run on Windows 98 and ME (the DOS shell on these
     platforms do not support "=" characters in environment variables and does
     not support the "^" escape character)
  4. Accurate determination of CATALINA_HOME for Unix when the executable is
     a softlink ($0 for a softlink is the path to the softlink, not the path
     to the file that the softlink points too). Thanks to the jakarta-ant
     developers for this fix.
  5. Centralization of the JAVA_HOME checking and setting of the common portion
     of the CLASSPATH.
  6. Provided a means to override the XML parser provided with JDK 1.4 using the
     JDK 1.4 -Djava.endorsed.dirs property. Currently, this property is not set
     pending further testing of this option.
  
  Note: Some of the changes do not work with JDK 1.2 (e.g. new jpda option).
  However, Tomcat currently does not compile with JDK 1.2, so I did not think
  that would be a big issue. If JDK 1.2 support is important, I will test out
  the scripts when a JDK 1.2 build is available.
  
  Revision  Changes    Path
  1.24      +128 -99   jakarta-tomcat-4.0/catalina/src/bin/catalina.bat
  
  Index: catalina.bat
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/bin/catalina.bat,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- catalina.bat	26 Dec 2001 01:22:10 -0000	1.23
  +++ catalina.bat	15 Jan 2002 02:55:38 -0000	1.24
  @@ -1,154 +1,183 @@
   @echo off
  +if "%OS%" == "Windows_NT" setlocal
   rem ---------------------------------------------------------------------------
  -rem catalina.bat - Start/Stop Script for the CATALINA Server
  +rem Start/Stop Script for the CATALINA Server
   rem
  -rem Environment Variable Prequisites:
  +rem Environment Variable Prequisites
  +rem
  +rem   CATALINA_HOME   May point at your Catalina "build" directory.
   rem
   rem   CATALINA_BASE   (Optional) Base directory for resolving dynamic portions
   rem                   of a Catalina installation.  If not present, resolves to
   rem                   the same directory that CATALINA_HOME points to.
   rem
  -rem   CATALINA_HOME   (Optional) May point at your Catalina "build" directory.
  -rem                   If not present, the current working directory is assumed.
  -rem
   rem   CATALINA_OPTS   (Optional) Java runtime options used when the "start",
   rem                   "stop", or "run" command is executed.
   rem
   rem   CATALINA_TMPDIR (Optional) Directory path location of temporary directory
   rem                   the JVM should use (java.io.tmpdir).  Defaults to
  -rem                   $CATALINA_BASE/temp.
  +rem                   %CATALINA_BASE%\temp.
   rem
   rem   JAVA_HOME       Must point at your Java Development Kit installation.
   rem
  +rem   JAVA_OPTS       (Optional) Java runtime options used when the "start",
  +rem                   "stop", or "run" command is executed.
  +rem
   rem   JSSE_HOME       (Optional) May point at your Java Secure Sockets Extension
   rem                   (JSSE) installation, whose JAR files will be added to the
   rem                   system class path used to start Tomcat.
   rem
  -rem $Id: catalina.bat,v 1.23 2001/12/26 01:22:10 glenn Exp $
  +rem   JPDA_ADDRESS    (Optional) Java runtime options used when the "jpda start"
  +rem                   command is executed. The default is "jdbconn".
  +rem
  +rem $Id: catalina.bat,v 1.24 2002/01/15 02:55:38 patrickl Exp $
   rem ---------------------------------------------------------------------------
   
  -
  -rem ----- Save Environment Variables That May Change --------------------------
  -
  -set _CATALINA_BASE=%CATALINA_BASE%
  -set _CATALINA_HOME=%CATALINA_HOME%
  -set _CATALINA_TMPDIR=%CATALINA_TMPDIR%
  -set _CLASSPATH=%CLASSPATH%
  -set _CP=%CP%
  -
  -
  -rem ----- Verify and Set Required Environment Variables -----------------------
  -
  +rem Guess CATALINA_HOME if not defined
   if not "%CATALINA_HOME%" == "" goto gotHome
   set CATALINA_HOME=.
   if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
   set CATALINA_HOME=..
   :gotHome
   if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
  -echo Cannot find catalina.bat in %CATALINA_HOME%\bin
  -echo Please check your CATALINA_HOME setting
  -goto cleanup
  +echo The CATALINA_HOME environment variable is not defined correctly
  +echo This environment variable is needed to run this program
  +goto end
   :okHome
   
  -rem ----- Get user customizable environment variables -------------------------
  +rem Get standard environment variables
  +if exist "%CATALINA_HOME%\bin\setenv.bat" call "%CATALINA_HOME%\bin\setenv.bat"
   
  -if not exist "%CATALINA_HOME%\bin\setenv.bat" goto noSetenv
  -call "%CATALINA_HOME%\bin\setenv.bat"
  -:noSetenv
  +rem Get standard Java environment variables
  +if exist "%CATALINA_HOME%\bin\setclasspath.bat" goto okSetclasspath
  +echo Cannot find %CATALINA_HOME%\bin\setclasspath.bat
  +echo This file is needed to run this program
  +goto end
  +:okSetclasspath
  +set BASEDIR=%CATALINA_HOME%
  +call "%CATALINA_HOME%\bin\setclasspath.bat"
  +
  +rem Add on extra jar files to CLASSPATH
  +if "%JSSE_HOME%" == "" goto noJsse
  +set CLASSPATH=%CLASSPATH%;%JSSE_HOME%\lib\jcert.jar;%JSSE_HOME%\lib\jnet.jar;%JSSE_HOME%\lib\jsse.jar
  +:noJsse
  +set CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\bin\bootstrap.jar
   
   if not "%CATALINA_BASE%" == "" goto gotBase
   set CATALINA_BASE=%CATALINA_HOME%
   :gotBase
   
  -if not "%JAVA_HOME%" == "" goto gotJava
  -echo You must set JAVA_HOME to point at your Java Development Kit installation
  -goto cleanup
  -:gotJava
  -
   if not "%CATALINA_TMPDIR%" == "" goto gotTmpdir
   set CATALINA_TMPDIR=%CATALINA_BASE%\temp
   :gotTmpdir
   
  -rem ----- Prepare Appropriate Java Execution Commands -------------------------
  -
  -if not "%OS%" == "Windows_NT" goto noTitle
  -set _STARTJAVA=start "Catalina" "%JAVA_HOME%\bin\java"
  -set _RUNJAVA="%JAVA_HOME%\bin\java"
  -goto gotTitle
  -:noTitle
  -set _STARTJAVA=start "%JAVA_HOME%\bin\java"
  -set _RUNJAVA="%JAVA_HOME%\bin\java"
  -:gotTitle
  -
  -rem ----- Set Up The Runtime Classpath ----------------------------------------
  +rem ----- Execute The Requested Command ---------------------------------------
   
  -set CP=%CATALINA_HOME%\bin\bootstrap.jar;%JAVA_HOME%\lib\tools.jar
  -if "%JSSE_HOME%" == "" goto noJsse
  -set CP=%CP%;%JSSE_HOME%\lib\jcert.jar;%JSSE_HOME%\lib\jnet.jar;%JSSE_HOME%\lib\jsse.jar
  -:noJsse
  -set CLASSPATH=%CP%
   echo Using CATALINA_BASE:   %CATALINA_BASE%
   echo Using CATALINA_HOME:   %CATALINA_HOME%
   echo Using CATALINA_TMPDIR: %CATALINA_TMPDIR%
  -echo Using CLASSPATH:       %CLASSPATH%
   echo Using JAVA_HOME:       %JAVA_HOME%
   
  +set _EXECJAVA=%_RUNJAVA%
  +set MAINCLASS=org.apache.catalina.startup.Bootstrap
  +set ACTION=start
  +set SECURITY_POLICY_FILE=
  +set DEBUG_OPTS=
  +set JPDA=
  +
  +if not "%1" == "jpda" goto noJpda
  +set JPDA=jpda
  +if not "%JPDA_ADDRESS%" == "" got gotJpdaAddress
  +set JPDA_ADDRESS=jdbconn
  +:gotJpdaAddress
  +shift
  +:noJpda
  +
  +if ""%1"" == ""debug"" goto doDebug
  +if ""%1"" == ""embedded"" goto doEmbedded
  +if ""%1"" == ""run"" goto doRun
  +if ""%1"" == ""start"" goto doStart
  +if ""%1"" == ""stop"" goto doStop
  +
  +echo Usage:  catalina ( commands ... )
  +echo commands:
  +echo   debug             Start Catalina in a debugger
  +echo   debug -security   Debug Catalina with a security manager
  +echo   embedded          Start Catalina in embedded mode
  +echo   jpda start        Start Catalina under JPDA debugger
  +echo   run               Start Catalina in the current window
  +echo   run -security     Start in the current window with security manager
  +echo   start             Start Catalina in a separate window
  +echo   start -security   Start in a separate window with security manager
  +echo   stop              Stop Catalina
  +goto end
  +
  +:doDebug
  +shift
  +set _EXECJAVA=%_RUNJDB%
  +set DEBUG_OPTS=-sourcepath "%CATALINA_HOME%\..\..\jakarta-tomcat-4.0\catalina\src\share"
  +if not ""%1"" == ""-security"" goto execCmd
  +shift
  +echo Using Security Manager
  +set SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policy
  +goto execCmd
   
  -rem ----- Execute The Requested Command ---------------------------------------
  -
  -if "%1" == "env" goto doEnv
  -if "%1" == "run" goto doRun
  -if "%1" == "start" goto doStart
  -if "%1" == "stop" goto doStop
  -
  -:doUsage
  -echo Usage:  catalina ( env ^| run ^| start ^| stop )
  -echo Commands:
  -echo   env -   Set up environment variables that Catalina would use
  -echo   run -   Start Catalina in the current window
  -echo   start - Start Catalina in a separate window
  -echo   stop -  Stop Catalina
  -goto cleanup
  -
  -:doEnv
  -goto finish
  +:doEmbedded
  +shift
  +set MAINCLASS=org.apache.catalina.startup.Embedded
  +goto execCmd
   
   :doRun
  -if "%2" == "-security" goto doRunSecure
  -%_RUNJAVA% %CATALINA_OPTS% -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" org.apache.catalina.startup.Bootstrap %2 %3 %4 %5 %6 %7 %8 %9 start
  -goto cleanup
  -:doRunSecure
  -%_RUNJAVA% %CATALINA_OPTS% -Djava.security.manager -Djava.security.policy=="%CATALINA_BASE%/conf/catalina.policy" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" org.apache.catalina.startup.Bootstrap %3 %4 %5 %6 %7 %8 %9 start
  -goto cleanup
  +shift
  +if not ""%1"" == ""-security"" goto execCmd
  +shift
  +echo Using Security Manager
  +set SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policy
  +goto execCmd
   
   :doStart
  -if "%2" == "-security" goto doStartSecure
  -%_STARTJAVA% %CATALINA_OPTS% -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" org.apache.catalina.startup.Bootstrap %2 %3 %4 %5 %6 %7 %8 %9 start
  -goto cleanup
  -:doStartSecure
  +shift
  +if not "%OS%" == "Windows_NT" goto noTitle
  +set _EXECJAVA=start "Tomcat" %_RUNJAVA%
  +goto gotTitle
  +:noTitle
  +set _EXECJAVA=start %_RUNJAVA%
  +:gotTitle
  +if not ""%1"" == ""-security"" goto execCmd
  +shift
   echo Using Security Manager
  -%_STARTJAVA% %CATALINA_OPTS% -Djava.security.manager -Djava.security.policy=="%CATALINA_BASE%/conf/catalina.policy" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" org.apache.catalina.startup.Bootstrap %3 %4 %5 %6 %7 %8 %9 start
  -goto cleanup
  +set SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policy
  +goto execCmd
   
   :doStop
  -%_RUNJAVA% %CATALINA_OPTS% -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" org.apache.catalina.startup.Bootstrap %2 %3 %4 %5 %6 %7 %8 %9 stop
  -goto cleanup
  -
  -
  -
  -rem ----- Restore Environment Variables ---------------------------------------
  +shift
  +set ACTION=stop
  +goto execCmd
  +
  +:execCmd
  +rem Get remaining unshifted command line arguments and save them in the
  +set CMD_LINE_ARGS=
  +:setArgs
  +if ""%1""=="""" goto doneSetArgs
  +set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
  +shift
  +goto setArgs
  +:doneSetArgs
  +
  +rem Execute Java with the applicable properties
  +if not "%JPDA%" == "" goto doJpda
  +if not "%SECURITY_POLICY_FILE%" == "" goto doSecurity
  +%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%
  +goto end
  +:doSecurity
  +%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Djava.security.manager -Djava.security.policy=="%SECURITY_POLICY_FILE%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%
  +goto end
  +:doJpda
  +if not "%SECURITY_POLICY_FILE%" == "" goto doSecurityJpda
  +%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% -Xdebug -Xrunjdwp:transport=dt_shmem,address=%JPDA_ADDRESS%,server=y,suspend=n %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%
  +goto end
  +:doSecurityJpda
  +%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% -Xrunjdwp:transport=dt_shmem,address="%JPDA_ADDRESS%",server=y,suspend=n %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Djava.security.manager -Djava.security.policy=="%SECURITY_POLICY_FILE%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%
  +goto end
   
  -:cleanup
  -set CATALINA_BASE=%_CATALINA_BASE%
  -set _CATALINA_BASE=
  -set CATALINA_HOME=%_CATALINA_HOME%
  -set _CATALINA_HOME=
  -set CATALINA_TMPDIR=%_CATALINA_TMPDIR%
  -set _CATALINA_TMPDIR=
  -set CLASSPATH=%_CLASSPATH%
  -set _CLASSPATH=
  -set CP=%_CP%
  -set _LIBJARS=
  -set _RUNJAVA=
  -set _STARTJAVA=
  -:finish
  +:end
  
  
  
  1.24      +133 -163  jakarta-tomcat-4.0/catalina/src/bin/catalina.sh
  
  Index: catalina.sh
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/bin/catalina.sh,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- catalina.sh	26 Dec 2001 01:22:10 -0000	1.23
  +++ catalina.sh	15 Jan 2002 02:55:38 -0000	1.24
  @@ -1,145 +1,119 @@
   #!/bin/sh
   # -----------------------------------------------------------------------------
  -# catalina.sh - Start/Stop Script for the CATALINA Server
  +# Start/Stop Script for the CATALINA Server
   #
   # Environment Variable Prequisites
   #
  +#   CATALINA_HOME   May point at your Catalina "build" directory.
  +#
   #   CATALINA_BASE   (Optional) Base directory for resolving dynamic portions
   #                   of a Catalina installation.  If not present, resolves to
   #                   the same directory that CATALINA_HOME points to.
   #
  -#   CATALINA_HOME   (Optional) May point at your Catalina "build" directory.
  -#                   If not present, the current working directory is assumed.
  -#
   #   CATALINA_OPTS   (Optional) Java runtime options used when the "start",
   #                   "stop", or "run" command is executed.
   #
   #   CATALINA_TMPDIR (Optional) Directory path location of temporary directory
   #                   the JVM should use (java.io.tmpdir).  Defaults to
   #                   $CATALINA_BASE/temp.
  -#
  +
   #   JAVA_HOME       Must point at your Java Development Kit installation.
   #
  -#   JPDA_OPTS       (Optional) Java runtime options used when the "jpda start"
  -#                   command is executed.  Defaults to
  -#                   "-classic -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
  +#   JAVA_OPTS       (Optional) Java runtime options used when the "start",
  +#                   "stop", or "run" command is executed.
  +#
  +#   JPDA_ADDRESS    (Optional) Java runtime options used when the "jpda start"
  +#                   command is executed. The default is 8000.
   #
   #   JSSE_HOME       (Optional) May point at your Java Secure Sockets Extension
   #                   (JSSE) installation, whose JAR files will be added to the
   #                   system class path used to start Tomcat.
   #
  -# $Id: catalina.sh,v 1.23 2001/12/26 01:22:10 glenn Exp $
  +# $Id: catalina.sh,v 1.24 2002/01/15 02:55:38 patrickl Exp $
   # -----------------------------------------------------------------------------
   
  +# OS specific support.  $var _must_ be set to either true or false.
  +cygwin=false
  +case "`uname`" in
  +CYGWIN*) cygwin=true;;
  +esac
   
  -# ----- Verify and Set Required Environment Variables -------------------------
  -
  -if [ -z "$CATALINA_HOME" ] ; then
  -  ## resolve links - $0 may be a link to  home
  -  PRG=$0
  -  progname=`basename $0`
  -  
  -  while [ -h "$PRG" ] ; do
  -    ls=`ls -ld "$PRG"`
  -    link=`expr "$ls" : '.*-> \(.*\)$'`
  -    if expr "$link" : '.*/.*' > /dev/null; then
  -	PRG="$link"
  -    else
  -	PRG="`dirname $PRG`/$link"
  -    fi
  -  done
  -  
  -  CATALINA_HOME_1=`dirname "$PRG"`/..
  -  echo "Guessing CATALINA_HOME from catalina.sh to ${CATALINA_HOME_1}" 
  -    if [ -d ${CATALINA_HOME_1}/conf ] ; then 
  -	CATALINA_HOME=${CATALINA_HOME_1}
  -	echo "Setting CATALINA_HOME to $CATALINA_HOME"
  -    fi
  -fi
  -
  -# Get user customizable environment variables
  -if [ -r "$CATALINA_HOME/bin/setenv.sh" ] ; then
  -  . "$CATALINA_HOME/bin/setenv.sh"
  -fi
  -
  -if [ -z "$CATALINA_OPTS" ] ; then
  -  CATALINA_OPTS=""
  -fi
  +# resolve links - $0 may be a softlink
  +PRG="$0"
   
  -if [ -z "$JPDA_OPTS" ] ; then
  -  JPDA_OPTS="-classic -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
  -fi
  +while [ -h "$PRG" ]; do
  +  ls=`ls -ld "$PRG"`
  +  link=`expr "$ls" : '.*-> \(.*\)$'`
  +  if expr "$link" : '.*/.*' > /dev/null; then
  +    PRG="$link"
  +  else
  +    PRG=`dirname "$PRG"`/"$link"
  +  fi
  +done
   
  -if [ -z "$JAVA_HOME" ] ; then
  -  echo You must set JAVA_HOME to point at your Java Development Kit installation
  -  exit 1
  +# Get standard environment variables
  +PRGDIR=`dirname "$PRG"`
  +CATALINA_HOME=`cd "$PRGDIR/.." ; pwd`
  +if [ -r "$CATALINA_HOME"/bin/setenv.sh ]; then
  +  . "$CATALINA_HOME"/bin/setenv.sh
   fi
   
  -
  -# ----- Cygwin Unix Paths Setup -----------------------------------------------
  -
  -# Cygwin support.  $cygwin _must_ be set to either true or false.
  -case "`uname`" in
  -  CYGWIN*) cygwin=true ;;
  -  *) cygwin=false ;;
  -esac
  - 
   # For Cygwin, ensure paths are in UNIX format before anything is touched
  -if $cygwin ; then
  -  [ -n "$CATALINA_HOME" ] &&
  -    CATALINA_HOME=`cygpath --unix "$CATALINA_HOME"`
  -    [ -n "$JAVA_HOME" ] &&
  -    JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
  +if $cygwin; then
  +  [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
  +  [ -n "$CATALINA_HOME" ] && CATALINA_HOME=`cygpath --unix "$CATALINA_HOME"`
  +  [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
  +  [ -n "$JSSE_HOME" ] && JSSE_HOME=`cygpath --path --unix "$JSSE_HOME"`
   fi
   
  -
  -# ----- Set Up The System Classpath -------------------------------------------
  -
  -CP="$CATALINA_HOME/bin/bootstrap.jar"
  -
  -if [ -f "$JAVA_HOME/lib/tools.jar" ] ; then
  -  CP=$CP:"$JAVA_HOME/lib/tools.jar"
  -fi
  -if [ -f "$JSSE_HOME/lib/jsse.jar" ] ; then
  -  CP=$CP:"$JSSE_HOME/lib/jcert.jar":"$JSSE_HOME/lib/jnet.jar":"$JSSE_HOME/lib/jsse.jar"
  +# Get standard Java environment variables
  +if [ -r "$CATALINA_HOME"/bin/setclasspath.sh ]; then
  +  BASEDIR="$CATALINA_HOME"
  +  . "$CATALINA_HOME"/bin/setclasspath.sh
  +else
  +  echo "Cannot find $CATALINA_HOME/bin/setclasspath.sh"
  +  echo "This file is needed to run this program"
  +  exit 1
   fi
   
  -
  -# ----- Cygwin Windows Paths Setup --------------------------------------------
  -
  -# convert the existing path to windows
  -if $cygwin ; then
  -   CP=`cygpath --path --windows "$CP"`
  -   CATALINA_HOME=`cygpath --path --windows "$CATALINA_HOME"`
  -   JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
  +# Add on extra jar files to CLASSPATH
  +if [ -n "$JSSE_HOME" ]; then
  +  CLASSPATH="$CLASSPATH":"$JSSE_HOME"/lib/jcert.jar:"$JSSE_HOME"/lib/jnet.jar:"$JSSE_HOME"/lib/jsse.jar
   fi
  -
  -
  -# ----- Set Up CATALINA_BASE If Necessary -------------------------------------
  +CLASSPATH="$CLASSPATH":"$CATALINA_HOME"/bin/bootstrap.jar
   
   if [ -z "$CATALINA_BASE" ] ; then
  -  CATALINA_BASE=$CATALINA_HOME
  +  CATALINA_BASE="$CATALINA_HOME"
   fi
   
  -
  -# ---- Set Up CATALINA_TMPDIR If Necessary ------------------------------------
  -
   if [ -z "$CATALINA_TMPDIR" ] ; then
  -  ## define the java.io.tmpdir to use for catalina
  -  CATALINA_TMPDIR=${CATALINA_BASE}/temp
  +  # Define the java.io.tmpdir to use for Catalina
  +  CATALINA_TMPDIR="$CATALINA_BASE"/temp
   fi
   
  +# For Cygwin, switch paths to Windows format before running java
  +if $cygwin; then
  +  JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
  +  CATALINA_HOME=`cygpath --path --windows "$CATALINA_HOME"`
  +  CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
  +  JSSE_HOME=`cygpath --path --windows "$JSSE_HOME"`
  +fi
   
   # ----- Execute The Requested Command -----------------------------------------
   
  -echo "Using CLASSPATH:       $CP"
   echo "Using CATALINA_BASE:   $CATALINA_BASE"
   echo "Using CATALINA_HOME:   $CATALINA_HOME"
  -echo "Using CATALINA_TMPDIR: $CATALINA_TMPDIR"
  +echo "Using CATALINA_TMPDIR: $CATALINA_HOME"
   echo "Using JAVA_HOME:       $JAVA_HOME"
   
   if [ "$1" = "jpda" ] ; then
  -  CATALINA_OPTS="${CATALINA_OPTS} ${JPDA_OPTS}"
  +  if [ -z "$JPDA_ADDRESS" ]; then
  +    JPDA_ADDRESS="8000"
  +  fi
  +  if [ -z "$JDPA_OPTS" ]; then
  +    JPDA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=$JPDA_ADDRESS,server=y,suspend=n"
  +  fi
  +  CATALINA_OPTS="$CATALINA_OPTS $JPDA_OPTS"
     shift
   fi
   
  @@ -147,108 +121,104 @@
   
     shift
     if [ "$1" = "-security" ] ; then
  +    echo "Using Security Manager"
       shift
  -    $JAVA_HOME/bin/jdb \
  -       $CATALINA_OPTS \
  -       -sourcepath $CATALINA_HOME/../../jakarta-tomcat-4.0/catalina/src/share \
  -       -classpath $CP \
  -       -Dcatalina.base=$CATALINA_BASE \
  -       -Dcatalina.home=$CATALINA_HOME \
  -       -Djava.io.tmpdir=$CATALINA_TMPDIR \
  -       org.apache.catalina.startup.Bootstrap "$@" start
  +    exec "$_RUNJDB" $JAVA_OPTS $CATALINA_OPTS \
  +      -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
  +      -sourcepath "$CATALINA_HOME"/../../jakarta-tomcat-4.0/catalina/src/share \
  +      -Djava.security.manager \
  +      -Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \
  +      -Dcatalina.base="$CATALINA_BASE" \
  +      -Dcatalina.home="$CATALINA_HOME" \
  +      -Djava.io.tmpdir="$CATALINA_TMPDIR" \
  +      org.apache.catalina.startup.Bootstrap "$@" start
     else
  -    $JAVA_HOME/bin/jdb \
  -       $CATALINA_OPTS \
  -       -sourcepath $CATALINA_HOME/../../jakarta-tomcat-4.0/catalina/src/share \
  -       -classpath $CP \
  -       -Dcatalina.base=$CATALINA_BASE \
  -       -Dcatalina.home=$CATALINA_HOME \
  -       -Djava.io.tmpdir=$CATALINA_TMPDIR \
  -       org.apache.catalina.startup.Bootstrap "$@" start
  +    exec "$_RUNJDB" $JAVA_OPTS $CATALINA_OPTS \
  +      -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
  +      -sourcepath "$CATALINA_HOME"/../../jakarta-tomcat-4.0/catalina/src/share \
  +      -Dcatalina.base="$CATALINA_BASE" \
  +      -Dcatalina.home="$CATALINA_HOME" \
  +      -Djava.io.tmpdir="$CATALINA_TMPDIR" \
  +      org.apache.catalina.startup.Bootstrap "$@" start
     fi
   
   elif [ "$1" = "embedded" ] ; then
   
     shift
  -  for i in ${CATALINA_HOME}/server/lib/*.jar ; do
  -    CP=$i:${CP}
  -  done
  -  for i in ${CATALINA_HOME}/common/lib/*.jar ; do
  -    CP=$i:${CP}
  -  done
  -  echo Embedded Classpath: $CP
  -  $JAVA_HOME/bin/java $CATALINA_OPTS -classpath $CP \
  -   -Dcatalina.base=$CATALINA_BASE \
  -   -Dcatalina.home=$CATALINA_HOME \
  -   -Djava.io.tmpdir=$CATALINA_TMPDIR \
  -   org.apache.catalina.startup.Embedded "$@"
  -
  -elif [ "$1" = "env" ] ; then
  -
  -  export BP CATALINA_HOME CP
  -  exit 0
  +  echo "Embedded Classpath: $CLASSPATH"
  +  exec "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
  +    -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
  +    -Dcatalina.base="$CATALINA_BASE" \
  +    -Dcatalina.home="$CATALINA_HOME" \
  +    -Djava.io.tmpdir="$CATALINA_TMPDIR" \
  +    org.apache.catalina.startup.Embedded "$@"
   
  -elif [ "$1" = "run" ] ; then
  +elif [ "$1" = "run" ]; then
   
     shift
     if [ "$1" = "-security" ] ; then
  -    echo Using Security Manager
  +    echo "Using Security Manager"
       shift
  -    $JAVA_HOME/bin/java $CATALINA_OPTS -classpath $CP \
  -     -Djava.security.manager \
  -     -Djava.security.policy==$CATALINA_BASE/conf/catalina.policy \
  -     -Dcatalina.base=$CATALINA_BASE \
  -     -Dcatalina.home=$CATALINA_HOME \
  -     -Djava.io.tmpdir=$CATALINA_TMPDIR \
  -     org.apache.catalina.startup.Bootstrap "$@" start
  +    exec "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
  +      -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
  +      -Djava.security.manager \
  +      -Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \
  +      -Dcatalina.base="$CATALINA_BASE" \
  +      -Dcatalina.home="$CATALINA_HOME" \
  +      -Djava.io.tmpdir="$CATALINA_TMPDIR" \
  +      org.apache.catalina.startup.Bootstrap "$@" start
     else
  -    $JAVA_HOME/bin/java $CATALINA_OPTS -classpath $CP \
  -     -Dcatalina.base=$CATALINA_BASE \
  -     -Dcatalina.home=$CATALINA_HOME \
  -     -Djava.io.tmpdir=$CATALINA_TMPDIR \
  -     org.apache.catalina.startup.Bootstrap "$@" start
  +    exec "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
  +      -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
  +      -Dcatalina.base="$CATALINA_BASE" \
  +      -Dcatalina.home="$CATALINA_HOME" \
  +      -Djava.io.tmpdir="$CATALINA_TMPDIR" \
  +      org.apache.catalina.startup.Bootstrap "$@" start
     fi
   
   elif [ "$1" = "start" ] ; then
   
     shift
  -  touch $CATALINA_BASE/logs/catalina.out
  +  touch "$CATALINA_BASE"/logs/catalina.out
     if [ "$1" = "-security" ] ; then
  -    echo Using Security Manager
  +    echo "Using Security Manager"
       shift
  -    $JAVA_HOME/bin/java $CATALINA_OPTS -classpath $CP \
  -     -Djava.security.manager \
  -     -Djava.security.policy==$CATALINA_BASE/conf/catalina.policy \
  -     -Dcatalina.base=$CATALINA_BASE \
  -     -Dcatalina.home=$CATALINA_HOME \
  -     -Djava.io.tmpdir=$CATALINA_TMPDIR \
  -     org.apache.catalina.startup.Bootstrap "$@" start \
  -     >> $CATALINA_BASE/logs/catalina.out 2>&1 &
  +    "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
  +      -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
  +      -Djava.security.manager \
  +      -Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \
  +      -Dcatalina.base="$CATALINA_BASE" \
  +      -Dcatalina.home="$CATALINA_HOME" \
  +      -Djava.io.tmpdir="$CATALINA_TMPDIR" \
  +      org.apache.catalina.startup.Bootstrap "$@" start \
  +      >> "$CATALINA_BASE"/logs/catalina.out 2>&1 &
     else
  -    $JAVA_HOME/bin/java $CATALINA_OPTS -classpath $CP \
  -     -Dcatalina.base=$CATALINA_BASE \
  -     -Dcatalina.home=$CATALINA_HOME \
  -     -Djava.io.tmpdir=$CATALINA_TMPDIR \
  -     org.apache.catalina.startup.Bootstrap "$@" start \
  -     >> $CATALINA_BASE/logs/catalina.out 2>&1 &
  +    "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
  +      -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
  +      -Dcatalina.base="$CATALINA_BASE" \
  +      -Dcatalina.home="$CATALINA_HOME" \
  +      -Djava.io.tmpdir="$CATALINA_TMPDIR" \
  +      org.apache.catalina.startup.Bootstrap "$@" start \
  +      >> "$CATALINA_BASE"/logs/catalina.out 2>&1 &
     fi
   
   elif [ "$1" = "stop" ] ; then
   
     shift
  -  $JAVA_HOME/bin/java $CATALINA_OPTS -classpath $CP \
  -   -Dcatalina.base=$CATALINA_BASE \
  -   -Dcatalina.home=$CATALINA_HOME \
  -   -Djava.io.tmpdir=$CATALINA_TMPDIR \
  -   org.apache.catalina.startup.Bootstrap "$@" stop
  +  exec "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
  +    -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
  +    -Dcatalina.base="$CATALINA_BASE" \
  +    -Dcatalina.home="$CATALINA_HOME" \
  +    -Djava.io.tmpdir="$CATALINA_TMPDIR" \
  +    org.apache.catalina.startup.Bootstrap "$@" stop
   
   else
   
  -  echo "Usage: catalina.sh ( env | run | start | stop)"
  -  echo "Commands:"
  +  echo "Usage: catalina.sh ( commands ... )"
  +  echo "commands:"
     echo "  debug             Start Catalina in a debugger"
     echo "  debug -security   Debug Catalina with a security manager"
  -  echo "  env               Set up environment variables that would be used"
  +  echo "  embedded          Start Catalina in embedded mode"
     echo "  jpda start        Start Catalina under JPDA debugger"
     echo "  run               Start Catalina in the current window"
     echo "  run -security     Start in the current window with security manager"
  
  
  
  1.3       +16 -2     jakarta-tomcat-4.0/catalina/src/bin/cpappend.bat
  
  Index: cpappend.bat
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/bin/cpappend.bat,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- cpappend.bat	5 Sep 2000 01:04:53 -0000	1.2
  +++ cpappend.bat	15 Jan 2002 02:55:38 -0000	1.3
  @@ -1,2 +1,16 @@
  -set CP=%CP%;%1
  -set _LIBJARS=%_LIBJARS%;%1
  +rem ---------------------------------------------------------------------------
  +rem Append a path onto the CLASSPATH
  +rem
  +rem $Id: cpappend.bat,v 1.3 2002/01/15 02:55:38 patrickl Exp $
  +rem ---------------------------------------------------------------------------
  +
  +rem Get remaining unshifted command line arguments and save them in the
  +set CMD_LINE_ARGS=%1
  +shift
  +:setArgs
  +if ""%1""=="""" goto doneSetArgs
  +set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
  +shift
  +goto setArgs
  +:doneSetArgs
  +
  
  
  
  1.4       +34 -21    jakarta-tomcat-4.0/catalina/src/bin/digest.bat
  
  Index: digest.bat
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/bin/digest.bat,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- digest.bat	13 Nov 2001 16:57:21 -0000	1.3
  +++ digest.bat	15 Jan 2002 02:55:38 -0000	1.4
  @@ -1,28 +1,41 @@
   @echo off
  +if "%OS%" == "Windows_NT" setlocal
   rem ---------------------------------------------------------------------------
  -rem digest.bat - Digest password using the algorithm specified
  +rem Script to digest password using the algorithm specified
   rem
  -rem   CATALINA_HOME (Optional) May point at your Catalina "build" directory.
  -rem                 If not present, the current working directory is assumed.
  -rem
  -rem   JAVA_HOME     Must point at your Java Development Kit installation.
  -rem
  -rem   This script is assumed to run from the bin directory or have the
  -rem   CATALINA_HOME env variable set.
  -rem
  -rem $Id: digest.bat,v 1.3 2001/11/13 16:57:21 craigmcc Exp $
  +rem $Id: digest.bat,v 1.4 2002/01/15 02:55:38 patrickl Exp $
   rem ---------------------------------------------------------------------------
   
  -set _CATALINA_HOME=%CATALINA_HOME%
  -if not "%CATALINA_HOME%" == "" goto gotCatalinaHome
  +rem Guess CATALINA_HOME if not defined
  +if not "%CATALINA_HOME%" == "" goto gotHome
   set CATALINA_HOME=.
  -if exist "%CATALINA_HOME%\bin\tool-wrapper.bat" goto gotCatalinaHome
  +if exist "%CATALINA_HOME%\bin\tool-wrapper.bat" goto okHome
   set CATALINA_HOME=..
  -if exist "%CATALINA_HOME%\bin\tool-wrapper.bat" goto gotCatalinaHome
  -echo Unable to determine the value of CATALINA_HOME
  -goto cleanup
  -:gotCatalinaHome
  -"%CATALINA_HOME%\bin\tool-wrapper" -server org.apache.catalina.realm.RealmBase %1 %2 %3 %4 %5 %6 %7 %8 %9
  -:cleanup
  -set CATALINA_HOME=%_CATALINA_HOME%
  -set _CATALINA_HOME=
  +:gotHome
  +if exist "%CATALINA_HOME%\bin\tool-wrapper.bat" goto okHome
  +echo The CATALINA_HOME environment variable is not defined correctly
  +echo This environment variable is needed to run this program
  +goto end
  +:okHome
  +
  +set EXECUTABLE=%CATALINA_HOME%\bin\tool-wrapper.bat
  +
  +rem Check that target executable exists
  +if exist "%EXECUTABLE%" goto okExec
  +echo Cannot find %EXECUTABLE%
  +echo This file is needed to run this program
  +goto end
  +:okExec
  +
  +rem Get remaining unshifted command line arguments and save them in the
  +set CMD_LINE_ARGS=
  +:setArgs
  +if ""%1""=="""" goto doneSetArgs
  +set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
  +shift
  +goto setArgs
  +:doneSetArgs
  +
  +call "%EXECUTABLE%" -server org.apache.catalina.realm.RealmBase %CMD_LINE_ARGS%
  +
  +:end
  
  
  
  1.6       +26 -12    jakarta-tomcat-4.0/catalina/src/bin/digest.sh
  
  Index: digest.sh
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/bin/digest.sh,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- digest.sh	13 Nov 2001 16:57:21 -0000	1.5
  +++ digest.sh	15 Jan 2002 02:55:38 -0000	1.6
  @@ -1,17 +1,31 @@
   #!/bin/sh
   # -----------------------------------------------------------------------------
  -# digest.bat - Digest password using the algorithm specificied
  +# Script to digest password using the algorithm specificied
   #
  -#   CATALINA_HOME (Optional) May point at your Catalina "build" directory.
  -#                 If not present, the current working directory is assumed.
  -#
  -#   JAVA_HOME     Must point at your Java Development Kit installation.
  -#
  -#   This script is assumed to run from the bin directory or have the
  -#   CATALINA_HOME env variable set.
  -#
  -# $Id: digest.sh,v 1.5 2001/11/13 16:57:21 craigmcc Exp $
  +# $Id: digest.sh,v 1.6 2002/01/15 02:55:38 patrickl Exp $
   # -----------------------------------------------------------------------------
   
  -BASEDIR=`dirname $0`
  -$BASEDIR/tool-wrapper.sh -server org.apache.catalina.realm.RealmBase "$@"
  +# resolve links - $0 may be a softlink
  +PRG="$0"
  +
  +while [ -h "$PRG" ] ; do
  +  ls=`ls -ld "$PRG"`
  +  link=`expr "$ls" : '.*-> \(.*\)$'`
  +  if expr "$link" : '.*/.*' > /dev/null; then
  +    PRG="$link"
  +  else
  +    PRG=`dirname "$PRG"`/"$link"
  +  fi
  +done
  + 
  +PRGDIR=`dirname "$PRG"`
  +EXECUTABLE=tool-wrapper.sh
  +
  +# Check that target executable exists
  +if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
  +  echo "Cannot find $PRGDIR/$EXECUTABLE"
  +  echo "This file is needed to run this program"
  +  exit 1
  +fi
  +
  +exec "$PRGDIR"/"$EXECUTABLE" -server org.apache.catalina.realm.RealmBase "$@"
  
  
  
  1.5       +34 -13    jakarta-tomcat-4.0/catalina/src/bin/shutdown.bat
  
  Index: shutdown.bat
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/bin/shutdown.bat,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- shutdown.bat	16 Oct 2000 19:13:14 -0000	1.4
  +++ shutdown.bat	15 Jan 2002 02:55:38 -0000	1.5
  @@ -1,20 +1,41 @@
   @echo off
  +if "%OS%" == "Windows_NT" setlocal
   rem ---------------------------------------------------------------------------
  -rem shutdown.bat - Stop Script for the CATALINA Server
  +rem Stop script for the CATALINA Server
   rem
  -rem $Id: shutdown.bat,v 1.4 2000/10/16 19:13:14 craigmcc Exp $
  +rem $Id: shutdown.bat,v 1.5 2002/01/15 02:55:38 patrickl Exp $
   rem ---------------------------------------------------------------------------
   
  -set _CATALINA_HOME=%CATALINA_HOME%
  -if not "%CATALINA_HOME%" == "" goto gotCatalinaHome
  +rem Guess CATALINA_HOME if not defined
  +if not "%CATALINA_HOME%" == "" goto gotHome
   set CATALINA_HOME=.
  -if exist "%CATALINA_HOME%\bin\catalina.bat" goto gotCatalinaHome
  +if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
   set CATALINA_HOME=..
  -if exist "%CATALINA_HOME%\bin\catalina.bat" goto gotCatalinaHome
  -echo Unable to determine the value of CATALINA_HOME
  -goto cleanup
  -:gotCatalinaHome
  -"%CATALINA_HOME%\bin\catalina" stop %1 %2 %3 %4 %5 %6 %7 %8 %9
  -:cleanup
  -set CATALINA_HOME=%_CATALINA_HOME%
  -set _CATALINA_HOME=
  +:gotHome
  +if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
  +echo The CATALINA_HOME environment variable is not defined correctly
  +echo This environment variable is needed to run this program
  +goto end
  +:okHome
  +
  +set EXECUTABLE=%CATALINA_HOME%\bin\catalina.bat
  +
  +rem Check that target executable exists
  +if exist "%EXECUTABLE%" goto okExec
  +echo Cannot find %EXECUTABLE%
  +echo This file is needed to run this program
  +goto end
  +:okExec
  +
  +rem Get remaining unshifted command line arguments and save them in the
  +set CMD_LINE_ARGS=
  +:setArgs
  +if ""%1""=="""" goto doneSetArgs
  +set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
  +shift
  +goto setArgs
  +:doneSetArgs
  +
  +call "%EXECUTABLE%" stop %CMD_LINE_ARGS%
  +
  +:end
  
  
  
  1.2       +26 -4     jakarta-tomcat-4.0/catalina/src/bin/shutdown.sh
  
  Index: shutdown.sh
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/bin/shutdown.sh,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- shutdown.sh	11 Aug 2000 05:22:16 -0000	1.1
  +++ shutdown.sh	15 Jan 2002 02:55:38 -0000	1.2
  @@ -1,9 +1,31 @@
   #!/bin/sh
   # -----------------------------------------------------------------------------
  -# shutdown.sh - Stop Script for the CATALINA Server
  +# Stop script for the CATALINA Server
   #
  -# $Id: shutdown.sh,v 1.1 2000/08/11 05:22:16 craigmcc Exp $
  +# $Id: shutdown.sh,v 1.2 2002/01/15 02:55:38 patrickl Exp $
   # -----------------------------------------------------------------------------
   
  -BASEDIR=`dirname $0`
  -$BASEDIR/catalina.sh stop "$@"
  +# resolve links - $0 may be a softlink
  +PRG="$0"
  +
  +while [ -h "$PRG" ] ; do
  +  ls=`ls -ld "$PRG"`
  +  link=`expr "$ls" : '.*-> \(.*\)$'`
  +  if expr "$link" : '.*/.*' > /dev/null; then
  +    PRG="$link"
  +  else
  +    PRG=`dirname "$PRG"`/"$link"
  +  fi
  +done
  + 
  +PRGDIR=`dirname "$PRG"`
  +EXECUTABLE=catalina.sh
  +
  +# Check that target executable exists
  +if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
  +  echo "Cannot find $PRGDIR/$EXECUTABLE"
  +  echo "This file is needed to run this program"
  +  exit 1
  +fi
  +
  +exec "$PRGDIR"/"$EXECUTABLE" stop "$@"
  
  
  
  1.4       +33 -13    jakarta-tomcat-4.0/catalina/src/bin/startup.bat
  
  Index: startup.bat
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/bin/startup.bat,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- startup.bat	16 Oct 2000 18:50:58 -0000	1.3
  +++ startup.bat	15 Jan 2002 02:55:38 -0000	1.4
  @@ -1,21 +1,41 @@
   @echo off
  +if "%OS%" == "Windows_NT" setlocal
   rem ---------------------------------------------------------------------------
  -rem startup.bat - Start Script for the CATALINA Server
  +rem Start script for the CATALINA Server
   rem
  -rem $Id: startup.bat,v 1.3 2000/10/16 18:50:58 craigmcc Exp $
  +rem $Id: startup.bat,v 1.4 2002/01/15 02:55:38 patrickl Exp $
   rem ---------------------------------------------------------------------------
   
  -set _CATALINA_HOME=%CATALINA_HOME%
  -if not "%CATALINA_HOME%" == "" goto gotCatalinaHome
  +rem Guess CATALINA_HOME if not defined
  +if not "%CATALINA_HOME%" == "" goto gotHome
   set CATALINA_HOME=.
  -if exist "%CATALINA_HOME%\bin\catalina.bat" goto gotCatalinaHome
  +if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
   set CATALINA_HOME=..
  -if exist "%CATALINA_HOME%\bin\catalina.bat" goto gotCatalinaHome
  -echo Unable to determine the value of CATALINA_HOME
  -goto cleanup
  -:gotCatalinaHome
  -"%CATALINA_HOME%\bin\catalina" start %1 %2 %3 %4 %5 %6 %7 %8 %9
  -:cleanup
  -set CATALINA_HOME=%_CATALINA_HOME%
  -set _CATALINA_HOME=
  +:gotHome
  +if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
  +echo The CATALINA_HOME environment variable is not defined correctly
  +echo This environment variable is needed to run this program
  +goto end
  +:okHome
   
  +set EXECUTABLE=%CATALINA_HOME%\bin\catalina.bat
  +
  +rem Check that target executable exists
  +if exist "%EXECUTABLE%" goto okExec
  +echo Cannot find %EXECUTABLE%
  +echo This file is needed to run this program
  +goto end
  +:okExec
  +
  +rem Get remaining unshifted command line arguments and save them in the
  +set CMD_LINE_ARGS=
  +:setArgs
  +if ""%1""=="""" goto doneSetArgs
  +set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
  +shift
  +goto setArgs
  +:doneSetArgs
  +
  +call "%EXECUTABLE%" start %CMD_LINE_ARGS%
  +
  +:end
  
  
  
  1.2       +26 -4     jakarta-tomcat-4.0/catalina/src/bin/startup.sh
  
  Index: startup.sh
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/bin/startup.sh,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- startup.sh	11 Aug 2000 05:22:16 -0000	1.1
  +++ startup.sh	15 Jan 2002 02:55:38 -0000	1.2
  @@ -1,9 +1,31 @@
   #!/bin/sh
   # -----------------------------------------------------------------------------
  -# startup.sh - Start Script for the CATALINA Server
  +# Start Script for the CATALINA Server
   #
  -# $Id: startup.sh,v 1.1 2000/08/11 05:22:16 craigmcc Exp $
  +# $Id: startup.sh,v 1.2 2002/01/15 02:55:38 patrickl Exp $
   # -----------------------------------------------------------------------------
   
  -BASEDIR=`dirname $0`
  -$BASEDIR/catalina.sh start "$@"
  +# resolve links - $0 may be a softlink
  +PRG="$0"
  +
  +while [ -h "$PRG" ] ; do
  +  ls=`ls -ld "$PRG"`
  +  link=`expr "$ls" : '.*-> \(.*\)$'`
  +  if expr "$link" : '.*/.*' > /dev/null; then
  +    PRG="$link"
  +  else
  +    PRG=`dirname "$PRG"`/"$link"
  +  fi
  +done
  + 
  +PRGDIR=`dirname "$PRG"`
  +EXECUTABLE=catalina.sh
  +
  +# Check that target executable exists
  +if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
  +  echo "Cannot find $PRGDIR/$EXECUTABLE"
  +  echo "This file is needed to run this program"
  +  exit 1
  +fi
  +
  +exec "$PRGDIR"/"$EXECUTABLE" start "$@"
  
  
  
  1.3       +39 -60    jakarta-tomcat-4.0/catalina/src/bin/tool-wrapper.bat
  
  Index: tool-wrapper.bat
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/bin/tool-wrapper.bat,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- tool-wrapper.bat	28 Nov 2001 01:39:10 -0000	1.2
  +++ tool-wrapper.bat	15 Jan 2002 02:55:38 -0000	1.3
  @@ -1,80 +1,59 @@
   @echo off
  +if "%OS%" == "Windows_NT" setlocal
   rem ---------------------------------------------------------------------------
  -rem tool-wrapper.bat - Wrapper for command line tools
  +rem Wrapper script for command line tools
   rem
  -rem Environment Variable Prequisites:
  +rem Environment Variable Prequisites
   rem
  -rem   CATALINA_HOME (Optional) Catalina binary distribution directory.
  -rem                 If not present, the directory above this "bin" directory
  -rem                 is assumed.
  +rem   CATALINA_HOME May point at your Catalina "build" directory.
   rem
  -rem   JAVA_HOME     (Required) Java Development Kit installation directory.
  +rem   TOOL_OPTS     (Optional) Java runtime options used when the "start",
  +rem                 "stop", or "run" command is executed.
   rem
  -rem   TOOL_OPTS     (Optional) Java execution options for the tool.
  +rem   JAVA_HOME     Must point at your Java Development Kit installation.
   rem
  -rem $Id: tool-wrapper.bat,v 1.2 2001/11/28 01:39:10 patrickl Exp $
  +rem   JAVA_OPTS     (Optional) Java runtime options used when the "start",
  +rem                 "stop", or "run" command is executed.
  +rem
  +rem $Id: tool-wrapper.bat,v 1.3 2002/01/15 02:55:38 patrickl Exp $
   rem ---------------------------------------------------------------------------
   
  -
  -rem ----- Save Environment Variables That May Change --------------------------
  -
  -set _CATALINA_HOME=%CATALINA_HOME%
  -set _CLASSPATH=%CLASSPATH%
  -
  -
  -rem ----- Verify and Set Required Environment Variables -----------------------
  -
  +rem Guess CATALINA_HOME if not defined
   if not "%CATALINA_HOME%" == "" goto gotHome
   set CATALINA_HOME=.
   if exist "%CATALINA_HOME%\bin\tool-wrapper.bat" goto okHome
   set CATALINA_HOME=..
   :gotHome
   if exist "%CATALINA_HOME%\bin\tool-wrapper.bat" goto okHome
  -echo Cannot find tool-wrapper.bat in %CATALINA_HOME%\bin
  -echo Please check your CATALINA_HOME setting
  -goto cleanup
  +echo The CATALINA_HOME environment variable is not defined correctly
  +echo This environment variable is needed to run this program
  +goto end
   :okHome
   
  -rem ----- Get user customizable environment variables -------------------------
  -
  -if not exist "%CATALINA_HOME%\bin\setenv.bat" goto noSetenv
  -call "%CATALINA_HOME%\bin\setenv.bat"
  -:noSetenv
  -
  -if not "%JAVA_HOME%" == "" goto gotJava
  -echo You must set JAVA_HOME to point at your Java Development Kit installation
  -goto cleanup
  -:gotJava
  -
  -
  -rem ----- Prepare Appropriate Java Execution Commands -------------------------
  -
  -if not "%OS%" == "Windows_NT" goto noTitle
  -set _RUNJAVA="%JAVA_HOME%\bin\java"
  -goto gotTitle
  -:noTitle
  -set _RUNJAVA="%JAVA_HOME%\bin\java"
  -:gotTitle
  -
  -rem ----- Set Up The Runtime Classpath ----------------------------------------
  -
  -set CLASSPATH=%CATALINA_HOME%\bin\bootstrap.jar;%JAVA_HOME%\lib\tools.jar
  -rem echo Using CLASSPATH:     %CLASSPATH%
  -rem echo Using CATALINA_HOME: %CATALINA_HOME%
  -rem echo Using JAVA_HOME:     %JAVA_HOME%
  -
  -
  -rem ----- Execute The Requested Command ---------------------------------------
  -
  -%_RUNJAVA% %TOOL_OPTS% -Dcatalina.home="%CATALINA_HOME%" org.apache.catalina.startup.Tool %1 %2 %3 %4 %5 %6 %7 %8 %9
  +rem Get standard environment variables
  +if exist "%CATALINA_HOME%\bin\setenv.bat" call "%CATALINA_HOME%\bin\setenv.bat"
   
  +rem Get standard Java environment variables
  +if exist "%CATALINA_HOME%\bin\setclasspath.bat" goto okSetclasspath
  +echo Cannot find %CATALINA_HOME%\bin\setclasspath.bat
  +echo This file is needed to run this program
  +goto end
  +:okSetclasspath
  +set BASEDIR=%CATALINA_HOME%
  +call "%CATALINA_HOME%\bin\setclasspath.bat"
  +
  +rem Add on extra jar files to CLASSPATH
  +set CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\bin\bootstrap.jar
  +
  +rem Get remaining unshifted command line arguments and save them in the
  +set CMD_LINE_ARGS=
  +:setArgs
  +if ""%1""=="""" goto doneSetArgs
  +set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
  +shift
  +goto setArgs
  +:doneSetArgs
   
  -rem ----- Restore Environment Variables ---------------------------------------
  +%_RUNJAVA% %JAVA_OPTS% %TOOL_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.home="%CATALINA_HOME%" org.apache.catalina.startup.Tool %CMD_LINE_ARGS%
   
  -:cleanup
  -set CATALINA_HOME=%_CATALINA_HOME%
  -set _CATALINA_HOME=
  -set CLASSPATH=%_CLASSPATH%
  -set _CLASSPATH=
  -set _RUNJAVA=
  -:finish
  +:end
  
  
  
  1.4       +55 -81    jakarta-tomcat-4.0/catalina/src/bin/tool-wrapper.sh
  
  Index: tool-wrapper.sh
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/bin/tool-wrapper.sh,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- tool-wrapper.sh	27 Nov 2001 23:10:14 -0000	1.3
  +++ tool-wrapper.sh	15 Jan 2002 02:55:38 -0000	1.4
  @@ -1,104 +1,78 @@
   #!/bin/sh
   # -----------------------------------------------------------------------------
  -# tool-wrapper.sh - Wrapper for command line tools
  +# Wrapper script for command line tools
   #
  -# Environment Variable Prequisites:
  +# Environment Variable Prequisites
   #
  -#   CATALINA_HOME (Optional) Catalina binary distribution directory.
  -#                 If not present, the directory above this "bin" directory
  -#                 is assumed.
  +#   CATALINA_HOME May point at your Catalina "build" directory.
   #
  -#   JAVA_HOME     (Required) Java Development Kit installation directory.
  +#   TOOL_OPTS     (Optional) Java runtime options used when the "start",
  +#                 "stop", or "run" command is executed.
   #
  -#   TOOL_OPTS     (Optional) Java execution options for the tool.
  +#   JAVA_HOME     Must point at your Java Development Kit installation.
   #
  -# $Id: tool-wrapper.sh,v 1.3 2001/11/27 23:10:14 patrickl Exp $
  +#   JAVA_OPTS     (Optional) Java runtime options used when the "start",
  +#                 "stop", or "run" command is executed.
  +#
  +# $Id: tool-wrapper.sh,v 1.4 2002/01/15 02:55:38 patrickl Exp $
   # -----------------------------------------------------------------------------
   
  +# OS specific support.  $var _must_ be set to either true or false.
  +cygwin=false
  +case "`uname`" in
  +CYGWIN*) cygwin=true;;
  +esac
   
  -# ----- Verify and Set Required Environment Variables -------------------------
  -
  -if [ -z "$CATALINA_HOME" ] ; then
  -  ## resolve links - $0 may be a link to  home
  -  PRG=$0
  -  progname=`basename $0`
  -  
  -  while [ -h "$PRG" ] ; do
  -    ls=`ls -ld "$PRG"`
  -    link=`expr "$ls" : '.*-> \(.*\)$'`
  -    if expr "$link" : '.*/.*' > /dev/null; then
  -	PRG="$link"
  -    else
  -	PRG="`dirname $PRG`/$link"
  -    fi
  -  done
  -  
  -  CATALINA_HOME_1=`dirname "$PRG"`/..
  -  echo "Guessing CATALINA_HOME from catalina.sh to ${CATALINA_HOME_1}" 
  -    if [ -d ${CATALINA_HOME_1}/conf ] ; then 
  -	CATALINA_HOME=${CATALINA_HOME_1}
  -	echo "Setting CATALINA_HOME to $CATALINA_HOME"
  -    fi
  -fi
  -
  -# Get user customizable environment variables
  -if [ -r "$CATALINA_HOME/bin/setenv.sh" ] ; then
  -  . "$CATALINA_HOME/bin/setenv.sh"
  -fi
  -
  -if [ -z "$TOOL_OPTS" ] ; then
  -  TOOL_OPTS=""
  -fi
  +# resolve links - $0 may be a softlink
  +PRG="$0"
   
  -if [ -z "$JAVA_HOME" ] ; then
  -  echo You must set JAVA_HOME to point at your Java Development Kit installation
  -  exit 1
  +while [ -h "$PRG" ]; do
  +  ls=`ls -ld "$PRG"`
  +  link=`expr "$ls" : '.*-> \(.*\)$'`
  +  if expr "$link" : '.*/.*' > /dev/null; then
  +    PRG="$link"
  +  else
  +    PRG=`dirname "$PRG"`/"$link"
  +  fi
  +done
  +
  +# Get standard environment variables
  +PRGDIR=`dirname "$PRG"`
  +CATALINA_HOME=`cd "$PRGDIR/.." ; pwd`
  +if [ -r "$CATALINA_HOME"/bin/setenv.sh ]; then
  +  . "$CATALINA_HOME"/bin/setenv.sh
   fi
   
  -
  -# ----- Cygwin Unix Paths Setup -----------------------------------------------
  -
  -# Cygwin support.  $cygwin _must_ be set to either true or false.
  -case "`uname`" in
  -  CYGWIN*) cygwin=true ;;
  -  *) cygwin=false ;;
  -esac
  - 
   # For Cygwin, ensure paths are in UNIX format before anything is touched
  -if $cygwin ; then
  -  [ -n "$CATALINA_HOME" ] &&
  -    CATALINA_HOME=`cygpath --unix "$CATALINA_HOME"`
  -    [ -n "$JAVA_HOME" ] &&
  -    JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
  +if $cygwin; then
  +  [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
  +  [ -n "$CATALINA_HOME" ] && CATALINA_HOME=`cygpath --unix "$CATALINA_HOME"`
  +  [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
   fi
   
  -
  -# ----- Set Up The System Classpath -------------------------------------------
  -
  -CP="$CATALINA_HOME/bin/bootstrap.jar"
  -
  -if [ -f "$JAVA_HOME/lib/tools.jar" ] ; then
  -  CP=$CP:"$JAVA_HOME/lib/tools.jar"
  +# Get standard Java environment variables
  +if [ -r "$CATALINA_HOME"/bin/setclasspath.sh ]; then
  +  BASEDIR="$CATALINA_HOME"
  +  . "$CATALINA_HOME"/bin/setclasspath.sh
  +else
  +  echo "Cannot find $CATALINA_HOME/bin/setclasspath.sh"
  +  echo "This file is needed to run this program"
  +  exit 1
   fi
   
  +# Add on extra jar files to CLASSPATH
  +CLASSPATH="$CLASSPATH":"$CATALINA_HOME"/bin/bootstrap.jar
   
  -# ----- Cygwin Windows Paths Setup --------------------------------------------
  -
  -# convert the existing path to windows
  -if $cygwin ; then
  -   CP=`cygpath --path --windows "$CP"`
  -   CATALINA_HOME=`cygpath --path --windows "$CATALINA_HOME"`
  -   JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
  +# For Cygwin, switch paths to Windows format before running java
  +if $cygwin; then
  +  JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
  +  CATALINA_HOME=`cygpath --path --windows "$CATALINA_HOME"`
  +  CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
   fi
   
  -
   # ----- Execute The Requested Command -----------------------------------------
   
  -# echo "Using CLASSPATH:     $CP"
  -# echo "Using CATALINA_HOME: $CATALINA_HOME"
  -# echo "Using JAVA_HOME:     $JAVA_HOME"
  -
  -$JAVA_HOME/bin/java $TOOL_OPTS -classpath $CP \
  - -Dcatalina.home=$CATALINA_HOME \
  - org.apache.catalina.startup.Tool "$@"
  -
  +exec "$_RUNJAVA" $JAVA_OPTS $TOOL_OPTS \
  +  -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
  +  -Dcatalina.home="$CATALINA_HOME" \
  +  org.apache.catalina.startup.Tool "$@"
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/bin/setclasspath.bat
  
  Index: setclasspath.bat
  ===================================================================
  rem ---------------------------------------------------------------------------
  rem Set CLASSPATH and Java options
  rem
  rem $Id: setclasspath.bat,v 1.1 2002/01/15 02:55:38 patrickl Exp $
  rem ---------------------------------------------------------------------------
  
  rem Make sure prerequisite environment variables are set
  if not "%JAVA_HOME%" == "" goto gotJavaHome
  echo The JAVA_HOME environment variable is not defined
  echo This environment variable is needed to run this program
  goto end
  :gotJavaHome
  if exist "%JAVA_HOME%\bin\java.exe" goto okJavaHome
  echo The JAVA_HOME environment variable is not defined correctly
  echo This environment variable is needed to run this program
  goto end
  :okJavaHome
  
  if not "%BASEDIR%" == "" goto gotBasedir
  echo The BASEDIR environment variable is not defined
  echo This environment variable is needed to run this program
  goto end
  :gotBasedir
  if exist "%BASEDIR%\bin\setclasspath.bat" goto okBasedir
  echo The BASEDIR environment variable is not defined correctly
  echo This environment variable is needed to run this program
  goto end
  :okBasedir
  
  rem Set the default Java options for all scripts
  set JAVA_OPTS=
  
  rem Set the default -Djava.endorsed.dirs argument
  set JAVA_ENDORSED_DIRS=
  
  rem Set standard CLASSPATH
  rem Note that there are no quotes as we do not want to introduce random
  rem quotes into the CLASSPATH
  set CLASSPATH=%JAVA_HOME%\lib\tools.jar
  
  rem Set standard command for invoking Java.
  rem Note that NT requires a window name argument when using start.
  rem Also note the quoting as JAVA_HOME may contain spaces.
  set _RUNJAVA="%JAVA_HOME%\bin\java"
  set _RUNJAVAW="%JAVA_HOME%\bin\javaw"
  set _RUNJDB="%JAVA_HOME%\bin\jdb"
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/bin/setclasspath.sh
  
  Index: setclasspath.sh
  ===================================================================
  # -----------------------------------------------------------------------------
  #  Set CLASSPATH and Java options
  #
  #  $Id: setclasspath.sh,v 1.1 2002/01/15 02:55:38 patrickl Exp $
  # -----------------------------------------------------------------------------
  
  # Make sure prerequisite environment variables are set
  if [ -z "$JAVA_HOME" ]; then
    echo "The JAVA_HOME environment variable is not defined"
    echo "This environment variable is needed to run this program"
    exit 1
  fi
  if [ ! -r "$JAVA_HOME"/bin/java ]; then
    echo "The JAVA_HOME environment variable is not defined correctly"
    echo "This environment variable is needed to run this program"
    exit 1
  fi
  if [ -z "$BASEDIR" ]; then
    echo "The BASEDIR environment variable is not defined"
    echo "This environment variable is needed to run this program"
    exit 1
  fi
  if [ ! -r "$BASEDIR"/bin/setclasspath.sh ]; then
    echo "The BASEDIR environment variable is not defined correctly"
    echo "This environment variable is needed to run this program"
    exit 1
  fi
  
  # Set the default Java options for all scripts
  JAVA_OPTS=
  
  # Set the default -Djava.endorsed.dirs argument
  JAVA_ENDORSED_DIRS=
  
  # Set standard CLASSPATH
  CLASSPATH="$JAVA_HOME"/lib/tools.jar
  
  # OSX hack to CLASSPATH
  JIKESPATH=
  if [ `uname -s` = "Darwin" ]; then
    OSXHACK="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Classes"
    if [ -d "$OSXHACK" ]; then
      for i in "$OSXHACK"/*.jar; do
        JIKESPATH="$JIKESPATH":"$i"
      done
    fi
  fi
  
  # Set standard commands for invoking Java.
  _RUNJAVA="$JAVA_HOME"/bin/java
  _RUNJDB="$JAVA_HOME"/bin/jdb
  
  
  
  1.6       +52 -51    jakarta-tomcat-4.0/jasper/src/bin/jasper.bat
  
  Index: jasper.bat
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/jasper/src/bin/jasper.bat,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- jasper.bat	12 Oct 2001 16:51:25 -0000	1.5
  +++ jasper.bat	15 Jan 2002 02:55:39 -0000	1.6
  @@ -1,69 +1,70 @@
   @echo off
  +if "%OS%" == "Windows_NT" setlocal
   rem ---------------------------------------------------------------------------
  -rem jasper.bat - Global Script for Jasper
  +rem Script for Jasper compiler
   rem
  -rem Environment Variable Prequisites:
  -rem   JASPER_HOME (Optional)
  -rem       May point at your Jasper "build" directory.
  -rem       If not present, the current working directory is assumed.
  -rem   JASPER_OPTS (Optional) 
  -rem       Java runtime options
  -rem   JAVA_HOME     
  -rem       Must point at your Java Development Kit installation.
  +rem Environment Variable Prequisites
   rem
  -rem $Id: jasper.bat,v 1.5 2001/10/12 16:51:25 craigmcc Exp $
  +rem   JASPER_HOME   May point at your Catalina "build" directory.
  +rem
  +rem   JASPER_OPTS   (Optional) Java runtime options used when the "start",
  +rem                 "stop", or "run" command is executed.
  +rem
  +rem   JAVA_HOME     Must point at your Java Development Kit installation.
  +rem
  +rem   JAVA_OPTS     (Optional) Java runtime options used when the "start",
  +rem                 "stop", or "run" command is executed.
  +rem
  +rem $Id: jasper.bat,v 1.6 2002/01/15 02:55:39 patrickl Exp $
   rem ---------------------------------------------------------------------------
   
  -rem ----- Save Environment Variables That May Change --------------------------
  -
  -set _JASPER_HOME=%JASPER_HOME%
  -set _CLASSPATH=%CLASSPATH%
  -
  -rem ----- Verify and Set Required Environment Variables -----------------------
  -
  -if not "%JAVA_HOME%" == "" goto gotJava
  -echo You must set JAVA_HOME to point at your Java Development Kit installation
  -goto cleanup
  -:gotJava
  -
  +rem Guess JASPER_HOME if not defined
   if not "%JASPER_HOME%" == "" goto gotHome
   set JASPER_HOME=.
  +if exist "%JASPER_HOME%\bin\jasper.bat" goto okHome
  +set JASPER_HOME=..
   :gotHome
  -if exist %JASPER_HOME%\bin\jpappend.bat goto okHome
  -echo Using JASPER_HOME: %JASPER_HOME%
  -echo JASPER_HOME/bin/jpappend.bat does not exist. Please specify JASPER_HOME properly.
  -goto cleanup
  +if exist "%JASPER_HOME%\bin\jasper.bat" goto okHome
  +echo The JASPER_HOME environment variable is not defined correctly
  +echo This environment variable is needed to run this program
  +goto end
   :okHome
   
  -rem ----- Set Up The Runtime Classpath ----------------------------------------
  +rem Get standard environment variables
  +if exist "%JASPER_HOME%\bin\setenv.bat" call "%JASPER_HOME%\bin\setenv.bat"
   
  -rem FIXME set CLASSPATH=%JASPER_HOME%\dummy
  -rem FIXME below
  -set CLASSPATH=%JASPER_HOME%\classes
  -for %%i in (%JASPER_HOME%\lib\*.jar) do call %JASPER_HOME%\bin\jpappend.bat %%i
  -for %%i in (%JASPER_HOME%\jasper\*.jar) do call %JASPER_HOME%\bin\jpappend.bat %%i
  +rem Get standard Java environment variables
  +if exist "%JASPER_HOME%\bin\setclasspath.bat" goto okSetclasspath
  +echo Cannot find %JASPER_HOME%\bin\setclasspath.bat
  +echo This file is needed to run this program
  +goto end
  +:okSetclasspath
  +set BASEDIR=%JASPER_HOME%
  +call "%JASPER_HOME%\bin\setclasspath.bat"
  +
  +rem Add on extra jar files to CLASSPATH
  +for %%i in ("%JASPER_HOME%\lib\*.jar") do call "%JASPER_HOME%\bin\cpappend.bat" %%i
  +for %%i in ("%JASPER_HOME%\shared\lib\*.jar") do call "%JASPER_HOME%\bin\cpappend.bat" %%i
   set CLASSPATH=%CLASSPATH%;%JASPER_HOME%\common\lib\servlet.jar
  -echo Using CLASSPATH: %CLASSPATH%
  -
  -rem ----- Execute The Requested Command ---------------------------------------
   
  -if "%1" == "jspc" goto doJspc
  -
  -:doUsage
  -echo Usage:  jasper ( jspc )
  +rem Parse arguments
  +if ""%1"" == ""jspc"" goto doJspc
  +echo Usage: jasper ( jspc )
   echo Commands:
  -echo   jspc - Run the jasper offline JSP compiler
  -goto cleanup
  -
  +echo   jspc - Run the offline JSP compiler
  +goto end
   :doJspc
  -java %JASPER_OPTS% -Djasper.home=%JASPER_HOME% org.apache.jasper.JspC %2 %3 %4 %5 %6 %7 %8 %9
  -goto cleanup
  +shift
  +
  +rem Get remaining unshifted command line arguments and save them in the
  +set CMD_LINE_ARGS=
  +:setArgs
  +if ""%1""=="""" goto doneSetArgs
  +set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
  +shift
  +goto setArgs
  +:doneSetArgs
   
  -rem ----- Restore Environment Variables ---------------------------------------
  +%_RUNJAVA% %JAVA_OPTS% %JASPER_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Djasper.home="%JASPER_HOME%" org.apache.jasper.JspC %CMD_LINE_ARGS%
   
  -:cleanup
  -set JASPER_HOME=%_JASPER_HOME%
  -set _JASPER_HOME=
  -set CLASSPATH=%_CLASSPATH%
  -set _CLASSPATH=
  -:finish
  +:end
  
  
  
  1.6       +62 -83    jakarta-tomcat-4.0/jasper/src/bin/jasper.sh
  
  Index: jasper.sh
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/jasper/src/bin/jasper.sh,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- jasper.sh	13 Sep 2001 15:22:45 -0000	1.5
  +++ jasper.sh	15 Jan 2002 02:55:39 -0000	1.6
  @@ -1,117 +1,96 @@
   #!/bin/sh
   # -----------------------------------------------------------------------------
  -# jasper.sh - Global Script Jasper
  +# Script for Jasper compiler
   #
   # Environment Variable Prequisites
   #
  -# Environment Variable Prequisites:
  -#   JASPER_HOME (Optional)
  -#       May point at your Jasper "build" directory.
  -#       If not present, the current working directory is assumed.
  -#   JASPER_OPTS (Optional) 
  -#       Java runtime options
  -#   JAVA_HOME     
  -#       Must point at your Java Development Kit installation.
  +#   JASPER_HOME   May point at your Catalina "build" directory.
   #
  -# $Id: jasper.sh,v 1.5 2001/09/13 15:22:45 craigmcc Exp $
  +#   JASPER_OPTS   (Optional) Java runtime options used when the "start",
  +#                 "stop", or "run" command is executed.
  +#
  +#   JAVA_HOME     Must point at your Java Development Kit installation.
  +#
  +#   JAVA_OPTS     (Optional) Java runtime options used when the "start",
  +#                 "stop", or "run" command is executed.
  +#
  +# $Id: jasper.sh,v 1.6 2002/01/15 02:55:39 patrickl Exp $
   # -----------------------------------------------------------------------------
   
  +# OS specific support.  $var _must_ be set to either true or false.
  +cygwin=false
  +case "`uname`" in
  +CYGWIN*) cygwin=true;;
  +esac
   
  -# ----- Verify and Set Required Environment Variables -------------------------
  -
  -if [ -z "$JASPER_HOME" ] ; then
  -  ## resolve links - $0 may be a link to  home
  -  PRG=$0
  -  progname=`basename $0`
  -  
  -  while [ -h "$PRG" ] ; do
  -    ls=`ls -ld "$PRG"`
  -    link=`expr "$ls" : '.*-> \(.*\)$'`
  -    if expr "$link" : '.*/.*' > /dev/null; then
  -	PRG="$link"
  -    else
  -	PRG="`dirname $PRG`/$link"
  -    fi
  -  done
  -  
  -  JASPER_HOME_1=`dirname "$PRG"`/..
  -  echo "Guessing JASPER_HOME from catalina.sh to ${JASPER_HOME_1}" 
  -    if [ -d ${JASPER_HOME_1}/conf ] ; then 
  -	JASPER_HOME=${JASPER_HOME_1}
  -	echo "Setting JASPER_HOME to $JASPER_HOME"
  -    fi
  -fi
  +# resolve links - $0 may be a softlink
  +PRG="$0"
   
  -if [ "$JASPER_OPTS" = "" ] ; then
  -  JASPER_OPTS=""
  -fi
  +while [ -h "$PRG" ]; do
  +  ls=`ls -ld "$PRG"`
  +  link=`expr "$ls" : '.*-> \(.*\)$'`
  +  if expr "$link" : '.*/.*' > /dev/null; then
  +    PRG="$link"
  +  else
  +    PRG=`dirname "$PRG"`/"$link"
  +  fi
  +done
   
  -if [ "$JAVA_HOME" = "" ] ; then
  -  echo "You must set JAVA_HOME to point at your Java Development Kit installation"
  -  exit 1
  +# Get standard environment variables
  +PRGDIR=`dirname "$PRG"`
  +JASPER_HOME=`cd "$PRGDIR/.." ; pwd`
  +if [ -r "$JASPER_HOME"/bin/setenv.sh ]; then
  +  . "$JASPER_HOME"/bin/setenv.sh
   fi
   
  -
  -# ----- Cygwin Unix Paths Setup -----------------------------------------------
  -
  -# Cygwin support.  $cygwin _must_ be set to either true or false.
  -case "`uname`" in
  -  CYGWIN*) cygwin=true ;;
  -  *) cygwin=false ;;
  -esac
  - 
   # For Cygwin, ensure paths are in UNIX format before anything is touched
  -if $cygwin ; then
  -  [ -n "$JASPER_HOME" ] &&
  -    JASPER_HOME=`cygpath --unix "$JASPER_HOME"`
  -    [ -n "$JAVA_HOME" ] &&
  -    JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
  +if $cygwin; then
  +  [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
  +  [ -n "$JASPER_HOME" ] && JASPER_HOME=`cygpath --unix "$JASPER_HOME"`
  +  [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
   fi
   
  +# Get standard Java environment variables
  +if [ -r "$JASPER_HOME"/bin/setclasspath.sh ]; then
  +  BASEDIR="$JASPER_HOME"
  +  . "$JASPER_HOME"/bin/setclasspath.sh
  +else
  +  echo "Cannot find $JASPER_HOME/bin/setclasspath.sh"
  +  echo "This file is needed to run this program"
  +  exit 1
  +fi
   
  -# ----- Set Up The System Classpath -------------------------------------------
  -
  -CP="$JASPER_HOME/classes"
  -for i in $JASPER_HOME/jasper/*.jar ; do
  -  CP=$CP:"$i"
  +# Add on extra jar files to CLASSPATH
  +for i in "$JASPER_HOME"/lib/*.jar; do
  +  CLASSPATH="$CLASSPATH":"$i"
   done
  -for i in $JASPER_HOME/lib/*.jar ; do
  -  CP=$CP:"$i"
  +for i in "$JASPER_HOME"/shared/lib/*.jar; do
  +  CLASSPATH="$CLASSPATH":"$i"
   done
  -CP=$CP:"$JASPER_HOME/common/classes"
  -for i in $JASPER_HOME/common/lib/*.jar ; do
  -  CP=$CP:"$i"
  -done
  -
  -
  -# ----- Cygwin Windows Paths Setup --------------------------------------------
  +CLASSPATH="$CLASSPATH":"$JASPER_HOME"/common/lib/servlet.jar
   
  -# convert the existing path to windows
  -if $cygwin ; then
  -   CP=`cygpath --path --windows "$CP"`
  -   JASPER_HOME=`cygpath --path --windows "$JASPER_HOME"`
  -   JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
  +# For Cygwin, switch paths to Windows format before running java
  +if $cygwin; then
  +  JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
  +  JASPER_HOME=`cygpath --path --windows "$JASPER_HOME"`
  +  CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
   fi
   
  -
   # ----- Execute The Requested Command -----------------------------------------
   
  -echo "Using CLASSPATH:   $CP"
  -echo "Using JASPER_HOME: $JASPER_HOME"
  -echo "Using JAVA_HOME:   $JAVA_HOME"
  -
   if [ "$1" = "jspc" ] ; then
   
     shift
  -  java $JASPER_OPTS -classpath $CP \
  -   -Djasper.home=$JASPER_HOME \
  -   org.apache.jasper.JspC "$@"
  +  exec "$_RUNJAVA" $JAVA_OPTS $JASPER_OPTS \
  +    -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
  +    -Djasper.home="$JASPER_HOME" \
  +    org.apache.jasper.JspC "$@"
   
   else
   
  -  echo "Usage: jasper.sh [ jspc ]"
  +  echo "Usage: jasper.sh ( jspc )"
     echo "Commands:"
  -  echo   jspc - Run the jasper offline JSP compiler
  +  echo "  jspc - Run the offline JSP compiler"
     exit 1
   
   fi
  
  
  
  1.2       +35 -26    jakarta-tomcat-4.0/jasper/src/bin/jspc.bat
  
  Index: jspc.bat
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/jasper/src/bin/jspc.bat,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- jspc.bat	12 Aug 2000 00:52:05 -0000	1.1
  +++ jspc.bat	15 Jan 2002 02:55:39 -0000	1.2
  @@ -1,32 +1,41 @@
   @echo off
  -rem ---
  -rem jspc.bat - Script ro run the Jasper "offline JSP compiler"
  +if "%OS%" == "Windows_NT" setlocal
  +rem ---------------------------------------------------------------------------
  +rem Script to run the Jasper "offline JSP compiler"
   rem
  -rem $Id: jspc.bat,v 1.1 2000/08/12 00:52:05 pierred Exp $
  -rem ---
  +rem $Id: jspc.bat,v 1.2 2002/01/15 02:55:39 patrickl Exp $
  +rem ---------------------------------------------------------------------------
   
  -rem --- Save Env Variables
  -set _JASPER_HOME=%JASPER_HOME%
  -
  -rem --- Set Env Variables
  -if not "%JASPER_HOME%" == "" goto gotJasperHome
  -echo JASPER_HOME not set. Assuming parent directory.
  +rem Guess JASPER_HOME if not defined
  +if not "%JASPER_HOME%" == "" goto gotHome
  +set JASPER_HOME=.
  +if exist "%JASPER_HOME%\bin\jspc.bat" goto okHome
   set JASPER_HOME=..
  -:gotJasperHome
  +:gotHome
  +if exist "%JASPER_HOME%\bin\jspc.bat" goto okHome
  +echo The JASPER_HOME environment variable is not defined correctly
  +echo This environment variable is needed to run this program
  +goto end
  +:okHome
  +
  +set EXECUTABLE=%JASPER_HOME%\bin\jasper.bat
  +
  +rem Check that target executable exists
  +if exist "%EXECUTABLE%" goto okExec
  +echo Cannot find %EXECUTABLE%
  +echo This file is needed to run this program
  +goto end
  +:okExec
  +
  +rem Get remaining unshifted command line arguments and save them in the
  +set CMD_LINE_ARGS=
  +:setArgs
  +if ""%1""=="""" goto doneSetArgs
  +set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
  +shift
  +goto setArgs
  +:doneSetArgs
   
  -rem --- got jasper.bat?
  -if exist %JASPER_HOME%\bin\jasper.bat goto gotJasperBat
  -echo Using JASPER_HOME: %JASPER_HOME%
  -echo jasper.bat does not exist. Please specify JASPER_HOME properly.
  -goto restore
  -:gotJasperbat
  -
  -rem --- jspc is invoked via jasper's generic script
  -%JASPER_HOME%\bin\jasper jspc %1 %2 %3 %4 %5 %6 %7 %8 %9
  -
  -rem --- Restore Env Variables
  -:restore
  -set JASPER_HOME=%_JASPER_HOME%
  -set _JASPER_HOME=
  +call "%EXECUTABLE%" jspc %CMD_LINE_ARGS%
   
  -:eof
  +:end
  
  
  
  1.2       +26 -4     jakarta-tomcat-4.0/jasper/src/bin/jspc.sh
  
  Index: jspc.sh
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/jasper/src/bin/jspc.sh,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- jspc.sh	12 Aug 2000 00:52:05 -0000	1.1
  +++ jspc.sh	15 Jan 2002 02:55:39 -0000	1.2
  @@ -1,9 +1,31 @@
   #!/bin/sh
   # -----------------------------------------------------------------------------
  -# jspc.sh - Script ro run the Jasper "offline JSP compiler"
  +# Script to run the Jasper "offline JSP compiler"
   #
  -# $Id: jspc.sh,v 1.1 2000/08/12 00:52:05 pierred Exp $
  +# $Id: jspc.sh,v 1.2 2002/01/15 02:55:39 patrickl Exp $
   # -----------------------------------------------------------------------------
   
  -BASEDIR=`dirname $0`
  -$BASEDIR/jasper.sh jspc "$@"
  +# resolve links - $0 may be a softlink
  +PRG="$0"
  +
  +while [ -h "$PRG" ] ; do
  +  ls=`ls -ld "$PRG"`
  +  link=`expr "$ls" : '.*-> \(.*\)$'`
  +  if expr "$link" : '.*/.*' > /dev/null; then
  +    PRG="$link"
  +  else
  +    PRG=`dirname "$PRG"`/"$link"
  +  fi
  +done
  + 
  +PRGDIR=`dirname "$PRG"`
  +EXECUTABLE=jasper.sh
  +
  +# Check that target executable exists
  +if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
  +  echo "Cannot find $PRGDIR/$EXECUTABLE"
  +  echo "This file is needed to run this program"
  +  exit 1
  +fi
  +
  +exec "$PRGDIR"/"$EXECUTABLE" jspc "$@"
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message