Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51206

Make CATALINA_BASE visible to setenv.[sh|bat] (rjung)

git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@1146097 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
commit 535e99470c49ffb88318b44076d3a660d920cd2d 1 parent 7b30a28
@markt-asf markt-asf authored
Showing with 17 additions and 24 deletions.
  1. +0 −11 STATUS.txt
  2. +10 −9 bin/catalina.bat
  3. +7 −4 bin/catalina.sh
View
11 STATUS.txt
@@ -185,17 +185,6 @@ PATCHES PROPOSED TO BACKPORT:
+1: markt, kkolinko
-1:
-* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51206
- Make CATALINA_BASE visible to setenv.[sh|bat]
- http://svn.apache.org/viewvc?rev=1137862&view=rev
- Patch by rjung
- +1: markt, kkolinko, kfujino
- -1:
-
- kkolinko: As a slight enhancement to the fix, the code that calls
- setenv.bat|sh few lines later can be a bit simplified now, knowing
- that CATALINA_BASE is already set.
-
* Update commons pool to 1.5.6
http://svn.apache.org/viewvc?rev=1095138&view=rev
It is used in TC7 since 7.0.14
View
19 bin/catalina.bat
@@ -99,17 +99,22 @@ 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=
rem Get standard environment variables
-if "%CATALINA_BASE%" == "" goto gotSetenvHome
-if exist "%CATALINA_BASE%\bin\setenv.bat" call "%CATALINA_BASE%\bin\setenv.bat"
-goto gotSetenvBase
-:gotSetenvHome
+if not exist "%CATALINA_BASE%\bin\setenv.bat" goto checkSetenvHome
+call "%CATALINA_BASE%\bin\setenv.bat"
+goto setenvDone
+:checkSetenvHome
if exist "%CATALINA_HOME%\bin\setenv.bat" call "%CATALINA_HOME%\bin\setenv.bat"
-:gotSetenvBase
+:setenvDone
rem Get standard Java environment variables
if exist "%CATALINA_HOME%\bin\setclasspath.bat" goto okSetclasspath
@@ -121,10 +126,6 @@ set "BASEDIR=%CATALINA_HOME%"
call "%CATALINA_HOME%\bin\setclasspath.bat" %1
if errorlevel 1 goto end
-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
View
11 bin/catalina.sh
@@ -113,14 +113,17 @@ 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=
-if [ -r "$CATALINA_BASE"/bin/setenv.sh ]; then
- . "$CATALINA_BASE"/bin/setenv.sh
-elif [ -r "$CATALINA_HOME"/bin/setenv.sh ]; then
- . "$CATALINA_HOME"/bin/setenv.sh
+if [ -r "$CATALINA_BASE/bin/setenv.sh" ]; then
+ . "$CATALINA_BASE/bin/setenv.sh"
+elif [ -r "$CATALINA_HOME/bin/setenv.sh" ]; then
+ . "$CATALINA_HOME/bin/setenv.sh"
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
Please sign in to comment.
Something went wrong with that request. Please try again.