Ignore:
Timestamp:
2011-07-20T15:06:40+12:00 (13 years ago)
Author:
ak19
Message:

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 collecthome property is reinstated when the gsdlsite.cfg is generated, by taking this from the gsdlsite.cfg.bak file.

Location:
main/trunk/greenstone2
Files:
2 edited

Legend:

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

    r24006 r24295  
    204204
    205205:cfgcgi
     206:: Need to preserve the user-assigned collecthome property, if any
    206207if exist "%GSDLHOME%\%cgibin%\gsdlsite.cfg" goto cgimsg
    207208echo Configuring %cgibin%\gsdlsite.cfg
     
    209210echo # For local customization of Greenstone, edit gsdlsite.cfg.in >> "%cgibin%\gsdlsite.cfg"
    210211echo. >> "%cgibin%\gsdlsite.cfg"
     212
    211213for /F "delims=*" %%T in ('"echo %GSDLHOME%| %_sed% s@\\@\\\\@g"') do set safepath=%%T
    212214%_sed% "s@\*\*GSDLHOME\*\*@\"%safepath%\"@g" "%cgibin%\gsdlsite.cfg.in" >> "%cgibin%\gsdlsite.cfg"
    213215set safepath=
     216
     217if exist "%cgibin%\gsdlsite.cfg.bak" FOR /F "tokens=2" %%G IN ('findstr /R ^collecthome "%cgibin%\gsdlsite.cfg.bak"') do set colhome=%%G
     218if not "%colhome%" == "" echo collecthome %colhome% >> "%cgibin%\gsdlsite.cfg"& echo. >> "%cgibin%\gsdlsite.cfg"
     219set colhome=
     220
    214221goto cgifin
    215222
  • main/trunk/greenstone2/gsicontrol.sh

    r23988 r24295  
    4141    echo "" >> "$cgibin/gsdlsite.cfg" ;
    4242    sed "s@\*\*GSDLHOME\*\*@$GSDLHOME@g" "$cgibin/gsdlsite.cfg.in" >> "$cgibin/gsdlsite.cfg" ;
     43# preserve the user-assigned collecthome property, if any
     44    if test -e "$GSDLHOME/$cgibin/gsdlsite.cfg.bak" ; then
     45        collecthome=`egrep "^collecthome" "$cgibin/gsdlsite.cfg.bak" | awk '{print $2}'` ;
     46        if test -n $collecthome ; then
     47        echo "collecthome $collecthome" >> "$cgibin/gsdlsite.cfg" ;
     48        echo "" >> "$cgibin/gsdlsite.cfg" ;
     49        fi
     50    fi
    4351    else
    4452    echo "WARNING: Nothing done for make configure-cgi." ;
Note: See TracChangeset for help on using the changeset viewer.