Ignore:
Timestamp:
2011-11-30T17:48:15+13:00 (12 years ago)
Author:
ak19
Message:

Changes to bat files and perl code to deal with brackets in (Windows) filepath. Also checked winmake.bat files to see if changes were needed there. These changes go together with the commits 24826 to 24828 for gems.bat, and commit 24820 on makegs2.bat.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/gs2-web-server.bat

    r24508 r24829  
    11@echo off
    2 SETLOCAL
     2SETLOCAL enabledelayedexpansion
    33
    44if "%serverlang%" == "" set serverlang=en
     
    2121:: Some users may set the above line manually
    2222if "%gsdl2path%" == "" (
    23    set GSDLHOME=%CD%
    24    set gsdl2path=%CD%
     23   set GSDLHOME=!CD!
     24   set gsdl2path=!CD!
    2525)
    2626
     
    2929    echo Checking if the Greenstone log directory is writable ...
    3030    if not exist "%GSDLHOME%\etc\logs-gsi" goto missingLogDir
    31     (echo This is a temporary file. It is safe to delete it. > "%GSDLHOME%\etc\logs-gsi\testing.tmp" ) 2>nul
     31    (echo This is a temporary file. It is safe to delete it. > "!GSDLHOME!\etc\logs-gsi\testing.tmp" ) 2>nul
    3232    if exist "%GSDLHOME%\etc\logs-gsi\testing.tmp" goto deleteTempFile 
    3333    if "%1" == "Elevated" goto printWarning
    3434    echo ... FAILED
    35     echo The Greenstone server cannot write to the log directory (%GSDLHOME%\etc\logs-gsi)
     35    echo The Greenstone server cannot write to the log directory (!GSDLHOME!\etc\logs-gsi)
    3636    echo Requesting elevated status to become admin user to continue.
    3737    "%GSDLHOME%\bin\windows\gstart.exe" %0 Elevated %1 %2 %3 %4 %5 %6 %7 %8 %9
     
    4040:missingLogDir
    4141    echo ... FAILED
    42     echo The Greenstone log directory does not exist (%GSDLHOME%\etc\logs-gsi). Please reinstall Greenstone.
     42    echo The Greenstone log directory does not exist (!GSDLHOME!\etc\logs-gsi). Please reinstall Greenstone.
    4343    pause
    4444    goto exit
     
    4646:printWarning
    4747    echo ... FAILED
    48     echo The Greenstone server cannot write to the log directory (%GSDLHOME%\etc\logs-gsi).
     48    echo The Greenstone server cannot write to the log directory (!GSDLHOME!\etc\logs-gsi).
    4949    echo Attempting to continue without permissions.
    5050    goto shiftElevated
     
    6464:: If either GSDLHOME or GSDLOS is not set, need to run setup.bat first
    6565:: OR operations in an IF stmt: http://fixunix.com/ms-dos/21057-how-implement-if-condition-batch-file.html
    66 for %%i in ("%GSDLOS%" "%GSDLHOME%") do if %%i == "" set OR=True
     66for %%i in ("!GSDLOS!" "!GSDLHOME!") do if %%i == "" set OR=True
    6767if "%OR%" == "True" (
    68    pushd "%gsdl2path%"
     68   pushd "!gsdl2path!"
    6969   call setup.bat
    7070rem   echo **** GSDLOS: %GSDLOS% and GSDLHOME: %GSDLHOME%
     
    9797if exist "%GSDLHOME%\llssite.cfg" goto cfgfile
    9898if exist "%GSDLHOME%\llssite.cfg.in" (
    99    copy "%GSDLHOME%\llssite.cfg.in" "%GSDLHOME%\llssite.cfg"
     99   copy "!GSDLHOME!\llssite.cfg.in" "!GSDLHOME!\llssite.cfg"
    100100) else (
    101101   echo Warning: could not find llssite.cfg.in to create llssite.cfg from.
     
    129129if not "%CLASSPATH%" == "" if not "%CLASSPATH%" == "%test_cpath%" (
    130130   echo   - CLASSPATH already correct:
    131    echo %CLASSPATH%
     131   echo !CLASSPATH!
    132132   goto :eof
    133133)
     
    173173   echo.
    174174   echo Server log messages go to:
    175    echo    "%GSDLHOME%\etc\logs-gsi\server.log"
     175   echo    "!GSDLHOME!\etc\logs-gsi\server.log"
    176176   echo.
    177177   echo Using Apache web server located at:
    178    echo    "%GSDLHOME%\apache-httpd\%GSDLOS%\bin\httpd"
     178   echo    "!GSDLHOME!\apache-httpd\!GSDLOS!\bin\httpd"
    179179   echo The Apache error log is at:
    180    echo    "%GSDLHOME%\apache-httpd\%GSDLOS%\logs\error_log"
     180   echo    "!GSDLHOME!\apache-httpd\!GSDLOS!\logs\error_log"
    181181   echo The Apache configuration file template is at:
    182    echo    "%GSDLHOME%\apache-httpd\%GSDLOS%\conf\httpd.conf.in"
     182   echo    "!GSDLHOME!\apache-httpd\!GSDLOS!\conf\httpd.conf.in"
    183183   echo This is used to generate:
    184    echo    "%GSDLHOME%\apache-httpd\%GSDLOS%\conf\httpd.conf"
     184   echo    "!GSDLHOME!\apache-httpd\!GSDLOS!\conf\httpd.conf"
    185185   echo    each time Enter Library is pressed or otherwise activated.
    186186   echo ***************************************************************
Note: See TracChangeset for help on using the changeset viewer.