From 11e769d7151c347cf2fb788af7c440ec5ec1252d Mon Sep 17 00:00:00 2001 From: rjung Date: Tue, 21 Jun 2011 05:30:55 +0000 Subject: [PATCH] Define CATALINA_BASE fallback earlier, so one can use CATALINA_BASE and CATALINA_HOME variables in setenv without knowing, whether the two have been split (i.e. CATALINA_BASE is set) or not. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1137862 13f79535-47bb-0310-9956-ffa450edef68 --- bin/catalina.bat | 10 ++++++---- bin/catalina.sh | 7 +++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/bin/catalina.bat b/bin/catalina.bat index dbcfff81b..9fa808806 100755 --- a/bin/catalina.bat +++ b/bin/catalina.bat @@ -109,12 +109,18 @@ cd .. set "CATALINA_HOME=%cd%" cd "%CURRENT_DIR%" :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 +rem Copy CATALINA_BASE from CATALINA_HOME if not defined +if not "%CATALINA_BASE%" == "" goto gotBase +set "CATALINA_BASE=%CATALINA_HOME%" +:gotBase + rem Ensure that any user defined CLASSPATH variables are not used on startup, rem but allow them to be specified in setenv.bat, in rare case when it is needed. set CLASSPATH= @@ -145,10 +151,6 @@ set "CLASSPATH=%CLASSPATH%;" :emptyClasspath set "CLASSPATH=%CLASSPATH%%CATALINA_HOME%\bin\bootstrap.jar" -if not "%CATALINA_BASE%" == "" goto gotBase -set "CATALINA_BASE=%CATALINA_HOME%" -:gotBase - if not "%CATALINA_TMPDIR%" == "" goto gotTmpdir set "CATALINA_TMPDIR=%CATALINA_BASE%\temp" :gotTmpdir diff --git a/bin/catalina.sh b/bin/catalina.sh index 9d069b024..f3a380107 100755 --- a/bin/catalina.sh +++ b/bin/catalina.sh @@ -115,6 +115,9 @@ PRGDIR=`dirname "$PRG"` # Only set CATALINA_HOME if not already set [ -z "$CATALINA_HOME" ] && CATALINA_HOME=`cd "$PRGDIR/.." >/dev/null; pwd` +# Copy CATALINA_BASE from CATALINA_HOME if not already set +[ -z "$CATALINA_BASE" ] && CATALINA_BASE="$CATALINA_HOME" + # Ensure that any user defined CLASSPATH variables are not used on startup, # but allow them to be specified in setenv.sh, in rare case when it is needed. CLASSPATH= @@ -172,10 +175,6 @@ if [ ! -z "$CLASSPATH" ] ; then fi CLASSPATH="$CLASSPATH""$CATALINA_HOME"/bin/bootstrap.jar -if [ -z "$CATALINA_BASE" ] ; then - CATALINA_BASE="$CATALINA_HOME" -fi - if [ -z "$CATALINA_OUT" ] ; then CATALINA_OUT="$CATALINA_BASE"/logs/catalina.out fi -- 2.11.0