Ignore:
Timestamp:
2009-05-12T13:25:00+12:00 (15 years ago)
Author:
ak19
Message:

3 changes. 1. Moved gli.sh's logic for finding and setting GSDLHOME (and GSDL3SRCHOME and GSDL3HOME) into a separate bashfile: findgsdl.sh. 2. This script is now called by both gli.sh and client-gli.sh, since client-gli can from now on use the same logic 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.sh will no longer be looking 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.sh is run from a normal GS checkout. IF a GSDLHOME is found (and perl too), then client-gli will enable the Download panel, and use the local GSDLHOME to do any downloading.

File:
1 edited

Legend:

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

    r19392 r19403  
    2424    PROGNAME_EN="Greenstone Librarian Interface"
    2525fi
     26
     27# we're running GLI (or FLI) in client mode
     28GLIMODE="client"
    2629
    2730
     
    5760thisdir="`cd \"$thisdir\" && pwd`"
    5861cd "$thisdir"
     62
     63##  ---- Determine GSDLHOME to see if the download panel can be enabled ----
     64# Need to source a script in order to inherit the env vars it has set.
     65# Try to detect a local GSDLHOME installation (need gs2build). If none can
     66# be found, then client-gli won't have a download panel. We're calling
     67# findgsdl.bat purely for knowing if there's a GSDLHOME around and to set and
     68# use that for downloading. If there IS a local GSDLHOME, then we can download
     69# (and build) locally, but ONLY if we have perl. Else downloading and building
     70# will have to be done remotely anyway. If Perl is found, PERLPATH will be set.
     71source ./findgsdl.sh
     72local_gs="false"
     73if [ "x$GSDLHOME" != "x" ] ; then
     74    # GSDLHOME set, test for perl
     75    # no need to source the findperl script since it does not set env vars
     76    exit_status=0
     77    ./findperl.sh
     78    exit_status=$?
     79    if [ "$exit_status" -ne 1 ]; then
     80    local_gs="true"
     81    fi
     82fi
     83
    5984
    6085## ---- findJava ----
     
    108133
    109134# GS2 only requires -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar. GS3 requires more but it doesn't conflict with GS2:
    110 if [ ! -d "${thisdir}/gs2build" ]; then
     135if [ "$local_gs" = "false" ]; then
     136    echo "Since there's no GSDLHOME, client-GLI's download panel will be deactivated."
     137    echo
    111138    $javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar:lib/commons-codec-1.3.jar:lib/commons-httpclient-3.1-rc1.jar:lib/commons-logging-1.1.jar org.greenstone.gatherer.GathererProg -use_remote_greenstone $*
    112139else
    113140    gsdlos=`uname -s | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
    114 # check for running bash under cygwin
     141    # check for running bash under cygwin
    115142    if test "`echo $gsdlos | sed 's/cygwin//'`" != "$gsdlos" ; then
    116143    gsdlos=windows
    117144    fi
    118     $javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar:lib/commons-codec-1.3.jar:lib/commons-httpclient-3.1-rc1.jar:lib/commons-logging-1.1.jar org.greenstone.gatherer.GathererProg -use_remote_greenstone -gsdl "${thisdir}/gs2build" -gsdlos $gsdlos $*
     145    echo "Perl and GSDLHOME ($GSDLHOME) detected."
     146    echo "Downloading is enabled."
     147    echo
     148    $javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar:lib/commons-codec-1.3.jar:lib/commons-httpclient-3.1-rc1.jar:lib/commons-logging-1.1.jar org.greenstone.gatherer.GathererProg -use_remote_greenstone -gsdl "$GSDLHOME" -gsdlos $gsdlos $*
    119149fi
    120150
Note: See TracChangeset for help on using the changeset viewer.