Ignore:
Timestamp:
2011-07-20T18:52:50+12:00 (13 years ago)
Author:
ak19
Message:

Improvement to code committed previously: Fixed a bug introduced with the reset-gsdlhome target where any non-standard collecthome value written into the gsdlsite.cfg was lost on startup, since reset-gsdlhome always regenerated gsdlsite.cfg from the template file. Now, the relocation code of the reset-gsdlhome target doesn't get exected every time, only when the gsdlhome property in gsdlsite.cfg is different from GSDLHOME var (which points to the current greenstone installation directory.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/gsicontrol.bat

    r24295 r24297  
    178178:: reset-gsdlhome forces configure-cgi by renaming any
    179179:: existing gsdlsite.cfg and by deleting Mac .app files
     180:: However, we only relocate if there is a gsdlsite.cfg file with its gsdlhome
     181:: property the same as the current (greenstone installation) directory
    180182:resethome
    181183echo.
    182 if exist "%GSDLHOME%\%cgibin%\gsdlsite.cfg" (
    183     move "%GSDLHOME%\%cgibin%\gsdlsite.cfg" "%GSDLHOME%\%cgibin%\gsdlsite.cfg.bak" 
    184     echo **** Regenerating %GSDLHOME%\%cgibin%\gsdlsite.cfg
    185     echo **** Previous version of file now %GSDLHOME%\%cgibin%\gsdlsite.cfg.bak
    186 )
    187 
     184if not exist "%GSDLHOME%\%cgibin%\gsdlsite.cfg" goto relocate
     185
     186FOR /F "tokens=2" %%G IN ('findstr /R ^gsdlhome "%cgibin%\gsdlsite.cfg"') do set gshome=%%G
     187if "x%gshome%" == "x%GSDLHOME%" set gshome=& goto exit
     188 
     189move "%GSDLHOME%\%cgibin%\gsdlsite.cfg" "%GSDLHOME%\%cgibin%\gsdlsite.cfg.bak"
     190echo **** Regenerating %GSDLHOME%\%cgibin%\gsdlsite.cfg
     191echo **** Previous version of file now %GSDLHOME%\%cgibin%\gsdlsite.cfg.bak
     192set gshome=
     193
     194:relocate
    188195for /F "delims=*" %%T in ('"echo %GSDLHOME%| %_sed% s@\\@\/@g"') do set safepath=%%T
    189196
     
    214221%_sed% "s@\*\*GSDLHOME\*\*@\"%safepath%\"@g" "%cgibin%\gsdlsite.cfg.in" >> "%cgibin%\gsdlsite.cfg"
    215222set safepath=
    216 
    217 if exist "%cgibin%\gsdlsite.cfg.bak" FOR /F "tokens=2" %%G IN ('findstr /R ^collecthome "%cgibin%\gsdlsite.cfg.bak"') do set colhome=%%G
    218 if not "%colhome%" == "" echo collecthome %colhome% >> "%cgibin%\gsdlsite.cfg"& echo. >> "%cgibin%\gsdlsite.cfg"
    219 set colhome=
    220223
    221224goto cgifin
Note: See TracChangeset for help on using the changeset viewer.