Changeset 22075 for main/trunk


Ignore:
Timestamp:
2010-05-11T17:16:58+12:00 (14 years ago)
Author:
ak19
Message:

Needed to gs3-setup.bat working again since gs3-server.bat wasn't working when there were spaces in the GS3 filepath: 1. global variables declared in gs3-setup.bat needed to be exported after endlocal in the same line as endlocal. 2. The setting of the classpath was broken when there spaces in the paths and didn't include the full path to included jars.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/gs3-setup.bat

    r22069 r22075  
    4646
    4747:: a little dynamic set cp stuff
    48 if exist !TMP!\setcp.bat del !TMP!\setcp.bat
    49 for %%j in (!TOMCAT_HOME!\common\endorsed\*.jar) do echo set CLASSPATH=%%CLASSPATH%%;%%j>> !TMP!\setcp.bat
    50 for %%j in (!TOMCAT_HOME!\lib\*.jar) do echo set CLASSPATH=%%CLASSPATH%%;%%j>> !TMP!\setcp.bat
     48if exist "!TMP!\setcp.bat" del "!TMP!\setcp.bat"
     49
     50:: http://ss64.com/nt/for_cmd.html, how to deal with spaces in the file list in a for command
     51:: Note that TOMCAT_HOME\common\endorsed only exists for Tomcat 5, not Tomcat 6
     52:: (where it contains xercesImpl.jar and xml-apis.jar which aren't there in Tomcat 6)
     53if exist "!TOMCAT_HOME!\common\endorsed\*.jar" for /f %%j in ('dir/b ^"!TOMCAT_HOME!\common\endorsed\*.jar^"') do echo set CLASSPATH=%%CLASSPATH%%;%%TOMCAT_HOME%%\common\endorsed\%%j>> !TMP!\setcp.bat
     54for /f %%j in ('dir/b ^"!TOMCAT_HOME!\lib\*.jar^"') do echo set CLASSPATH=%%CLASSPATH%%;%%TOMCAT_HOME%%\lib\%%j>> !TMP!\setcp.bat
     55
    5156if exist !TMP!\setcp.bat call !TMP!\setcp.bat
    5257if exist !TMP!\setcp.bat del !TMP!\setcp.bat
     
    144149echo GSDL3HOME    : !GSDL3HOME!
    145150echo JAVA         : !RUNJAVA!
     151
    146152if "!ANT_HOME!" == "" (
    147153   echo.
     
    149155   echo Please make sure you have Ant version 1.7.1 or higher installed
    150156   echo Then set ANT_HOME to the ant installation folder
    151    echo and add the path to its bin folder to the PATH
     157   echo and add the path to its bin folder to the PATH environment variable
    152158) else (
    153159   echo ANT_HOME     : !ANT_HOME!
     
    158164:: Restore global variables that would otherwise be lost at script's end due to their having been initialised in a
    159165:: set local/set enabledelayedexpansion section. See http://ss64.com/nt/endlocal.html
    160 endlocal & set RUNJAVA=%RUNJAVA%
    161 
    162 set PATH=%PATH%
    163 set GSDL3HOME=%GSDL3HOME%
    164 set GSDL3SRCHOME=%GSDL3SRCHOME%
    165 set JAVA_HOME=%JAVA_HOME%
    166 set JRE_HOME=%JRE_HOME%
    167 set ANT_HOME=%ANT_HOME%
    168 set RUNJAVA=%RUNJAVA%
     166endlocal & set RUNJAVA=%RUNJAVA%& set PATH=%PATH%& set GSDL3HOME=%GSDL3HOME%& set GSDL3SRCHOME=%GSDL3SRCHOME%& set JAVA_HOME=%JAVA_HOME%& set JRE_HOME=%JRE_HOME%& set ANT_HOME=%ANT_HOME%& set CLASSPATH=%CLASSPATH%
    169167
    170168:end
Note: See TracChangeset for help on using the changeset viewer.