Show
Ignore:
Timestamp:
08.05.2009 21:38:04 (10 years ago)
Author:
ak19
Message:

Moved finding java and finding perl logic into findjava.sh and findperl.sh. Findjava.sh is called from gli.sh and client-gli.sh. Still need to call findperl.sh from client-gli.sh, and need to split findgsdl into its own file. Tested.

Files:
1 modified

Legend:

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

    r19313 r19355  
    6868fi 
    6969 
    70  
    71 ## ---- Check Java exists ---- 
    72 javapath= 
    73  
    74 # Some users may set the above line manually 
    75 if [ "x$javapath" = "x" ]; then 
    76  
    77     # If it is set, use the JAVA_HOME environment variable 
    78     if [ "x$JAVA_HOME" != "x" ]; then 
    79     javapath="$JAVA_HOME/bin/java" 
    80  
    81     # Check if Java is on the search path 
    82     else 
    83     javapath=`which java 2> /dev/null` 
    84     fi 
    85 fi 
    86  
    87 # Check that a Java executable has been found 
    88 if [ "$glilang" = "es" ]; then 
    89     echo "Revisando Java: $javapath" 
    90 elif [ "$glilang" = "fr" ]; then 
    91     echo "Vérification de Java: $javapath" 
    92 elif [ "$glilang" = "ru" ]; then 
    93     echo "ðÒÏ×ÅÒËÁ Java: $javapath" 
    94 else 
    95     echo "Checking Java: $javapath" 
    96 fi 
    97 if [ ! -x "$javapath" ]; then 
    98     echo 
    99     if [ "$glilang" = "es" ]; then 
    100     echo "No se pudo localizar una versión apropiada de Java. Usted deberá " 
    101     echo "instalar un Ambiente de Ejecución Java (versión 1.4 o superior) " 
    102     echo "antes de correr la Interfaz de la $PROGFULLNAME                    ." 
    103     elif [ "$glilang" = "fr" ]; then 
    104     echo "Une version adéquate de Java n'a pas pu être localisée." 
    105     echo "Vous devez installer un Java Runtime Environment (version 1.4 ou" 
    106     echo "supérieur) avant de démarrer $PROGNAME Librarian Interface." 
    107     elif [ "$glilang" = "ru" ]; then 
    108     echo "îÅ ÕÄÁÌÏÓØ ÏÐÒÅÄÅÌÉÔØ ÍÅÓÔÏÎÁÈÏÖÄÅÎÉÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÊ ×ÅÒÓÉÉ Java." 
    109     echo "÷Ù ÄÏÌÖÎÙ ÕÓÔÁÎÏ×ÉÔØ Java Runtime Environment (×ÅÒÓÉÀ 1.4 ÉÌÉ ×ÙÛÅ)" 
    110     echo "ÐÅÒÅÄ ××ÏÄÏÍ ÂÉÂÌÉÏÔÅÞÎÏÇÏ ÉÎÔÅÒÆÅÊÓÁ $PROGNAME." 
    111     else 
    112     echo "Failed to locate an appropriate version of Java. You must install a" 
    113     echo "Java Runtime Environment (version 1.4 or greater) before running the" 
    114     echo "$PROGNAME Librarian Interface." 
    115     fi 
    116     exit 1 
    117 fi 
    118  
    119  
    120 ## -- Check the version of Java is new enough (1.4.0 or higher) to run the GLI -- 
    121 `$javapath -classpath . CheckJavaVersion > /dev/null` 
    122 if [ $? -ne 2 ] ; then 
    123     echo 
    124     if [ "$glilang" = "es" ]; then 
    125     echo "La versión del Ambiente de Ejecución Java (JRE por sus siglas en " 
    126     echo "inglés) que usted tiene instalada es demasiado vieja para ejecutar " 
    127     echo "la Interfaz de la Biblioteca Digital Greenstone. Por favor instale " 
    128     echo "una nueva versión del Ambiente de Ejecución Java (versión 1.4 o " 
    129     echo "posterior) y ejecute nuevamente este guión." 
    130     elif [ "$glilang" = "fr" ]; then 
    131     echo "La version de Java Runtime Environment que vous avez installée est" 
    132     echo "trop vielle pour faire fonctionner Greenstone Librarian Interface." 
    133     echo "Veuillez installer une nouvelle version du JRE (version 1.4 ou plus" 
    134     echo "récente) et redémarrez le script." 
    135     elif [ "$glilang" = "ru" ]; then 
    136     echo "÷ÅÒÓÉÑ Java Runtime Environment, ËÏÔÏÒÕÀ ÷Ù ÕÓÔÁÎÏ×ÉÌÉ, ÏÞÅÎØ ÓÔÁÒÁ," 
    137     echo "ÞÔÏÂÙ ÕÐÒÁ×ÌÑÔØ ÂÉÂÌÉÏÔÅÞÎÙÍ ÉÎÔÅÒÆÅÊÓÏÍ Greenstone. ðÏÖÁÌÕÊÓÔÁ, " 
    138     echo "ÕÓÔÁÎÏ×ÉÔÅ ÎÏ×ÕÀ ×ÅÒÓÉÀ JRE (×ÅÒÓÉÀ 1.4 ÉÌÉ ÂÏÌÅÅ ÎÏ×ÕÀ) É" 
    139     echo "ÐÅÒÅÕÓÔÁÎÏ×ÉÔÅ ÜÔÏÔ ÓËÒÉÐÔ" 
    140     else 
    141     echo "The version of the Java Runtime Environment you have installed is too" 
    142     echo "old to run the Greenstone Librarian Interface. Please install a new" 
    143     echo "version of the JRE (version 1.4 or newer) and rerun this script." 
    144     fi 
    145     exit 1 
     70## ---- findJava ---- 
     71# call the script with source, so that we have the variables it sets ($javapath) 
     72exit_status=0 
     73source ./findjava.sh 
     74exit_status=$? 
     75if [ "$exit_status" -eq 1 ]; then 
     76    exit 1; 
    14677fi 
    14778