Changeset 17819 for gli


Ignore:
Timestamp:
11/12/08 11:12:48 (12 years ago)
Author:
oranfry
Message:

making gems.sh consistent with gli.sh

Location:
gli/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gli/trunk/gems.sh

    r16546 r17819  
    229229
    230230
    231 ## ---- Check Java exists ----
    232 javapath=
    233 
    234 # Some users may set the above line manually
    235 if [ "x$javapath" = "x" ]; then
    236 
    237     # If it is set, use the JAVA_HOME environment variable
    238     if [ "x$JAVA_HOME" != "x" ]; then
    239     javapath="$JAVA_HOME/bin/java"
    240 
    241     # Check if Java is on the search path
    242     else
    243     javapath=`which java 2> /dev/null`
    244     fi
    245 fi
    246 
    247 # Check that a Java executable has been found
    248 if [ "$glilang" = "es" ]; then
    249     echo "Revisando Java: $javapath"
    250 elif [ "$glilang" = "fr" ]; then
    251     echo "Vérification de Java: $javapath"
    252 elif [ "$glilang" = "ru" ]; then
    253     echo "ðÒÏ×ÅÒËÁ Java: $javapath"
    254 else
    255     echo "Checking Java: $javapath"
    256 fi
    257 if [ ! -x "$javapath" ]; then
    258     echo
    259     if [ "$glilang" = "es" ]; then
    260     echo "No se pudo localizar una versión apropiada de Java. Usted deberá "
    261     echo "instalar un Ambiente de Ejecución Java (versión 1.4 o superior) "
    262     echo "antes de correr la $PROGNAME."
    263     elif [ "$glilang" = "fr" ]; then
    264     echo "Une version adéquate de Java n'a pas pu être localisée."
    265     echo "Vous devez installer un Java Runtime Environment (version 1.4 ou"
    266     echo "supérieur) avant de démarrer $PROGNAME."
    267     elif [ "$glilang" = "ru" ]; then
    268     echo "îÅ ÕÄÁÌÏÓØ ÏÐÒÅÄÅÌÉÔØ ÍÅÓÔÏÎÁÈÏÖÄÅÎÉÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÊ ×ÅÒÓÉÉ Java."
    269     echo "÷Ù ÄÏÌÖÎÙ ÕÓÔÁÎÏ×ÉÔØ Java Runtime Environment (×ÅÒÓÉÀ 1.4 ÉÌÉ ×ÙÛÅ)"
    270     echo "ÐÅÒÅÄ ××ÏÄÏÍ $PROGNAME."
    271     else
    272     echo "Failed to locate an appropriate version of Java. You must install a"
    273     echo "Java Runtime Environment (version 1.4 or greater) before running the"
    274     echo "$PROGNAME."
    275     fi
    276     exit 1
    277 fi
    278 
    279 
    280 ## -- Check the version of Java is new enough (1.4.0 or higher) to run the GLI --
    281 `$javapath -classpath . CheckJavaVersion > /dev/null`
    282 if [ $? -ne 2 ] ; then
    283     echo
    284     if [ "$glilang" = "es" ]; then
    285     echo "La versión del Ambiente de Ejecución Java (JRE por sus siglas en "
    286     echo "inglés) que usted tiene instalada es demasiado vieja para ejecutar "
    287     echo "la $PROGNAME. Por favor instale una "
    288     echo "nueva versión del Ambiente de Ejecución Java (versión 1.4 o "
    289     echo "posterior) y ejecute nuevamente este guión."
    290     elif [ "$glilang" = "fr" ]; then
    291     echo "La version de Java Runtime Environment que vous avez installée est"
    292     echo "trop vielle pour faire fonctionner $PROGNAME."
    293     echo "Veuillez installer une nouvelle version du JRE (version 1.4 ou plus"
    294     echo "récente) et redémarrez le script."
    295     elif [ "$glilang" = "ru" ]; then
    296     echo "÷ÅÒÓÉÑ Java Runtime Environment, ËÏÔÏÒÕÀ ÷Ù ÕÓÔÁÎÏ×ÉÌÉ, ÏÞÅÎØ ÓÔÁÒÁ,"
    297     echo "ÞÔÏÂÙ ÕÐÒÁ×ÌÑÔØ $PROGNAME. ðÏÖÁÌÕÊÓÔÁ, "
    298     echo "ÕÓÔÁÎÏ×ÉÔÅ ÎÏ×ÕÀ ×ÅÒÓÉÀ JRE (×ÅÒÓÉÀ 1.4 ÉÌÉ ÂÏÌÅÅ ÎÏ×ÕÀ) É"
    299     echo "ÐÅÒÅÕÓÔÁÎÏ×ÉÔÅ ÜÔÏÔ ÓËÒÉÐÔ"
    300     else
    301     echo "The version of the Java Runtime Environment you have installed is too"
    302     echo "old to run the $PROGNAME. Please install a new"
    303     echo "version of the JRE (version 1.4 or newer) and rerun this script."
    304     fi
    305     exit 1
    306 fi
     231## ---- Check Java ----
     232echo "Java:"
     233MINIMUM_JAVA_VERSION=1.4.0_00
     234
     235# Some users may set this line manually
     236#JAVA_HOME=
     237
     238if [ -z $javapath ]; then
     239
     240    # sus out search4j
     241    if [ "$_version" -eq 2 -a -e "$GSDLHOME/bin/$GSDLOS/search4j" ]; then
     242        SEARCH4J_EXECUTABLE=$GSDLHOME/bin/$GSDLOS/search4j
     243    elif [ "$_version" -eq 3 -a -e "$GSDL3SRCHOME/bin/$GSDLOS/search4j" ]; then
     244        SEARCH4J_EXECUTABLE=$GSDL3SRCHOME/bin/search4j
     245    elif [ -e "../bin/$GSDLOS/search4j" ]; then
     246        SEARCH4J_EXECUTABLE=../bin/$GSDLOS/search4j
     247    elif [ -e "../bin/search4j" ]; then
     248        SEARCH4J_EXECUTABLE=../bin/search4j
     249    else
     250        echo "Couldn't determine the location of the search4j executable"
     251        echo "If you are running Greenstone2"
     252        echo "   * check GSDLHOME is set"
     253        echo "   * check bin/$GSDLOS/search4j exists"
     254        echo "   * check bin/$GSDLOS/search4j is executable"
     255        echo "If you are running Greenstone3"
     256        echo "   * check GSDL3SRCHOME is set"
     257        echo "   * check bin/search4j exists"
     258        echo "   * check bin/search4j is executable"
     259        echo "   * try running 'ant compile-search4j'"
     260    fi
     261
     262    # Give search4j a hint to find Java depending on the platform
     263    if [ $GSDLOS = linux ]; then
     264        HINT=`cd ..;pwd`/packages/jre
     265    elif [ $GSDLOS = darwin ]; then
     266        HINT=/System/Library/Frameworks/JavaVM.framework/Home
     267    fi 
     268   
     269    javapath=`$SEARCH4J_EXECUTABLE -e -p $HINT -m $MINIMUM_JAVA_VERSION`
     270
     271    if [ "$?" != "0" ]; then
     272
     273        OLDVER=`"$SEARCH4J_EXECUTABLE" -v -p "$HINT"`
     274
     275        if [ "$?" = "0" ]; then
     276
     277            if [ "$glilang" = "es" ]; then
     278                echo "La versión del Ambiente de Ejecución Java (JRE por sus siglas en "
     279                echo "inglés) que usted tiene instalada es demasiado vieja para ejecutar "
     280                echo "la Interfaz de la $PROGNAME. Por favor instale "
     281                echo "una nueva versión del Ambiente de Ejecución Java (versión $MINIMUM_JAVA_VERSION o "
     282                echo "posterior) y ejecute nuevamente este guión."
     283            elif [ "$glilang" = "fr" ]; then
     284                echo "La version de Java Runtime Environment que vous avez installée est"
     285                echo "trop vielle pour faire fonctionner $PROGNAME."
     286                echo "Veuillez installer une nouvelle version du JRE (version $MINIMUM_JAVA_VERSION ou plus"
     287                echo "récente) et redémarrez le script."
     288            elif [ "$glilang" = "ru" ]; then
     289                echo "÷ÅÒÓÉÑ Java Runtime Environment, ËÏÔÏÒÕÀ ÷Ù ÕÓÔÁÎÏ×ÉÌÉ, ÏÞÅÎØ ÓÔÁÒÁ,"
     290                echo "ÞÔÏÂÙ ÕÐÒÁ×ÌÑÔØ ÂÉÂÌÉÏÔÅÞÎÙÍ $PROGNAME. ðÏÖÁÌÕÊÓÔÁ, "
     291                echo "ÕÓÔÁÎÏ×ÉÔÅ ÎÏ×ÕÀ ×ÅÒÓÉÀ JRE (×ÅÒÓÉÀ $MINIMUM_JAVA_VERSION ÉÌÉ ÂÏÌÅÅ ÎÏ×ÕÀ) É"
     292                echo "ÐÅÒÅÕÓÔÁÎÏ×ÉÔÅ ÜÔÏÔ ÓËÒÉÐÔ"
     293            else
     294                echo "The version of the Java Runtime Environment you have installed ($OLDVER)"
     295                echo "is too old to run the $PROGNAME. Please install a new"
     296                echo "version of the JRE (version $MINIMUM_JAVA_VERSION or newer) and rerun this script."
     297            fi
     298            exit 1
     299
     300        else
     301
     302            echo
     303            if [ "$glilang" = "es" ]; then
     304                echo "No se pudo localizar una versión apropiada de Java. Usted deberá "
     305                echo "instalar un Ambiente de Ejecución Java (versión $MINIMUM_JAVA_VERSION o superior) "
     306                echo "antes de correr la Interfaz de la $PROGNAME."
     307            elif [ "$glilang" = "fr" ]; then
     308                echo "Une version adéquate de Java n'a pas pu être localisée."
     309                echo "Vous devez installer un Java Runtime Environment (version $MINIMUM_JAVA_VERSION ou"
     310                echo "supérieur) avant de démarrer $PROGNAME."
     311                echo "Si vous avez Java installé sur votre ordinateur veuillez vérifier la variable"
     312                echo "d'environnement JAVA_HOME."
     313            elif [ "$glilang" = "ru" ]; then
     314                echo "îÅ ÕÄÁÌÏÓØ ÏÐÒÅÄÅÌÉÔØ ÍÅÓÔÏÎÁÈÏÖÄÅÎÉÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÊ ×ÅÒÓÉÉ Java."
     315                echo "÷Ù ÄÏÌÖÎÙ ÕÓÔÁÎÏ×ÉÔØ Java Runtime Environment (×ÅÒÓÉÀ $MINIMUM_JAVA_VERSION ÉÌÉ ×ÙÛÅ)"
     316                echo "ÐÅÒÅÄ ××ÏÄÏÍ ÂÉÂÌÉÏÔÅÞÎÏÇÏ $PROGNAME."
     317            else
     318                echo "Failed to locate an appropriate version of Java. You must install a"
     319                echo "Java Runtime Environment (version $MINIMUM_JAVA_VERSION or greater) before running the"
     320                echo "$PROGNAME."
     321                echo "If you have Java intalled on your machine please set the environment variable JAVA_HOME."
     322            fi
     323        fi
     324
     325    fi
     326
     327fi
     328echo $javapath
     329echo
     330
     331
    307332
    308333## ---- Check that the GEMS has been compiled ----
  • gli/trunk/gli.sh

    r17749 r17819  
    275275
    276276# Some users may set this line manually
    277 #JAVA_HOME=""
     277#JAVA_HOME=
    278278
    279279if [ -z $javapath ]; then
     
    299299        echo "   * check bin/search4j is executable"
    300300        echo "   * try running 'ant compile-search4j'"
    301 
    302         # last-resort tricks
    303 #        if [ -e "../packages/jre" ]; then
    304 #            function search4j_shell_function() {
    305 #              echo `cd ../packages/jre/bin; pwd`/java
    306 #            }
    307 #            SEARCH4J_EXECUTABLE=search4j_shell_function
    308 #        elif [ "$JAVA_HOME" != "" ]; then
    309 #            function search4j_shell_function() {
    310 #              echo $JAVA_HOME/bin/java
    311 #            }
    312 #            SEARCH4J_EXECUTABLE=search4j_shell_function
    313 #        else
    314 #            exit 1
    315 #        fi
    316 
    317301    fi
    318302
Note: See TracChangeset for help on using the changeset viewer.