Changeset 24829 for main/trunk
- Timestamp:
- 2011-11-30T17:48:15+13:00 (12 years ago)
- Location:
- main/trunk
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/client-gli.bat
r19391 r24829 1 1 @echo off 2 setlocal enabledelayedexpansion 3 2 4 pushd "%CD%" 3 5 CD /D "%~dp0" … … 94 96 :: the client side. If we have Perl, pass in GSDLHOME for the -gsdl option and the PERLPATH. 95 97 if "%PERLPATH%" == "" goto nogsdl 96 echo Perl and GSDLHOME ( %GSDLHOME%) detected. Downloading is enabled.98 echo Perl and GSDLHOME (!GSDLHOME!) detected. Downloading is enabled. 97 99 echo. 98 100 "%JAVA_EXECUTABLE%" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar org.greenstone.gatherer.GathererProg -use_remote_greenstone -gsdl "%GSDLHOME%" -perl "%PERLPATH%" %1 %2 %3 %4 %5 %6 %7 %8 %9 … … 124 126 set PROGABBR= 125 127 popd 128 endlocal -
main/trunk/gli/findjava.bat
r20655 r24829 1 1 @echo off 2 setlocal enabledelayedexpansion 2 3 3 4 :: Environment Variables passed in: _VERSION, GLILANG and possibly also … … 21 22 :: else we look for a compiled version of search4j in a GS installation 22 23 if "%_VERSION%" == "2" ( 23 set SEARCH4J_EXECUTABLE= %GSDLHOME%\bin\windows\search4j.exe24 set HINT= %GSDLHOME%\packages\jre24 set SEARCH4J_EXECUTABLE=!GSDLHOME!\bin\windows\search4j.exe 25 set HINT=!GSDLHOME!\packages\jre 25 26 ) 26 27 set SEARCH4J_EXECUTABLE= %GSDL3SRCHOME%\bin\search4j.exe28 set HINT= %GSDL3SRCHOME%\packages\jre27 if "%_VERSION%" == "3" ( 28 set SEARCH4J_EXECUTABLE=!GSDL3SRCHOME!\bin\search4j.exe 29 set HINT=!GSDL3SRCHOME!\packages\jre 29 30 ) 30 31 if not exist "%SEARCH4J_EXECUTABLE%" goto tryJava 31 32 32 :setJexec 33 :setJexec 33 34 "%SEARCH4J_EXECUTABLE%" -e -m "%MIN_VERSION%" -p "%HINT%" | winutil\setvar.exe JAVA_EXECUTABLE > %TMP%\set_java_executable.bat 34 35 call "%TMP%\set_java_executable.bat" … … 56 57 echo WARNING: 57 58 echo Java Runtime not bundled with this Greenstone installation. 58 echo Using JAVA_HOME: %JAVA_HOME%59 echo Using JAVA_HOME: !JAVA_HOME! 59 60 echo ^(NOTE: this needs to be %DISPLAY_MIN_VERSION% or higher.^) 60 61 echo *************************************************************************** … … 97 98 set MIN_VERSION= 98 99 set DISPLAY_MIN_VERSION= 100 101 endlocal & set JAVA_EXECUTABLE=%JAVA_EXECUTABLE%& set GS_JAVA_HOME=%GS_JAVA_HOME% -
main/trunk/gli/gli.bat
r23650 r24829 1 1 @echo off 2 setlocal enabledelayedexpansion 3 2 4 color 0A 3 5 set startdir=%CD% … … 48 50 echo. 49 51 echo Checking if the Greenstone collection directory is writable ... 50 (echo This is a temporary file. It is safe to delete it. > " %GSDLHOME%\collect\testing.tmp" ) 2>nul52 (echo This is a temporary file. It is safe to delete it. > "!GSDLHOME!\collect\testing.tmp" ) 2>nul 51 53 if exist "%GSDLHOME%\collect\testing.tmp" goto deleteTempFile 52 54 if "%1" == "Elevated" goto printWarning 53 55 echo ... FAILED 54 echo The %PROGNAME% cannot write to the collection directory ( %GSDLHOME%\collect)56 echo The %PROGNAME% cannot write to the collection directory (!GSDLHOME!\collect) 55 57 echo Requesting elevated status to become admin user to continue. 56 58 "%GSDLHOME%\bin\windows\gstart.exe" %0 Elevated %1 %2 %3 %4 %5 %6 %7 %8 %9 … … 59 61 :printWarning 60 62 echo ... FAILED 61 echo The %PROGNAME% cannot write to the log directory ( %GSDLHOME%\collect).63 echo The %PROGNAME% cannot write to the log directory (!GSDLHOME!\collect). 62 64 echo Attempting to continue without permissions. 63 65 goto shiftElevated … … 114 116 if not "%GSDL3SRCHOME%" == "" ( 115 117 echo GSDL3SRCHOME: 116 echo %GSDL3SRCHOME%118 echo !GSDL3SRCHOME! 117 119 echo. 118 120 ) … … 120 122 if not "%GSDL3HOME%" == "" ( 121 123 echo GSDL3HOME: 122 echo %GSDL3HOME%124 echo !GSDL3HOME! 123 125 echo. 124 126 ) … … 126 128 if not "%GSDLHOME%" == "" ( 127 129 echo GSDLHOME: 128 echo %GSDLHOME%130 echo !GSDLHOME! 129 131 echo. 130 132 ) … … 166 168 :localLib 167 169 if exist "%GSDLHOME%\server.exe" ( 168 set locallib= %GSDLHOME%\server.exe170 set locallib=!GSDLHOME!\server.exe 169 171 ) else ( 170 set locallib= %GSDLHOME%\gs2-web-server.bat172 set locallib=!GSDLHOME!\gs2-web-server.bat 171 173 ) 172 174 … … 211 213 cd "%startdir%" 212 214 set startdir= 215 216 endlocal -
main/trunk/gli/makejar.bat
r24782 r24829 1 1 echo off 2 setlocal enabledelayedexpansion 3 2 4 pushd "%CD%" 3 5 CD /D "%~dp0" … … 115 117 116 118 cd jar 117 " %JARPATH%\jar" xf ..\lib\apache.jar com org118 " %JARPATH%\jar" xf ..\lib\qfslib.jar de119 "!JARPATH!\jar" xf ..\lib\apache.jar com org 120 "!JARPATH!\jar" xf ..\lib\qfslib.jar de 119 121 120 122 cd .. … … 152 154 153 155 if not exist appletstore ( 154 " %JARPATH%\keytool" -genkey -alias privateKey -keystore appletstore -storepass greenstone156 "!JARPATH!\keytool" -genkey -alias privateKey -keystore appletstore -storepass greenstone 155 157 ) 156 158 … … 158 160 if exist appletpasswd ( 159 161 echo Using jarsigner to make signed jar file ... 160 " %JARPATH%\jarsigner" -keystore appletstore -signedjar SignedGatherer.jar GLI.jar privateKey < appletpasswd >NUL 2>NUL162 "!JARPATH!\jarsigner" -keystore appletstore -signedjar SignedGatherer.jar GLI.jar privateKey < appletpasswd >NUL 2>NUL 161 163 echo ... done. 162 164 ) ELSE ( 163 " %JARPATH%\jarsigner" -keystore appletstore -signedjar SignedGatherer.jar GLI.jar privateKey165 "!JARPATH!\jarsigner" -keystore appletstore -signedjar SignedGatherer.jar GLI.jar privateKey 164 166 ) 165 167 echo Installing SignedGatherer in ..\bin\java … … 169 171 170 172 popd 173 endlocal -
main/trunk/greenstone2/bin/script/explode_metadata_database.pl
r24404 r24829 412 412 my ($field, $value) = (@$pair); 413 413 $field =~ s/^ex\.([^.]+)$/$1/; #remove any ex. iff it's the only metadata set prefix (will leave ex.dc.* intact) 414 $value =~ s/\\\\/\\/g; 414 $value =~ s/\\\\/\\/g; # don't regex brackets () here though! 415 415 my $document_file_full; 416 416 … … 596 596 } 597 597 else { 598 $orig_base_dir =~ s/\\/\\\\/g; # escape windows style slashes for the regex below598 $orig_base_dir = &util::filename_to_regex($orig_base_dir); # escape windows style slashes for the regex below 599 599 if ($document_file_full =~ m/^$orig_base_dir.*/) { 600 600 # file local to metadata record -
main/trunk/greenstone2/bin/script/schedule.pl
r21292 r24829 208 208 $os = $ENV{'GSDLOS'}; 209 209 $path = $ENV{'PATH'}; 210 211 if("$gsdl" =~ m/(\\\(|\\\)| )/ ) { # () brackets or spaces in path 212 &gsprintf($out, "\n\n{schedule.filepath_warning}\n\n\n", $gsdl); 213 } 210 214 211 215 my $service = "schedule"; -
main/trunk/greenstone2/bin/script/wvware.pl
r24599 r24829 333 333 my $safe_reg_expression = $assoc_dir_path; 334 334 $safe_reg_expression =~ s/\\/\\\\/g; 335 $safe_reg_expression =~ s@\(@\\(@g; # escape brackets 336 $safe_reg_expression =~ s@\)@\\)@g; # escape brackets 335 337 $safe_reg_expression =~ s/\./\\./g; 336 338 $safe_reg_expression =~ s/\-/\\-/g; -
main/trunk/greenstone2/findjava.bat
r20816 r24829 1 1 @echo off 2 3 setlocal enabledelayedexpansion 2 4 3 5 :: Environment Variables passed in: _VERSION, GLILANG and possibly also … … 21 23 :: else we look for a compiled version of search4j in a GS installation 22 24 if "%_VERSION%" == "2" ( 23 set SEARCH4J_EXECUTABLE= %GSDLHOME%\bin\windows\search4j.exe24 set HINT= %GSDLHOME%\packages\jre25 set SEARCH4J_EXECUTABLE=!GSDLHOME!\bin\windows\search4j.exe 26 set HINT=!GSDLHOME!\packages\jre 25 27 ) 26 28 if "%_VERSION%" == "3" ( 27 set SEARCH4J_EXECUTABLE= %GSDL3SRCHOME%\bin\search4j.exe28 set HINT= %GSDL3SRCHOME%\packages\jre29 set SEARCH4J_EXECUTABLE=!GSDL3SRCHOME!\bin\search4j.exe 30 set HINT=!GSDL3SRCHOME!\packages\jre 29 31 ) 30 32 if not exist "%SEARCH4J_EXECUTABLE%" goto tryJava … … 56 58 echo WARNING: 57 59 echo Java Runtime not bundled with this Greenstone installation. 58 echo Using JAVA_HOME: %JAVA_HOME%60 echo Using JAVA_HOME: !JAVA_HOME! 59 61 echo ^(NOTE: this needs to be %DISPLAY_MIN_VERSION% or higher.^) 60 62 echo *************************************************************************** … … 97 99 set MIN_VERSION= 98 100 set DISPLAY_MIN_VERSION= 101 102 endlocal & set JAVA_EXECUTABLE=%JAVA_EXECUTABLE%& set GS_JAVA_HOME=%GS_JAVA_HOME% -
main/trunk/greenstone2/gs2-server.bat
r22687 r24829 1 1 @echo off 2 setlocal enabledelayedexpansion 3 2 4 pushd "%CD%" 3 5 CD /D "%~dp0" … … 8 10 echo Checking if the Greenstone log directory is writable ... 9 11 if not exist "%GSDLHOME%\etc\logs-gsi" goto missingLogDir 10 (echo This is a temporary file. It is safe to delete it. > " %GSDLHOME%\etc\logs-gsi\testing.tmp" ) 2>nul12 (echo This is a temporary file. It is safe to delete it. > "!GSDLHOME!\etc\logs-gsi\testing.tmp" ) 2>nul 11 13 if exist "%GSDLHOME%\etc\logs-gsi\testing.tmp" goto deleteTempFile 12 14 if "%1" == "Elevated" goto printWarning 13 15 echo ... FAILED 14 echo The Greenstone server cannot write to the log directory ( %GSDLHOME%\etc\logs-gsi)16 echo The Greenstone server cannot write to the log directory (!GSDLHOME!\etc\logs-gsi) 15 17 echo Requesting elevated status to become admin user to continue. 16 18 "%GSDLHOME%\bin\windows\gstart.exe" %0 Elevated %1 %2 %3 %4 %5 %6 %7 %8 %9 … … 19 21 :missingLogDir 20 22 echo ... FAILED 21 echo The Greenstone log directory does not exist ( %GSDLHOME%\etc\logs-gsi). Please either create this directory or reinstall Greenstone.23 echo The Greenstone log directory does not exist (!GSDLHOME!\etc\logs-gsi). Please either create this directory or reinstall Greenstone. 22 24 pause 23 25 goto done … … 25 27 :printWarning 26 28 echo ... FAILED 27 echo The Greenstone server cannot write to the log directory ( %GSDLHOME%\etc\logs-gsi).29 echo The Greenstone server cannot write to the log directory (!GSDLHOME!\etc\logs-gsi). 28 30 echo Attempting to continue without permissions. 29 31 goto shiftElevated … … 52 54 :done 53 55 popd 56 endlocal -
main/trunk/greenstone2/gs2-web-server.bat
r24508 r24829 1 1 @echo off 2 SETLOCAL 2 SETLOCAL enabledelayedexpansion 3 3 4 4 if "%serverlang%" == "" set serverlang=en … … 21 21 :: Some users may set the above line manually 22 22 if "%gsdl2path%" == "" ( 23 set GSDLHOME= %CD%24 set gsdl2path= %CD%23 set GSDLHOME=!CD! 24 set gsdl2path=!CD! 25 25 ) 26 26 … … 29 29 echo Checking if the Greenstone log directory is writable ... 30 30 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>nul31 (echo This is a temporary file. It is safe to delete it. > "!GSDLHOME!\etc\logs-gsi\testing.tmp" ) 2>nul 32 32 if exist "%GSDLHOME%\etc\logs-gsi\testing.tmp" goto deleteTempFile 33 33 if "%1" == "Elevated" goto printWarning 34 34 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) 36 36 echo Requesting elevated status to become admin user to continue. 37 37 "%GSDLHOME%\bin\windows\gstart.exe" %0 Elevated %1 %2 %3 %4 %5 %6 %7 %8 %9 … … 40 40 :missingLogDir 41 41 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. 43 43 pause 44 44 goto exit … … 46 46 :printWarning 47 47 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). 49 49 echo Attempting to continue without permissions. 50 50 goto shiftElevated … … 64 64 :: If either GSDLHOME or GSDLOS is not set, need to run setup.bat first 65 65 :: 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=True66 for %%i in ("!GSDLOS!" "!GSDLHOME!") do if %%i == "" set OR=True 67 67 if "%OR%" == "True" ( 68 pushd " %gsdl2path%"68 pushd "!gsdl2path!" 69 69 call setup.bat 70 70 rem echo **** GSDLOS: %GSDLOS% and GSDLHOME: %GSDLHOME% … … 97 97 if exist "%GSDLHOME%\llssite.cfg" goto cfgfile 98 98 if exist "%GSDLHOME%\llssite.cfg.in" ( 99 copy " %GSDLHOME%\llssite.cfg.in" "%GSDLHOME%\llssite.cfg"99 copy "!GSDLHOME!\llssite.cfg.in" "!GSDLHOME!\llssite.cfg" 100 100 ) else ( 101 101 echo Warning: could not find llssite.cfg.in to create llssite.cfg from. … … 129 129 if not "%CLASSPATH%" == "" if not "%CLASSPATH%" == "%test_cpath%" ( 130 130 echo - CLASSPATH already correct: 131 echo %CLASSPATH%131 echo !CLASSPATH! 132 132 goto :eof 133 133 ) … … 173 173 echo. 174 174 echo Server log messages go to: 175 echo " %GSDLHOME%\etc\logs-gsi\server.log"175 echo "!GSDLHOME!\etc\logs-gsi\server.log" 176 176 echo. 177 177 echo Using Apache web server located at: 178 echo " %GSDLHOME%\apache-httpd\%GSDLOS%\bin\httpd"178 echo "!GSDLHOME!\apache-httpd\!GSDLOS!\bin\httpd" 179 179 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" 181 181 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" 183 183 echo This is used to generate: 184 echo " %GSDLHOME%\apache-httpd\%GSDLOS%\conf\httpd.conf"184 echo "!GSDLHOME!\apache-httpd\!GSDLOS!\conf\httpd.conf" 185 185 echo each time Enter Library is pressed or otherwise activated. 186 186 echo *************************************************************** -
main/trunk/greenstone2/gsicontrol.bat
r24819 r24829 1 1 @echo off 2 2 3 setlocal 3 setlocal enabledelayedexpansion 4 4 5 ::set testdone=0 5 6 set startdir=%CD% … … 25 26 :: directory (after replacing spaces, colons and backslashes) 26 27 set signal=%GSDLHOME: =_% 27 for /F "delims=*" %%T in ('"echo %signal%| %_sed%s@[\\:]@_@g"') do set signal=%%T28 for /F "delims=*" %%T in ('"echo !signal!| !_sed! s@[\\:]@_@g"') do set signal=%%T 28 29 set GS2_APACHE_HTTPD_SIGNAL=GS2_APACHE_HTTPD_%signal% 29 30 set signal= … … 164 165 echo ^<enabled^>true 165 166 echo ^<groups^>administrator,colbuilder,all-collections-editor 166 echo ^<password^> %encrypted_password%167 echo ^<password^>!encrypted_password! 167 168 echo ^<username^>admin 168 ) > " %GSDLHOME%\etc\users.txt"169 type " %GSDLHOME%\etc\users.txt" | txt2db -append "%GSDLHOME%\etc\users.gdb"170 del " %GSDLHOME%\etc\users.txt"169 ) > "!GSDLHOME!\etc\users.txt" 170 type "!GSDLHOME!\etc\users.txt" | txt2db -append "!GSDLHOME!\etc\users.gdb" 171 del "!GSDLHOME!\etc\users.txt" 171 172 ) else ( 172 173 echo Did not set password … … 185 186 186 187 set gshome= 187 FOR /F "tokens=*" %%G IN ('findstr /R ^gsdlhome " %GSDLHOME%\%cgibin%\gsdlsite.cfg"') do (call :concat %%G)188 FOR /F "tokens=*" %%G IN ('findstr /R ^gsdlhome "!GSDLHOME!\!cgibin!\gsdlsite.cfg"') do call :concat %%G 188 189 189 190 :: 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=%%G191 ::FOR /F "tokens=2" %%G IN ('findstr /R ^gsdlhome "!GSDLHOME!\!cgibin!\gsdlsite.cfg"') do set gshome=%%G 191 192 :: before string comparison, remove any quotes around gsdlhome value defined in config file 192 193 :: if not [%gshome%] == [] set gshome=%gshome:"=% … … 201 202 :: The path to the included perl at the top of gliserver.pl needs to use the new gsdlhome 202 203 :: On windows, the path in gliserver.pl uses backslashes 203 for /F "delims=*" %%T in ('"echo %gshome%| %_sed%s@\\@\\\\@g"') do set safeoldhome=%%T204 for /F "delims=*" %%T in ('"echo %gsdlhome%| %_sed%s@\\@\\\\@g"') do set safenewhome=%%T204 for /F "delims=*" %%T in ('"echo !gshome!| !_sed! s@\\@\\\\@g"') do set safeoldhome=%%T 205 for /F "delims=*" %%T in ('"echo !gsdlhome!| !_sed! s@\\@\\\\@g"') do set safenewhome=%%T 205 206 if exist "%GSDLHOME%\bin\%GSDLOS%\perl" ( 206 copy " %cgibin%\gliserver.pl" "%cgibin%\gliserver.pl.bak"207 type " %cgibin%\gliserver.pl.bak" | %_sed% "s@%safeoldhome%@%safenewhome%@g" > "%cgibin%\gliserver.pl"208 del " %cgibin%\gliserver.pl.bak"207 copy "!cgibin!\gliserver.pl" "!cgibin!\gliserver.pl.bak" 208 type "!cgibin!\gliserver.pl.bak" | !_sed! "s@!safeoldhome!@!safenewhome!@g" > "!cgibin!\gliserver.pl" 209 del "!cgibin!\gliserver.pl.bak" 209 210 ) 210 211 set safenewhome= … … 212 213 set gshome= 213 214 214 for /F "delims=*" %%T in ('"echo %GSDLHOME%| %_sed%s@\\@\/@g"') do set safepath=%%T215 for /F "delims=*" %%T in ('"echo !GSDLHOME!| !_sed! s@\\@\/@g"') do set safepath=%%T 215 216 216 217 :: Also re-initialise the log4j.properties and force regeneration of … … 247 248 echo. >> "%cgibin%\gsdlsite.cfg" 248 249 249 for /F "delims=*" %%T in ('"echo %GSDLHOME%| %_sed%s@\\@\\\\@g"') do set safepath=%%T250 for /F "delims=*" %%T in ('"echo !GSDLHOME!| !_sed! s@\\@\\\\@g"') do set safepath=%%T 250 251 %_sed% "s@\*\*GSDLHOME\*\*@\"%safepath%\"@g" "%cgibin%\gsdlsite.cfg.in" >> "%cgibin%\gsdlsite.cfg" 251 252 set safepath= … … 266 267 ::configure-apache 267 268 :cfgapach 268 if not "%configfile%" == "" if exist "%configfile%" (goto cfgport) else (echo Config file %configfile%does not exist. Using default llssite.cfg)269 if not "%configfile%" == "" if exist "%configfile%" (goto cfgport) else (echo Config file !configfile! does not exist. Using default llssite.cfg) 269 270 270 271 if exist "%GSDLHOME%\llssite.cfg" ( 271 set configfile= %GSDLHOME%\llssite.cfg272 set configfile=!GSDLHOME!\llssite.cfg 272 273 goto cfgport 273 274 ) 274 275 if not exist "%GSDLHOME%\llssite.cfg.in" ( 275 echo Unable to proceed as neither %GSDLHOME%\llssite.cfg nor %GSDLHOME%\llssite.cfg.in could be found276 echo Unable to proceed as neither !GSDLHOME!\llssite.cfg nor !GSDLHOME!\llssite.cfg.in could be found 276 277 goto exit 277 278 ) … … 282 283 echo Configuring the apache webserver... 283 284 :: See http://ss64.com/nt/for_cmd.html, http://ss64.com/nt/findstr.html (and http://ss64.com/nt/find.html) 284 FOR /F "tokens=2 delims==" %%G IN ('findstr /R ^portnumber " %configfile%"') do set port=%%G285 FOR /F "tokens=2 delims==" %%G IN ('findstr /R ^hostIP " %configfile%"') do set hostIP=%%G286 FOR /F "tokens=2 delims==" %%G IN ('findstr /R ^hosts " %configfile%"') do set hosts=%%G287 FOR /F "tokens=2 delims==" %%G IN ('findstr /R ^externalaccess " %configfile%"') do set allowfromall=%%G285 FOR /F "tokens=2 delims==" %%G IN ('findstr /R ^portnumber "!configfile!"') do set port=%%G 286 FOR /F "tokens=2 delims==" %%G IN ('findstr /R ^hostIP "!configfile!"') do set hostIP=%%G 287 FOR /F "tokens=2 delims==" %%G IN ('findstr /R ^hosts "!configfile!"') do set hosts=%%G 288 FOR /F "tokens=2 delims==" %%G IN ('findstr /R ^externalaccess "!configfile!"') do set allowfromall=%%G 288 289 289 290 if "%allowfromall%" == "1" set allowfromall="Allow"& goto portcon … … 313 314 goto exit 314 315 ) 315 if "%safepath%" == "" for /F "delims=*" %%T in ('"echo %GSDLHOME%| %_sed%s@\\@\/@g"') do set safepath=%%T316 if "%safepath%" == "" for /F "delims=*" %%T in ('"echo !GSDLHOME!| !_sed! s@\\@\/@g"') do set safepath=%%T 316 317 317 318 :: Doesn't work if there are spaces in the collecthome path in gsdlsite.cfg 318 ::if exist "%GSDLHOME%\%cgibin%\gsdlsite.cfg" FOR /F "tokens=2" %%G IN ('findstr /R ^collecthome " %GSDLHOME%\%cgibin%\gsdlsite.cfg"') do set COLLECTHOME=%%G319 ::if exist "%GSDLHOME%\%cgibin%\gsdlsite.cfg" FOR /F "tokens=2" %%G IN ('findstr /R ^collecthome "!GSDLHOME!\!cgibin!\gsdlsite.cfg"') do set COLLECTHOME=%%G 319 320 320 321 :: variable in subroutine concat is called gshome, 321 322 :: so forced to use it here for collecthome 322 323 set gshome= 323 if exist "%GSDLHOME%\%cgibin%\gsdlsite.cfg" FOR /F "tokens=*" %%G IN ('findstr /R ^collecthome " %GSDLHOME%\%cgibin%\gsdlsite.cfg"') do (call :concat %%G)324 if exist "%GSDLHOME%\%cgibin%\gsdlsite.cfg" FOR /F "tokens=*" %%G IN ('findstr /R ^collecthome "!GSDLHOME!\!cgibin!\gsdlsite.cfg"') do call :concat %%G 324 325 set COLLECTHOME=%gshome% 325 326 set gshome= 326 327 327 328 if "%COLLECTHOME%" == "" set COLLECTHOME=%GSDLHOME%\collect 328 for /F "delims=*" %%T in ('"echo %COLLECTHOME%| %_sed% s@\\@\/@g"') do set safecollectpath=%%T 329 329 for /F "delims=*" %%T in ('"echo !COLLECTHOME!| !_sed! s@\\@\/@g"') do set safecollectpath=%%T 330 330 331 331 echo Port: %port% -
main/trunk/greenstone2/perllib/inexport.pm
r24344 r24829 1035 1035 1036 1036 $situated_dir =~ s/[\\\/]+$//; # remove tailing slashes 1037 $situated_dir = ~ s/\\/\\\\/g; # need to protect windows slash \in regular expression1037 $situated_dir = &util::filename_to_regex($situated_dir); # need to escape windows slash \ and brackets in regular expression 1038 1038 1039 1039 # Go through existing_files, and mark anything that is contained -
main/trunk/greenstone2/perllib/plugins/DirectoryPlugin.pm
r24349 r24829 481 481 foreach my $ek (@extrametakeys) { 482 482 my ($subdir_re,$extrakey_dir) = &File::Basename::fileparse($ek); 483 $extrakey_dir =~ s/\\\./\./g; # remove RE syntax for . 484 $extrakey_dir =~ s/\\\\/\\/g; # remove RE syntax for \ 483 $extrakey_dir = &util::unregex_filename($extrakey_dir); 485 484 486 485 my $dirsep_re = &util::get_re_dirsep(); 487 486 488 my $ek_non_re = $ek; 489 $ek_non_re =~ s/\\\./\./g; # remove RE syntax for . 490 $ek_non_re =~ s/\\\\/\\/g; # remove RE syntax for \ 487 my $ek_non_re = &util::unregex_filename($ek); 491 488 if ($ek_non_re =~ m/$dirsep_re/) { # specifies at least one directory 492 489 my $md = $extrametadata{$ek}; -
main/trunk/greenstone2/perllib/plugouts/BasePlugout.pm
r24404 r24829 735 735 # if (defined $collect_dir) { 736 736 # my $collect_dir_re_safe = $collect_dir; 737 # $collect_dir_re_safe =~ s/\\/\\\\/g; 737 # $collect_dir_re_safe =~ s/\\/\\\\/g; # use &util::filename_to_regex() 738 738 # $collect_dir_re_safe =~ s/\./\\./g;## 739 739 -
main/trunk/greenstone2/perllib/plugouts/DSpacePlugout.pm
r24402 r24829 300 300 $real_filename =~ s/^\\(.*)/$1/i; 301 301 if (-e $real_filename) { 302 # escape backslashes in path for upcoming regex match 303 my $escaped_source_filename = $source_filename; 304 $escaped_source_filename =~ s/\\/\\\\/g; 302 # escape backslashes and brackets in path for upcoming regex match 303 my $escaped_source_filename = &util::filename_to_regex($source_filename); 305 304 if ($real_filename =~ m/$escaped_source_filename$/) { 306 305 next; -
main/trunk/greenstone2/perllib/plugouts/FedoraMETSPlugout.pm
r22465 r24829 613 613 614 614 my $gsdl_href = &util::filename_cat($working_dir, $fname); 615 $collectparent = ~ s/\\/\\\\/g;# escape reserved metacharacter \ in path (by replacing it with \\) for substitution615 $collectparent = &util::filename_to_regex($collectparent); # escape reserved metacharacter \ in path (by replacing it with \\) for substitution 616 616 $gsdl_href =~ s/^$collectparent(\/|\\)?//; # remove the collectparent path in gsdl_href and any trailing slash 617 617 $gsdl_href =~ s/\\/\//g; # make sure we have url paths (which only use / not \) … … 744 744 745 745 my $gsdl_href = &util::filename_cat($working_dir,$assfilePath); 746 $collectparent = ~ s/\\/\\\\/g;# escape reserved metacharacter \ in path (by replacing it with \\) for substitution746 $collectparent = &util::filename_to_regex($collectparent); # escape reserved metacharacter \ in path (by replacing it with \\) for substitution 747 747 $gsdl_href =~ s/^$collectparent(\/|\\)?//; # remove the collectparent path in gsdl_href and any trailing slash 748 748 $gsdl_href =~ s/\\/\//g; # make sure we have url paths (which only use / not \) -
main/trunk/greenstone2/perllib/strings.properties
r24754 r24829 332 332 schedule.frequency.daily:Re-build every day 333 333 schedule.frequency.weekly:Re-build every week 334 schedule.filepath_warning:**** Warning: schedule.pl may not work when Greenstone is installed in a path containing brackets and/or spaces: %s. 334 335 schedule.action:How to set up automatic re-building 335 336 schedule.action.add:Schedule automatic re-building -
main/trunk/greenstone2/perllib/util.pm
r24563 r24829 839 839 # need to put single backslash back to double so that regex works 840 840 if ($ENV{'GSDLOS'} =~ /^windows$/i) { 841 $filename =~ s/\\/\\\\/g; 842 } 841 $filename =~ s/\\/\\\\/g; 842 } 843 844 # note that the first part of a substitution is a regex, so RE chars need to be escaped, 845 # the second part of a substitution is not a regex, so for e.g. full-stop can be specified literally 846 $filename =~ s/\./\\./g; # in case there are extensions/other full stops, escape them 847 $filename =~ s@\(@\\(@g; # escape brackets 848 $filename =~ s@\)@\\)@g; # escape brackets 849 850 return $filename; 851 } 852 853 sub unregex_filename { 854 my $filename = shift (@_); 855 856 # need to put doubled backslashes for regex back to single 857 $filename =~ s/\\\\/\\/g; # remove RE syntax for \ 858 $filename =~ s/\\\./\./g; # remove RE syntax for . 859 $filename =~ s@\\\(@(@g; # remove RE syntax for ( => "\(" turns into "(" 860 $filename =~ s@\\\)@)@g; # remove RE syntax for ) => "\)" turns into ")" 843 861 return $filename; 844 862 } … … 928 946 if ($ENV{'GSDLOS'} =~ /^windows$/i) 929 947 { 930 my $escaped_val = $val; 931 $escaped_val =~ s/\\/\\\\/g; # escape any Windows backslashes for upcoming regex 948 my $escaped_val = &filename_to_regex($val); # escape any Windows backslashes and brackets for upcoming regex 932 949 if (!defined($ENV{$var})) { 933 950 $ENV{$var} = "$val"; … … 953 970 if ($ENV{'GSDLOS'} =~ /^windows$/i) 954 971 { 955 my $escaped_val = $val; 956 $escaped_val =~ s/\\/\\\\/g; # escape any Windows backslashes for upcoming regex 972 my $escaped_val = &filename_to_regex($val); # escape any Windows backslashes and brackets for upcoming regex 957 973 if (!defined($ENV{$var})) { 958 974 $ENV{$var} = "$val"; … … 1048 1064 } 1049 1065 1050 $within_dir =~ s/\\/\\\\/g; # escape DOS style file separator 1051 1066 $within_dir = &filename_to_regex($within_dir); # escape DOS style file separator and brackets 1052 1067 if ($filename =~ m/^$within_dir(.*)$/) { 1053 1068 $filename = $1;
Note:
See TracChangeset
for help on using the changeset viewer.