Changeset 5003


Ignore:
Timestamp:
2003-07-22T14:28:46+12:00 (21 years ago)
Author:
mdewsnip
Message:

Minor changes to make the script more similar to the Windows batch file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/gli.sh

    r4957 r5003  
    22
    33
    4 ##  -- Run the Greenstone Librarian Interface --
     4##  -------- Run the Greenstone Librarian Interface --------
    55
    6 # Script must be run from within the directory in which it lives
     6# This script must be run from within the directory in which it lives
    77thisdir=`pwd`
    88if [ ! -f "${thisdir}/gli.sh" ]; then
     
    1212
    1313
    14 ##  -- Determine GSDLHOME --
    15 gsdlhome=
     14##  ---- Determine GSDLHOME ----
     15gsdlpath=
    1616
    1717# Some users may set the above line manually
    18 if [ "$gsdlhome" == "" ]; then
     18if [ "$gsdlpath" == "" ]; then
    1919    # Check the environment variable first
    2020    if [ "$GSDLHOME" != "" ]; then
    21     gsdlhome=$GSDLHOME
     21    gsdlpath=$GSDLHOME
    2222
    2323    # If it is not set, assume that the GLI is installed as a subdirectory of Greenstone
    2424    else
    2525    pushd .. > /dev/null
    26     gsdlhome=`pwd`
     26    gsdlpath=`pwd`
    2727    popd > /dev/null
    2828    fi
     
    3030
    3131# Check that the Greenstone installation looks OK
    32 if [ ! -x "${gsdlhome}/setup.bash" ] ; then
    33     echo "The Greenstone installation at ${gsdlhome} does not"
    34     echo "appear to be complete. Try reinstalling Greenstone then running"
    35     echo "this script again."
     32echo "Checking GSDL: $gsdlpath"
     33if [ ! -x "${gsdlpath}/setup.bash" ] ; then
     34    echo
     35    echo "The Greenstone installation could not be found, or is incomplete."
     36    echo "Try reinstalling Greenstone then running this script again."
    3637    exit 1
    3738fi
    3839
    39 # Setup Greenstone
    40 pushd $gsdlhome > /dev/null
    41 source setup.bash
    42 echo
    43 popd > /dev/null
     40# Setup Greenstone, unless it has already been done
     41if [ "$GSDLHOME" == "" ]; then
     42    pushd $gsdlpath > /dev/null
     43    source setup.bash
     44    popd > /dev/null
     45fi
    4446
    4547
    46 ##  -- Check Perl exists --
     48##  ---- Check Perl exists ----
    4749perlpath=
    4850
    4951# Some users may set the above line manually
    5052if [ "$perlpath" == "" ]; then
    51     # Try to find it on the search path
     53    # Check if Perl is on the search path
    5254    perlpath=`which perl 2> /dev/null`
    5355fi
    5456
     57# Check that a Perl executable has been found
     58echo "Checking Perl: $perlpath"
    5559if [ ! -x "$perlpath" ] ; then
    56     echo "The Greestone Librarian Interface requires perl in order to operate but"
    57     echo "this installation could not detect perl on your system. Please ensure"
    58     echo "that perl is installed and is on your search path, then rerun this"
    59     echo "script."
     60    echo
     61    echo "The Greestone Librarian Interface requires perl in order to operate,"
     62    echo "but perl could not be detected on your system. Please ensure that perl"
     63    echo "is installed and is on your search path, then rerun this script."
    6064    exit 1
    6165fi
    6266
    6367
    64 ## -- Check Java exists --
     68## ---- Check Java exists ----
    6569javapath=
    6670
    6771# Some users may set the above line manually
    6872if [ "$javapath" == "" ]; then
    69     # Check the environment variable first
     73
     74    # If it is set, use the JAVAHOME environment variable
    7075    if [ "$JAVAHOME" != "" ]; then
    7176    javapath="$JAVAHOME/bin/java"
    7277
    73     # If it is not set, hope it is on the search path
     78    # Check if Java is on the search path
    7479    else
    7580    javapath=`which java 2> /dev/null`
     
    7782fi
    7883
     84# Check that a Java executable has been found
     85echo "Checking Java: $javapath"
    7986if [ ! -x "$javapath" ]; then
    80     echo "Failed to locate Java. You must install a Java Runtime Environment"
    81     echo "(version 1.4 or greater) before running the Greenstone Librarian Interface."
     87    echo
     88    echo "Failed to locate an appropriate version of Java. You must install a"
     89    echo "Java Runtime Environment (version 1.4 or greater) before running the"
     90    echo "Greenstone Librarian Interface."
    8291    exit 1
    8392fi
     
    97106fi
    98107if [ $jok -eq 0 ] ; then
     108    echo
    99109    echo "The version of the Java Runtime Environment you have installed is too"
    100     echo "old to run the Greenstone Librarian Interface. Please install a new version"
    101     echo "of the JRE (version 1.4 or newer) and rerun this script."
     110    echo "old to run the Greenstone Librarian Interface. Please install a new"
     111    echo "version of the JRE (version 1.4 or newer) and rerun this script."
    102112    exit 1
    103113fi
    104114
    105115
    106 ## -- Check that the GLI has been compiled --
     116## ---- Check that the GLI has been compiled ----
    107117if [ ! -f "classes/org/greenstone/gatherer/Gatherer.class" ]; then
    108     echo "You need to compile the Greenstone Librarian Interface using makegli.sh"
     118    echo
     119    echo "You need to compile the Greenstone Librarian Interface (using makegli.sh)"
    109120    echo "before running this script."
    110121    exit 1
     
    112123
    113124
    114 ## -- Finally, run the GLI --
    115 
     125## ---- Finally, run the GLI ----
     126echo
    116127echo "Running the Greenstone Librarian Interface..."
    117128
Note: See TracChangeset for help on using the changeset viewer.