Opened 14 years ago
#544 new defect
Replacing GSDLHOME var in gsdlsite.cfg on Windows
Reported by: | ak19 | Owned by: | ak19 |
---|---|---|---|
Priority: | low | Milestone: | Greenstone 2 wishlist |
Component: | Collection Building | Severity: | trivial |
Keywords: | gsdlhome | Cc: |
Description
This turned out to be a bigger problem than anticipated even after finding a GPL version of sed.
1) Get gsed from http://student.northpark.edu/pemente/sed/ (gsed407x.zip) and put it in bin windows.
2) Modified makegs2.bat with the following prepended at the start of the existing ENDOK target (Oran managed to successfully get backlashes in the gsdlpath replaced with escaped/double backslashes):
:ENDOK
if not exist llssite.cfg copy llssite.cfg.in llssite.cfg
if not exist glisite.cfg copy glisite.cfg.in glisite.cfg
pushd "%CD%"
set gsdlpath=%~dp0
CD /D "%gsdlpath%"
echo "GSDLPATH: %gsdlpath%"
:: the following line escapes backslashes in gsdlpath for the sed regex
for /F %%T in ('"echo %gsdlpath% | bin\windows\sed.exe s@
@
@g"') do set safepath=%%T
echo %safepath%
if not exist cgi-bin\gsdlsite.cfg bin\windows\sed.exe "s@\*\*GSDLHOME\*\*@\"%safepath%\"@g" cgi-bin/gsdlsite.cfg.in > cgi-bin/gsdlsite.cfg
set gsdlpath=
popd
3) While the above works when gsdlpath contains no spaces, it fails at other times.