Changeset 12287 for trunk/gli/gli4gs3.sh


Ignore:
Timestamp:
2006-07-24T15:06:16+12:00 (18 years ago)
Author:
kjdon
Message:

Made these POSIX compliant (I think) based on patch and comments sent in by James Strother.
changed [ a == b] to [a = b], = "" to = "x", removed popd and pushd. changed source to .

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/gli4gs3.sh

    r11801 r12287  
    33
    44echo
    5 if [ "$glilang" == "es" ]; then
     5if [ "$glilang" = "es" ]; then
    66    echo "Interfaz de la Biblioteca Digital Greenstone (Greenstone Librarian Interface - GLI)"
    77    echo "Copyright (C) 2005, New Zealand Digital Library Project, University Of Waikato"
     
    99    echo "Para mayor información vea los términos de la licencia en LICENSE.txt"
    1010    echo "Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita"
    11 elif [ "$glilang" == "fr" ]; then
     11elif [ "$glilang" = "fr" ]; then
    1212    echo "Interface du Bibliothécaire Greenstone (Greenstone Librarian Interface - GLI)"
    1313    echo "Copyright (C) 2005, New Zealand Digital Library Project, University Of Waikato"
    1414    echo "GLI est fourni sans AUCUNE GARANTIE; pour des détails, voir LICENSE.txt"
    1515    echo "Ceci est un logiciel libre, et vous êtes invité à le redistribuer"
    16 elif [ "$glilang" == "ru" ]; then
     16elif [ "$glilang" = "ru" ]; then
    1717    echo "âÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone (Greenstone Librarian Interface - GLI)"
    1818    echo "Copyright (C) 2005, New Zealand Digital Library Project, University Of Waikato"
     
    3232thisdir=`pwd`
    3333if [ ! -f "${thisdir}/gli4gs3.sh" ]; then
    34     if [ "$glilang" == "es" ]; then
     34    if [ "$glilang" = "es" ]; then
    3535        echo "Este guión deberá ejecutarse desde el directorio en el que reside."
    36     elif [ "$glilang" == "fr" ]; then
     36    elif [ "$glilang" = "fr" ]; then
    3737    echo "Ce script doit être exécuté à partir du répertoire dans lequel il se trouve."
    38     elif [ "$glilang" == "ru" ]; then
     38    elif [ "$glilang" = "ru" ]; then
    3939    echo "üÔÏÔ ÓËÒÉÐÔ ÄÏÌÖÅÎ ÂÙÔØ ×ÚÑÔ ÉÚ ÄÉÒÅËÔÏÒÉÉ, × ËÏÔÏÒÏÊ ÏÎ ÒÁÓÐÏÌÏÖÅÎ"
    4040    else
     
    5050
    5151# Some users may set the above line manually
    52 if [ "$gsdl3path" == "" ]; then
     52if [ "x$gsdl3path" = "x" ]; then
    5353    # Check the environment variable first
    54     if [ "$GSDL3SRCHOME" != "" ]; then
     54    if [ "x$GSDL3SRCHOME" != "x" ]; then
    5555    gsdl3path=$GSDL3SRCHOME
    5656
    5757    # If it is not set, assume that the GLI is installed as a subdirectory of Greenstone 3
    5858    else
    59     pushd .. > /dev/null
    60     gsdl3path=`pwd`
    61     popd > /dev/null
     59    gsdl3path=`(cd .. && pwd)`
    6260    fi
    6361fi
    6462
    6563# Check that the Greenstone 3 installation looks OK
    66 if [ "$glilang" == "es" ]; then
     64if [ "$glilang" = "es" ]; then
    6765    echo "Revisando GSDL3: $gsdl3path"
    68 elif [ "$glilang" == "fr" ]; then
     66elif [ "$glilang" = "fr" ]; then
    6967    echo "Vérification de GSDL3: $gsdl3path"
    70 elif [ "$glilang" == "ru" ]; then
     68elif [ "$glilang" = "ru" ]; then
    7169    echo "ðÒÏ×ÅÒËÁ GSDL3: $gsdl3path"
    7270else
     
    7573if [ ! -f "${gsdl3path}/gs3-setup.sh" ] ; then
    7674    echo
    77     if [ "$glilang" == "es" ]; then
     75    if [ "$glilang" = "es" ]; then
    7876    echo "No se pudo encontrar la instalación de Greenstone 3 o está incompleta."
    7977        echo "Trate de reinstalar Greenstone 3 y a continuación ejecute nuevamente"
    8078    echo "este guión."
    81     elif [ "$glilang" == "fr" ]; then
     79    elif [ "$glilang" = "fr" ]; then
    8280    echo "L'installation de Greenstone 3 est introuvable ou incomplète."
    8381    echo "Essayez de réinstaller Greenstone 3 et exécutez ce script à nouveau."
    84     elif [ "$glilang" == "ru" ]; then
     82    elif [ "$glilang" = "ru" ]; then
    8583    echo "éÎÓÔÁÌÌÑÃÉÑ Greenstone 3 ÎÅ ÂÙÌÁ ÎÁÊÄÅÎÁ ÉÌÉ ÏÎÁ ÎÅÐÏÌÎÁ."
    8684    echo "ðÏÐÒÏÂÕÊÔÅ ÐÏ×ÔÏÒÎÏ ÕÓÔÁÎÏ×ÉÔØ Greenstone 3, Á ÚÁÔÅÍ ××ÅÓÔÉ ÜÔÏÔ ÓËÒÉÐÔ ÓÎÏ×Á."
     
    9391
    9492# Setup Greenstone 3, unless it has already been done
    95 if [ "$GSDL3HOME" == "" ] || [ "$GSDL3SRCHOME" == "" ]; then
    96     pushd $gsdl3path > /dev/null
    97     source gs3-setup.sh
    98     popd > /dev/null
     93if [ "x$GSDL3HOME" = "x" -o "x$GSDL3SRCHOME" = "x" ]; then
     94    cd "$gsdl3path"
     95    . gs3-setup.sh
     96    cd "$thisdir"
    9997fi
    10098
     
    105103
    106104# Some users may set the above line manually
    107 if [ "$gsdlpath" == "" ]; then
     105if [ "x$gsdlpath" = "x" ]; then
    108106    # Check the environment variable first
    109     if [ "$GSDLHOME" != "" ]; then
     107    if [ "x$GSDLHOME" != "x" ]; then
    110108    gsdlpath=$GSDLHOME
    111109
     
    117115
    118116# Check that the Greenstone installation looks OK
    119 if [ "$glilang" == "es" ]; then
     117if [ "$glilang" = "es" ]; then
    120118    echo "Revisando GSDL: $gsdlpath"
    121 elif [ "$glilang" == "fr" ]; then
     119elif [ "$glilang" = "fr" ]; then
    122120    echo "Vérification de GSDL: $gsdlpath"
    123 elif [ "$glilang" == "ru" ]; then
     121elif [ "$glilang" = "ru" ]; then
    124122    echo "ðÒÏ×ÅÒËÁ GSDL: $gsdlpath"
    125123else
     
    128126if [ ! -f "${gsdlpath}/setup.bash" ] ; then
    129127    echo
    130     if [ "$glilang" == "es" ]; then
     128    if [ "$glilang" = "es" ]; then
    131129    echo "No se pudo encontrar la instalación de Greenstone o está incompleta."
    132130        echo "Trate de reinstalar Greenstone y a continuación ejecute nuevamente"
    133131    echo "este guión."
    134     elif [ "$glilang" == "fr" ]; then
     132    elif [ "$glilang" = "fr" ]; then
    135133    echo "L'installation de Greenstone est introuvable ou incomplète."
    136134    echo "Essayez de réinstaller Greenstone et exécutez ce script à nouveau."
    137     elif [ "$glilang" == "ru" ]; then
     135    elif [ "$glilang" = "ru" ]; then
    138136    echo "éÎÓÔÁÌÌÑÃÉÑ Greenstone ÎÅ ÂÙÌÁ ÎÁÊÄÅÎÁ ÉÌÉ ÏÎÁ ÎÅÐÏÌÎÁ."
    139137    echo "ðÏÐÒÏÂÕÊÔÅ ÐÏ×ÔÏÒÎÏ ÕÓÔÁÎÏ×ÉÔØ Greenstone, Á ÚÁÔÅÍ ××ÅÓÔÉ ÜÔÏÔ ÓËÒÉÐÔ ÓÎÏ×Á."
     
    146144
    147145# Setup Greenstone, unless it has already been done
    148 if [ "$GSDLHOME" == "" ]; then
    149     pushd $gsdlpath > /dev/null
    150     source setup.bash
    151     popd > /dev/null
     146if [ "x$GSDLHOME" = "x" ]; then
     147    cd "$gsdlpath"
     148    . setup.bash
     149    cd "$thisdir"
    152150fi
    153151
     
    157155
    158156# Some users may set the above line manually
    159 if [ "$perlpath" == "" ]; then
     157if [ "x$perlpath" = "x" ]; then
    160158    # Check if Perl is on the search path
    161159    perlpath=`which perl 2> /dev/null`
     
    163161
    164162# Check that a Perl executable has been found
    165 if [ "$glilang" == "es" ]; then
     163if [ "$glilang" = "es" ]; then
    166164    echo "Revisando Perl: $perlpath"
    167 elif [ "$glilang" == "fr" ]; then
     165elif [ "$glilang" = "fr" ]; then
    168166    echo "Vérification de Perl: $perlpath"
    169 elif [ "$glilang" == "ru" ]; then
     167elif [ "$glilang" = "ru" ]; then
    170168    echo "ðÒÏ×ÅÒËÁ Perl: $perlpath"
    171169else
     
    174172if [ ! -x "$perlpath" ] ; then
    175173    echo
    176     if [ "$glilang" == "es" ]; then
     174    if [ "$glilang" = "es" ]; then
    177175    echo "La Interfaz de la Biblioteca Digital Greenstone requiere Perl para "
    178176    echo "poder operar, pero éste no aparece en su sistema. Por favor asegúrese "
    179177    echo "de que Perl está instalado y se encuentra en su ruta de búsqueda. A "
    180178    echo "continuación ejecute nuevamente este guión."
    181     elif [ "$glilang" == "fr" ]; then
     179    elif [ "$glilang" = "fr" ]; then
    182180    echo "Greenstone Librarian Interface nécessite perl pour son fonctionnement,"
    183181    echo "mais perl n'a pas pu être détecté dans votre système. Veuillez vous "
    184182    echo "assurer que perl est installé et est spécifié dans votre chemin de "
    185183    echo "recherche, puis redémarrez ce script."
    186     elif [ "$glilang" == "ru" ]; then
     184    elif [ "$glilang" = "ru" ]; then
    187185    echo "âÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone ÔÒÅÂÕÅÔ Perl, ÞÔÏÂÙ ÉÍÅÔØ ×ÏÚÍÏÖÎÏÓÔØ"
    188186    echo "ÒÁÂÏÔÁÔØ, ÎÏ Perl ÎÅ ÂÙÌ × ×ÁÛÅÊ ÓÉÓÔÅÍÅ. ðÏÖÁÌÕÊÓÔÁ, ÐÏÄÔ×ÅÒÄÉÔÅ, ÞÔÏ "
     
    202200
    203201# Some users may set the above line manually
    204 if [ "$javapath" == "" ]; then
     202if [ "x$javapath" = "x" ]; then
    205203
    206204    # If it is set, use the JAVA_HOME environment variable
    207     if [ "$JAVA_HOME" != "" ]; then
     205    if [ "x$JAVA_HOME" != "x" ]; then
    208206    javapath="$JAVA_HOME/bin/java"
    209207
     
    215213
    216214# Check that a Java executable has been found
    217 if [ "$glilang" == "es" ]; then
     215if [ "$glilang" = "es" ]; then
    218216    echo "Revisando Java: $javapath"
    219 elif [ "$glilang" == "fr" ]; then
     217elif [ "$glilang" = "fr" ]; then
    220218    echo "Vérification de Java: $javapath"
    221 elif [ "$glilang" == "ru" ]; then
     219elif [ "$glilang" = "ru" ]; then
    222220    echo "ðÒÏ×ÅÒËÁ Java: $javapath"
    223221else
     
    226224if [ ! -x "$javapath" ]; then
    227225    echo
    228     if [ "$glilang" == "es" ]; then
     226    if [ "$glilang" = "es" ]; then
    229227    echo "No se pudo localizar una versión apropiada de Java. Usted deberá "
    230228    echo "instalar un Ambiente de Ejecución Java (versión 1.4 o superior) "
    231229    echo "antes de correr la Interfaz de la Biblioteca Digital Greenstone."
    232     elif [ "$glilang" == "fr" ]; then
     230    elif [ "$glilang" = "fr" ]; then
    233231    echo "Une version adéquate de Java n'a pas pu être localisée."
    234232    echo "Vous devez installer un Java Runtime Environment (version 1.4 ou"
    235233    echo "supérieur) avant de démarrer Greenstone Librarian Interface."
    236     elif [ "$glilang" == "ru" ]; then
     234    elif [ "$glilang" = "ru" ]; then
    237235    echo "îÅ ÕÄÁÌÏÓØ ÏÐÒÅÄÅÌÉÔØ ÍÅÓÔÏÎÁÈÏÖÄÅÎÉÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÊ ×ÅÒÓÉÉ Java."
    238236    echo "÷Ù ÄÏÌÖÎÙ ÕÓÔÁÎÏ×ÉÔØ Java Runtime Environment (×ÅÒÓÉÀ 1.4 ÉÌÉ ×ÙÛÅ)"
     
    251249if [ $? -ne 2 ] ; then
    252250    echo
    253     if [ "$glilang" == "es" ]; then
     251    if [ "$glilang" = "es" ]; then
    254252    echo "La versión del Ambiente de Ejecución Java (JRE por sus siglas en "
    255253    echo "inglés) que usted tiene instalada es demasiado vieja para ejecutar "
     
    257255    echo "una nueva versión del Ambiente de Ejecución Java (versión 1.4 o "
    258256    echo "posterior) y ejecute nuevamente este guión."
    259     elif [ "$glilang" == "fr" ]; then
     257    elif [ "$glilang" = "fr" ]; then
    260258    echo "La version de Java Runtime Environment que vous avez installée est"
    261259    echo "trop vielle pour faire fonctionner Greenstone Librarian Interface."
    262260    echo "Veuillez installer une nouvelle version du JRE (version 1.4 ou plus"
    263261    echo "récente) et redémarrez le script."
    264     elif [ "$glilang" == "ru" ]; then
     262    elif [ "$glilang" = "ru" ]; then
    265263    echo "÷ÅÒÓÉÑ Java Runtime Environment, ËÏÔÏÒÕÀ ÷Ù ÕÓÔÁÎÏ×ÉÌÉ, ÏÞÅÎØ ÓÔÁÒÁ,"
    266264    echo "ÞÔÏÂÙ ÕÐÒÁ×ÌÑÔØ ÂÉÂÌÉÏÔÅÞÎÙÍ ÉÎÔÅÒÆÅÊÓÏÍ Greenstone. ðÏÖÁÌÕÊÓÔÁ, "
     
    281279if [ ! -f "classes/org/greenstone/gatherer/GathererProg.class" ] && [ ! -f "GLI.jar" ]; then
    282280    echo
    283     if [ "$glilang" == "es" ]; then
     281    if [ "$glilang" = "es" ]; then
    284282    echo "Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone"
    285283    echo "(por medio de makegli.sh) antes de ejecutar este guión."
    286     elif [ "$glilang" == "fr" ]; then
     284    elif [ "$glilang" = "fr" ]; then
    287285    echo "Vous devez compiler le Greenstone Interface (en utilisant makegli.sh)"
    288286    echo "avant d'exécuter ce script."
    289     elif [ "$glilang" == "ru" ]; then
     287    elif [ "$glilang" = "ru" ]; then
    290288    echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone"
    291289    echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
     
    297295fi
    298296
    299 if [ "$1" == "-test" ]; then
    300     if [ "$glilang" == "es" ]; then
    301     echo "Clase de prueba: $2"
    302     echo "Argumentos $*"
    303     elif [ "$glilang" == "fr" ]; then
    304     echo "Classe de test: $2"
    305     echo "Arguments $*"
    306     elif [ "$glilang" == "ru" ]; then
    307     echo "éÓÐÙÔÁÔÅÌØÎÙÊ ËÌÁÓÓ: $2"
    308     echo "ðÁÒÁÍÅÔÒÙ $*"
    309     else
    310     echo "Testing class: $2"
    311     echo "Arguments $*"
    312     fi
    313     $javapath -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar $2 $3
    314     exit 0
    315 fi
    316 
    317297## ---- Finally, run the GLI ----
    318298echo
    319 if [ "$glilang" == "es" ]; then
     299if [ "$glilang" = "es" ]; then
    320300    echo "Ejecutando la Interfaz de la Biblioteca Digital Greenstone..."
    321 elif [ "$glilang" == "fr" ]; then
     301elif [ "$glilang" = "fr" ]; then
    322302    echo "Exécution de Greenstone Librarian Interface"
    323 elif [ "$glilang" == "ru" ]; then
     303elif [ "$glilang" = "ru" ]; then
    324304    echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone..."
    325305else
    326306    echo "Running the Greenstone Librarian Interface..."
    327307fi
     308
     309stop_gli=0
     310while [ "$stop_gli" = "0" ] ; do
    328311
    329312# Other arguments you can provide to GLI to work around memory limitations, or debug
     
    335318# -Xloggc:<file>   Write garbage collection log
    336319
    337 $javapath -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar org.greenstone.gatherer.GathererProg -gsdl $GSDLHOME -gsdl3 $GSDL3HOME -gsdl3src $GSDL3SRCHOME -wget $wgetpath $*
    338 
    339 if [ "$glilang" == "es" ]; then
     320    $javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar org.greenstone.gatherer.GathererProg -gsdl $GSDLHOME -gsdl3 $GSDL3HOME -gsdl3src $GSDL3SRCHOME -wget $wgetpath $*
     321    exit_status=$?
     322
     323  if [ "$exit_status" != "2" ] ; then
     324    stop_gli=1
     325  else
     326    echo
     327    if [ "$glilang" = "es" ]; then
     328        echo "Restarting/Ejecutando la Interfaz de la Biblioteca Digital Greenstone..."
     329    elif [ "$glilang" = "fr" ]; then
     330        echo "Restarting/Exécution de Greenstone Librarian Interface"
     331    elif [ "$glilang" = "ru" ]; then
     332        echo "Restarting/ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone..."
     333    else
     334        echo "Restarting the Greenstone Librarian Interface..."
     335    fi
     336
     337  fi
     338done
     339
     340if [ "$glilang" = "es" ]; then
    340341    echo "¡Hecho!"
    341 elif [ "$glilang" == "fr" ]; then
     342elif [ "$glilang" = "fr" ]; then
    342343    echo "Terminé!"
    343 elif [ "$glilang" == "ru" ]; then
     344elif [ "$glilang" = "ru" ]; then
    344345    echo "÷ÙÐÏÌÎÅÎÏ!"
    345346else
Note: See TracChangeset for help on using the changeset viewer.