Changeset 19388

Show
Ignore:
Timestamp:
11.05.2009 17:40:54 (10 years ago)
Author:
ak19
Message:

3 changes. 1. Moved GLI.bat's the finding and setting of GSDLHOME (and GSDL3SRCHOME and GSDL3HOME) into a separate batfile: findgsdl.bat. 2. This bat file is now called by both gli.bat and client-gli.bat, since client-bat can from now on use the same logice to locate a local GS installation. The only difference is that if GSDLHOME is not found, then client-gli runs as before: no Download panel. 3. Client-gli.bat will not look for a gs2build directory located inside a client-gli checkout, but instead search for a local GSDLHOME (including in the directory directly above, in case client-gli.bat is run from a normal GS checkout. IF a GSDLHOME is found (and perl too), then client-gli will enable the Download panel - using the local GSDLHOME to do the downloading.

Location:
gli/trunk
Files:
1 added
2 modified

Legend:

Unmodified
Added
Removed
  • gli/trunk/client-gli.bat

    r19381 r19388  
    33CD /D "%~dp0" 
    44set GLILANG=en 
     5set GLIMODE=client 
    56 
    6 if "%PROGNAME" == "" set PROGNAME=Greenstone 
     7if "%PROGNAME%" == "" set PROGNAME=Greenstone 
    78 
    8 if not "%PROGFULLNAME" == "" goto setvars 
     9if not "%PROGFULLNAME%" == "" goto setvars 
    910if "%GLILANG%" == "es" set PROGFULLNAME="Biblioteca Digital Greenstone"   
    1011if "%GLILANG%" == "fr" set PROGFULLNAME="Bibliothécaire Greenstone" 
     
    3738 
    3839:findGSDL 
    39 echo. 
    40 if "%GLILANG%" == "en" echo %PROGNAME_EN% (%PROGABBR%) 
    41 if "%GLILANG%" == "en" echo Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato 
    42 if "%GLILANG%" == "en" echo %PROGABBR% comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt 
    43 if "%GLILANG%" == "en" echo This is free software, and you are welcome to redistribute it 
    44  
    45 if "%GLILANG%" == "es" echo Interfaz de la %PROGFULLNAME% (%PROGNAME_EN% - %PROGABBR%) 
    46 if "%GLILANG%" == "es" echo Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato 
    47 if "%GLILANG%" == "es" echo La Interfaz de la %PROGFULLNAME% NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÖA. 
    48 if "%GLILANG%" == "es" echo Para mayor informaci¢n vea los t‚rminos de la licencia en LICENSE.txt 
    49 if "%GLILANG%" == "es" echo Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita 
    50  
    51 if "%GLILANG%" == "fr" echo Interface du %PROGFULLNAME% (%PROGNAME_EN% - %PROGABBR%) 
    52 if "%GLILANG%" == "fr" echo Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato 
    53 if "%GLILANG%" == "fr" echo %PROGABBR% est fourni sans AUCUNE GARANTIE; pour des d‚tails, voir LICENSE.txt 
    54 if "%GLILANG%" == "fr" echo Ceci est un logiciel libre, et vous ˆtes invit‚  
    55  le redistribuer 
    56  
    57 if "%GLILANG%" == "ru" echo š¡«š®â¥ç­ë© š­â¥à䥩á %PROGNAME% (%PROGNAME_EN% - %PROGABBR%) 
    58 if "%GLILANG%" == "ru" echo Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato 
    59 if "%GLILANG%" == "ru" echo ˆƒ ­¥ € ¥â €‘Ž‹ž’Ž ˆŠ€Šˆ• ƒ€€’ˆ‰; €¥â «š á¬. ¢ ⥪á⥠LICENSE.TXT 
    60 if "%GLILANG%" == "ru" echo â® - ᢮¡®€­® à á¯à®áâ࠭塞®¥ ¯à®£à ¬¬­®¥ ®¡¥á¯¥ç¥­š¥ š ‚ë ¬®Š¥â¥ à á¯à®áâà ­ïâì ¥£® 
    61  
    62  
    63 :: If there's a gs2build directory nested inside client-gli, then we can 
    64 :: download and build locally, but ONLY if we have perl. Else building 
    65 :: will have to be done remotely. If Perl is found, PERLPATH will be set. 
    66 if not exist gs2build\nul goto findJava 
     40:: Try to detect a local GSDLHOME installation (gs2build). If none can be 
     41:: found, then client-gli won't have a download panel. We're calling  
     42:: findgsdl.bat purely for knowing if there's a GSDLHOME around and to set and 
     43:: use that for downloading. If there IS a local GSDLHOME, then we can download 
     44:: (and build) locally, but ONLY if we have perl. Else downloading and building 
     45:: will have to be done remotely anyway. If Perl is found, PERLPATH will be set. 
     46call findgsdl.bat 
     47if "%GSDLHOME%" == "" goto findJava 
    6748    call findperl.bat 
    6849 
     
    10990 
    11091 
    111 :: If there was a gs2build directory inside the client-gli folder, we'd have looked for Perl. 
    112 :: If we had found Perl, PERLPATH would have been set. If no perl, can't download or build locally 
    113 :: on the client side. If we have Perl, pass the gs2build dir with the -gsdl flag and the PERLPATH. 
    114 if "%PERLPATH%" == "" goto :nogsdl 
    115     "%JAVA_EXECUTABLE%" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar org.greenstone.gatherer.GathererProg -use_remote_greenstone -gsdl %~dp0gs2build -perl %PERLPATH% %1 %2 %3 %4 %5 %6 %7 %8 %9 
     92:: If there a local GS2 installation (GSDLHOME set), we'd have looked for Perl. If we had 
     93:: found Perl, PERLPATH would have been set. If no perl, can't download or build locally on 
     94:: the client side. If we have Perl, pass the gs2build dir with the -gsdl flag and the PERLPATH. 
     95if "%PERLPATH%" == "" goto nogsdl 
     96    echo Perl and GSDLHOME (%GSDLHOME%) detected. Downloading is enabled. 
     97    echo. 
     98    "%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 
    11699    goto finish 
    117100 
    118101:nogsdl 
     102echo Since there's no GSDLHOME, client-GLI's download panel will be deactivated. 
    119103"%JAVA_EXECUTABLE%" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar org.greenstone.gatherer.GathererProg -use_remote_greenstone %1 %2 %3 %4 %5 %6 %7 %8 %9 
    120104 
     
    133117:: ---- Clean up ---- 
    134118set PERLPATH= 
    135 set JAVAPATH= 
    136119set JAVA_EXECUTABLE= 
     120set GLIMODE= 
     121set PROGNAME= 
     122set PROGNAME_EN= 
     123set PROGFULLNAME= 
     124set PROGABBR= 
    137125popd 
  • gli/trunk/gli.bat

    r19336 r19388  
    44CD /D "%~dp0" 
    55set GLILANG=en 
     6echo "%~dp0" 
    67 
     8if "%GLIMODE%" == "" set GLIMODE=local 
    79 
    810::  -------- Run the Greenstone Librarian Interface -------- 
     
    3840if "%PROGNAME_EN%" == "" set PROGNAME_EN=Greenstone Librarian Interface 
    3941 
     42:: Now need to work out the _VERSION, GSDLHOME (and if GS3, then GSDL3SRCHOME and GSDL3HOME) 
    4043:findGSDL 
    41 echo. 
    42 if "%GLILANG%" == "en" ( 
    43         echo %PROGNAME% ^(%PROGABBR%^) 
    44         echo Copyright ^(C^) 2008, New Zealand Digital Library Project, University Of Waikato 
    45         echo %PROGABBR% comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt 
    46         echo This is free software, and you are welcome to redistribute it 
    47     ) 
    48  
    49 if "%GLILANG%" == "es" ( 
    50         echo Interfaz de la %PROGNAME% ^(%PROGNAME_EN% - %PROGABBR%^) 
    51         echo Copyright ^(C^) 2008, New Zealand Digital Library Project, University Of Waikato 
    52         echo La Interfaz de la %PROGNAME% NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÖA. 
    53         echo Para mayor informaci¢n vea los t‚rminos de la licencia en LICENSE.txt 
    54         echo Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita 
    55     ) 
    56  
    57 if "%GLILANG%" == "fr" ( 
    58         echo Interface du %PROGNAME% ^(%PROGNAME_EN% - %PROGABBR%^) 
    59         echo Copyright ^(C^) 2008, New Zealand Digital Library Project, University Of Waikato 
    60         echo %PROGABBR% est fourni sans AUCUNE GARANTIE; pour des d‚tails, voir LICENSE.txt 
    61         echo Ceci est un logiciel libre, et vous ˆtes invit‚  
    62  le redistribuer 
    63     ) 
    64  
    65 if "%GLILANG%" == "ru" ( 
    66         echo š¡«š®â¥ç­ë© š­â¥à䥩á %PROGNAME% ^(%PROGNAME_EN% - %PROGABBR%^) 
    67         echo Copyright ^(C^) 2008, New Zealand Digital Library Project, University Of Waikato 
    68         echo ˆƒ ­¥ € ¥â €‘Ž‹ž’Ž ˆŠ€Šˆ• ƒ€€’ˆ‰; €¥â «š á¬. ¢ ⥪á⥠LICENSE.TXT 
    69         echo â® - ᢮¡®€­® à á¯à®áâ࠭塞®¥ ¯à®£à ¬¬­®¥ ®¡¥á¯¥ç¥­š¥ š ‚ë ¬®Š¥â¥ à á¯à®áâà ­ïâì ¥£® 
    70     ) 
    71  
    72 echo. 
    73 ::  ---- Determine path to Greenstone home for GS2 and GS3 ---- 
    74 set GSDLPATH= 
    75 :: Some users may set the above line manually, or it may be set as an argument 
    76  
    77 set _VERSION= 
    78 if not "%GSDLPATH%" == "" goto getVer 
    79     :: Otherwise gsdlpath is not yet set 
    80     :: Check the env vars first  
    81     if not "%GSDL3SRCHOME%" == "" goto ver3 
    82         if not "%GSDLHOME%" == "" goto ver2 
    83             :: If not set, the default location for the GLI is a subdirectory of Greenstone 
    84             set GSDLPATH=.. 
    85             goto getVer 
    86  
    87 :getVer 
    88 call gsdlver.bat %GSDLPATH% %_VERSION% > nul 
    89 if "%_VERSION%" == "1" goto exit 
    90 ::if we are running GS2, free up any pre-set GS3 environment variables since we won't need them 
    91 if "%_VERSION%" == "2" set GSDL3SRCHOME= 
    92 if "%_VERSION%" == "2" set GSDL3HOME= 
    93 goto testGSDL 
    94  
    95  
    96 :ver3 
    97 set _VERSION=3 
    98 set GSDLPATH=%GSDL3SRCHOME% 
    99 :: if GS2 is now also set, then both GS3 and GS2 are set:  
    100 :: warn the user that we have defaulted to GS3 
    101 if not "%GSDLHOME%" == "" echo Both Greenstone 2 and Greenstone 3 environments are set. 
    102 if not "%GSDLHOME%" == "" echo It is assumed you want to run Greenstone 3. 
    103 if not "%GSDLHOME%" == "" echo If you want to run Greenstone 2, please unset the 
    104 if not "%GSDLHOME%" == "" echo environment variable GSDL3SRCHOME before running GLI. 
    105 if not "%GSDLHOME%" == "" echo. 
    106 goto testGSDL 
    107  
    108  
    109 :ver2 
    110 set _VERSION=2 
    111 set GSDLPATH=%GSDLHOME% 
    112 ::free up the GS3 environment variables since we are running GS2 and don't need them 
    113 set GSDL3SRCHOME= 
    114 set GSDL3HOME= 
    115 goto testGSDL 
    116  
    117  
    118 :testGSDL 
    119 set CHECK=1 
    120 call chkinst.bat "%GSDLPATH%" %_VERSION% %GLILANG% %CHECK% > nul 
    121 if "%CHECK%" == "1" goto exit 
    122     :: otherwise installation worked well 
    123     goto prepGSDL 
    124  
    125  
    126 :prepGSDL 
    127 :: Greenstone 3 case 
    128 if "%_VERSION%" == "3" goto prepGS3 
    129  
    130 if not "%_VERSION%" == "2" echo "Greenstone version unknown" 
    131 if not "%_VERSION%" == "2" goto exit 
    132  
    133 :: Otherwise, we are dealing with Greenstone 2 
    134 :: Setup Greenstone 2, unless it has already been done 
    135 if not "%GSDLHOME%" == "" goto doneGSDL 
    136     call "%GSDLPATH%\setup.bat" SetEnv 
    137     goto doneGSDL 
    138  
    139  
    140 :prepGS3 
    141 set GSDL2PATH= 
    142 :: Some users may set the above line manually 
    143  
    144 if "%GSDL3SRCHOME%" == "" goto setup3 
    145     if "%GSDL3HOME%" == "" goto setup3 
    146         ::otherwise 
    147         goto gs2build 
    148  
    149  
    150 :setup3 
    151 :: Setup Greenstone 3, unless it has already been done 
    152     cd | winutil\setvar.exe GLIDIR > %TMP%\setgli.bat 
    153     call %TMP%\setgli.bat 
    154     del %TMP%\setgli.bat 
    155     cd "%GSDLPATH%" 
    156     call gs3-setup.bat SetEnv 
    157     cd %GLIDIR% 
    158     goto gs2build 
    159  
    160  
    161 :gs2build 
    162     :: If Greenstone version 3 is running, we want to set gsdl2path 
    163     :: Determine GSDLHOME for GS3  
    164     if not "%GSDL2PATH%" == "" goto setupGS2 
    165         :: GSDL2PATH is not yet set.  
    166         :: And if GSDLHOME is not set either, then assume  
    167         :: that the gs2build subdir of GS3 exists 
    168         if "%GSDLHOME%" == "" set GSDL2PATH=%GSDL3SRCHOME%\gs2build 
    169         if "%GSDLHOME%" == "" goto setupGS2  
    170             :: Otherwise GSDLHOME is set, so set GSDL2PATH to GSDLHOME 
    171             echo GSDLHOME environment variable is set to %GSDLHOME%.     
    172             echo Will use this to find build scripts. 
    173             set GSDL2PATH=%GSDLHOME% 
    174  
    175 :setupGS2 
    176 set CHECK=1 
    177 call chkinst.bat "%GSDL2PATH%" 2 %GLILANG% %CHECK% > nul 
    178 if "%CHECK%" == "1" goto exit 
    179     :: otherwise installation worked well 
    180     :: Setup Greenstone, unless it has already been done 
    181     if "%GSDLHOME%" == "" call "%GSDL2PATH%\setup.bat" SetEnv 
    182     :: Either way, we can now dispose of GSDL2PATH 
    183     set GSDL2PATH=   
    184     goto doneGSDL 
    185  
    186  
    187 :doneGSDL 
    188 :: GSDLPATH is no longer needed, since GSDLHOME should now be set 
    189 set GSDLPATH= 
    190  
     44call findgsdl.bat 
     45if "%GSDLHOME%" == "" goto exit 
    19146 
    19247:: Now need to find Perl. If found, PERLPATH will be set 
     
    311166set PERLPATH= 
    312167set JAVA_EXECUTABLE= 
     168set GLIMODE= 
     169set PROGNAME= 
     170set PROGNAME_EN= 
     171set PROGFULLNAME= 
     172set PROGABBR= 
    313173color 07 
    314174popd