Changeset 24765
- Timestamp:
- 2011-10-17T22:52:27+13:00 (12 years ago)
- Location:
- main/trunk/greenstone2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/cgi-bin/gsdlsite.cfg.in
r24759 r24765 5 5 # points to the GSDLHOME directory 6 6 # This must be set, and must point to the top level Greenstone directory 7 # (usually gsdl or Greenstone). 8 # Put quotes around the GSDLHOME path value if it contains any spaces. 9 # It's important that Tab(s) and not any spaces are used (as a delimiter) 10 # to separate the gsdlhome property key from its value, since the value 11 # is a filepath and can therefore contain spaces of its own. 12 gsdlhome **GSDLHOME** 7 # (usually gsdl or Greenstone) 8 gsdlhome **GSDLHOME** 13 9 14 10 # this is the http address of GSDLHOME -
main/trunk/greenstone2/gsicontrol.bat
r24759 r24765 184 184 if not exist "%GSDLHOME%\%cgibin%\gsdlsite.cfg" goto relocate 185 185 186 :: In gsdlsite.cfg, the tab char (and only the tab char) NEEDS to be the 187 :: delimiter between the gsdlhome property name and its value, the path. 188 :: The tab as delimiter is necessary just for that property line, since 189 :: the path can contain spaces and we therefore can't have space as delim.190 FOR /F "tokens=2 delims=" %%G IN ('findstr /R ^gsdlhome "%GSDLHOME%\%cgibin%\gsdlsite.cfg"') do set gshome=%%G186 set gshome= 187 FOR /F "tokens=*" %%G IN ('findstr /R ^gsdlhome "%GSDLHOME%\%cgibin%\gsdlsite.cfg"') do (call :concat %%G) 188 189 :: The following doesn't work if there are spaces in the gsdlhome filepath 190 ::FOR /F "tokens=2" %%G IN ('findstr /R ^gsdlhome "%GSDLHOME%\%cgibin%\gsdlsite.cfg"') do set gshome=%%G 191 191 :: before string comparison, remove any quotes around gsdlhome value defined in config file 192 if not [%gshome%] == [] set gshome=%gshome:"=% 192 :: if not [%gshome%] == [] set gshome=%gshome:"=% 193 193 194 if "%gshome%" == "%GSDLHOME%" set gshome=& goto exit 194 195 … … 207 208 ::for %%G in (gs2-server.app gli.app client-gli.app gems.app) do if exist "%%G\Contents\document.wflow" del "%%G\Contents\document.wflow" 208 209 goto cfgweb 210 211 :: Subroutine used to glue parts of a filepath that contains spaces back together again 212 :: http://www.computing.net/answers/programming/batch-for-loop-tokens/16727.html 213 :concat 214 :: first remove any quotes around this part of the filepath 215 set suffix=%~1 216 if not "%suffix%" == "gsdlhome" set gshome=%gshome%%suffix% 217 shift 218 if not "%~1"=="" goto concat 219 goto :eof 209 220 210 221 … … 292 303 if "%safepath%" == "" for /F "delims=*" %%T in ('"echo %GSDLHOME%| %_sed% s@\\@\/@g"') do set safepath=%%T 293 304 294 if exist "%GSDLHOME%\%cgibin%\gsdlsite.cfg" FOR /F "tokens=2" %%G IN ('findstr /R ^collecthome "%GSDLHOME%\%cgibin%\gsdlsite.cfg"') do set COLLECTHOME=%%G 305 :: Doesn't work if there are spaces in the collecthome path in gsdlsite.cfg 306 ::if exist "%GSDLHOME%\%cgibin%\gsdlsite.cfg" FOR /F "tokens=2" %%G IN ('findstr /R ^collecthome "%GSDLHOME%\%cgibin%\gsdlsite.cfg"') do set COLLECTHOME=%%G 307 308 :: variable in subroutine concat is called gshome, 309 :: so forced to use it here for collecthome 310 set gshome= 311 if exist "%GSDLHOME%\%cgibin%\gsdlsite.cfg" FOR /F "tokens=*" %%G IN ('findstr /R ^gsdlhome "%GSDLHOME%\%cgibin%\gsdlsite.cfg"') do (call :concat %%G) 312 set COLLECTHOME=%gshome% 313 set gshome= 314 295 315 if "%COLLECTHOME%" == "" set COLLECTHOME=%GSDLHOME%\collect 296 316 for /F "delims=*" %%T in ('"echo %COLLECTHOME%| %_sed% s@\\@\/@g"') do set safecollectpath=%%T
Note:
See TracChangeset
for help on using the changeset viewer.