[4914] | 1 | #!/bin/sh
|
---|
[15610] | 2 |
|
---|
| 3 | # Function that, when given gsdlpath as parameter, will return the
|
---|
| 4 | # version of greenstone that is to run (2 or 3). If things are not,
|
---|
| 5 | # this program will exit here.
|
---|
| 6 | get_version() {
|
---|
| 7 | # first parameter is value of gsdlpath
|
---|
| 8 | if [ -f "${1}/gs3-setup.sh" ]; then
|
---|
| 9 | return 3
|
---|
| 10 | elif [ -f "${1}/setup.bash" ]; then
|
---|
| 11 | return 2
|
---|
| 12 | else
|
---|
| 13 | echo "Error: can't determine which Greenstone version is being run."
|
---|
| 14 | exit 1
|
---|
| 15 | fi
|
---|
| 16 | }
|
---|
| 17 |
|
---|
| 18 | # Function that is passed the following paramters (in order):
|
---|
| 19 | # - the gsdlpath (GS3 home, GS2 home or gs2build for GS3),
|
---|
| 20 | # - the version of greenstone that's running, and
|
---|
| 21 | # - the language GLI is set to
|
---|
| 22 | # and checks the installation.
|
---|
| 23 | # If things are not right, this program will exit here.
|
---|
| 24 | check_installation() {
|
---|
| 25 | # Check that the Greenstone installation looks OK
|
---|
| 26 | if [ "$3" = "es" ]; then
|
---|
| 27 | echo "Revisando GSDL: $1"
|
---|
| 28 | elif [ "$3" = "fr" ]; then
|
---|
| 29 | echo "Vérification de GSDL: $1"
|
---|
| 30 | elif [ "$3" = "ru" ]; then
|
---|
| 31 | echo "ðÒÏ×ÅÒËÁ GSDL: $1"
|
---|
| 32 | else
|
---|
| 33 | echo "Checking GSDL: $1"
|
---|
| 34 | fi
|
---|
| 35 | # even if we are only checking for gs2build (gsdl2path), we still
|
---|
| 36 | # need the file setup.bash to exist in the following condition:
|
---|
| 37 | if [ ! -f "${1}/gs3-setup.sh" -a ! -f "${1}/setup.bash" ] ; then
|
---|
| 38 | echo
|
---|
| 39 | if [ "$3" = "es" ]; then
|
---|
| 40 | echo "No se pudo encontrar la instalación de Greenstone $2 o está incompleta."
|
---|
| 41 | echo "Trate de reinstalar Greenstone $2 y a continuación ejecute nuevamente"
|
---|
| 42 | echo "este guión."
|
---|
| 43 | elif [ "$3" = "fr" ]; then
|
---|
| 44 | echo "L'installation de Greenstone $2 est introuvable ou incomplète."
|
---|
| 45 | echo "Essayez de réinstaller Greenstone $2 et exécutez ce script à nouveau."
|
---|
| 46 | elif [ "$3" = "ru" ]; then
|
---|
| 47 | echo "éÎÓÔÁÌÌÑÃÉÑ Greenstone $_version ÎÅ ÂÙÌÁ ÎÁÊÄÅÎÁ ÉÌÉ ÏÎÁ ÎÅÐÏÌÎÁ."
|
---|
| 48 | echo "ðÏÐÒÏÂÕÊÔÅ ÐÏ×ÔÏÒÎÏ ÕÓÔÁÎÏ×ÉÔØ Greenstone $2, Á ÚÁÔÅÍ ××ÅÓÔÉ ÜÔÏÔ ÓËÒÉÐÔ ÓÎÏ×Á."
|
---|
| 49 | else
|
---|
| 50 | echo "The Greenstone $2 installation could not be found, or is incomplete."
|
---|
| 51 | echo "Try reinstalling Greenstone $2 then running this script again."
|
---|
| 52 | fi
|
---|
| 53 | exit 1
|
---|
| 54 | fi
|
---|
| 55 | }
|
---|
| 56 |
|
---|
[6752] | 57 | glilang=en
|
---|
[13251] | 58 |
|
---|
[14977] | 59 | if [ "x$PROGNAME" = "x" ] ; then
|
---|
| 60 | if [ "$glilang" = "es" ]; then
|
---|
| 61 | PROGNAME="Biblioteca Digital Greenstone"
|
---|
| 62 | elif [ "$glilang" = "fr" ]; then
|
---|
| 63 | PROGNAME="Bibliothécaire Greenstone"
|
---|
| 64 | elif [ "$glilang" = "ru" ]; then
|
---|
| 65 | PROGNAME="ÉÎÔÅÒÆÅÊÓ Greenstone"
|
---|
| 66 | else
|
---|
| 67 | PROGNAME="Greenstone Librarian Interface"
|
---|
| 68 | fi
|
---|
| 69 | fi
|
---|
| 70 |
|
---|
| 71 | if [ "x$PROGABBR" = "x" ] ; then
|
---|
| 72 | PROGABBR="GLI"
|
---|
| 73 | fi
|
---|
| 74 |
|
---|
| 75 | if [ "x$PROGNAME_EN" = "x" ] ; then
|
---|
| 76 | PROGNAME_EN="Greenstone Librarian Interface"
|
---|
| 77 | fi
|
---|
| 78 |
|
---|
[6262] | 79 | echo
|
---|
[12286] | 80 | if [ "$glilang" = "es" ]; then
|
---|
[14977] | 81 | echo "Interfaz de la $PROGNAME ($PROGNAME_EN - $PROGABBR)"
|
---|
[12453] | 82 | echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
|
---|
[14977] | 83 | echo "La Interfaz de la $PROGNAME NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÍA."
|
---|
[6959] | 84 | echo "Para mayor información vea los términos de la licencia en LICENSE.txt"
|
---|
| 85 | echo "Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita"
|
---|
[12286] | 86 | elif [ "$glilang" = "fr" ]; then
|
---|
[14977] | 87 | echo "Interface du $PROGNAME ($PROGNAME_EN - $PROGABBR)"
|
---|
[12453] | 88 | echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
|
---|
[14977] | 89 | echo "$PROGABBR est fourni sans AUCUNE GARANTIE; pour des détails, voir LICENSE.txt"
|
---|
[6955] | 90 | echo "Ceci est un logiciel libre, et vous êtes invité à le redistribuer"
|
---|
[12286] | 91 | elif [ "$glilang" = "ru" ]; then
|
---|
[14977] | 92 | echo "âÉÂÌÉÏÔÅÞÎÙÊ $PROGNAME ($PROGNAME_EN - $PROGABBR)"
|
---|
[12453] | 93 | echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
|
---|
[7041] | 94 | echo "âéç ÎÅ ÄÁÅÔ áâóïìàôîï îéëáëéè çáòáîôéê; ÄÅÔÁÌÉ ÓÍ. × ÔÅËÓÔÅ LICENSE.TXT"
|
---|
| 95 | echo "üÔÏ - Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ É ÷Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÇÏ"
|
---|
[6702] | 96 | else
|
---|
[14977] | 97 | echo "$PROGNAME ($PROGABBR)"
|
---|
[12453] | 98 | echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
|
---|
[14977] | 99 | echo "$PROGABBR comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt"
|
---|
[6955] | 100 | echo "This is free software, and you are welcome to redistribute it"
|
---|
[6702] | 101 | fi
|
---|
[6223] | 102 | echo
|
---|
[4952] | 103 |
|
---|
[5003] | 104 | ## -------- Run the Greenstone Librarian Interface --------
|
---|
[4952] | 105 |
|
---|
[5003] | 106 | # This script must be run from within the directory in which it lives
|
---|
[4952] | 107 | thisdir=`pwd`
|
---|
| 108 | if [ ! -f "${thisdir}/gli.sh" ]; then
|
---|
[12286] | 109 | if [ "$glilang" = "es" ]; then
|
---|
[6745] | 110 | echo "Este guión deberá ejecutarse desde el directorio en el que reside."
|
---|
[12286] | 111 | elif [ "$glilang" = "fr" ]; then
|
---|
[6712] | 112 | echo "Ce script doit être exécuté à partir du répertoire dans lequel il se trouve."
|
---|
[12286] | 113 | elif [ "$glilang" = "ru" ]; then
|
---|
[6702] | 114 | echo "üÔÏÔ ÓËÒÉÐÔ ÄÏÌÖÅÎ ÂÙÔØ ×ÚÑÔ ÉÚ ÄÉÒÅËÔÏÒÉÉ, × ËÏÔÏÒÏÊ ÏÎ ÒÁÓÐÏÌÏÖÅÎ"
|
---|
| 115 | else
|
---|
| 116 | echo "This script must be run from the directory in which it resides."
|
---|
| 117 | fi
|
---|
[4952] | 118 | exit 1
|
---|
[4914] | 119 | fi
|
---|
| 120 |
|
---|
[4952] | 121 |
|
---|
[5003] | 122 | ## ---- Determine GSDLHOME ----
|
---|
[15610] | 123 | ## gsdlpath can be either Greenstone 3 or Greenstone 2
|
---|
[6624] | 124 | gsdlpath=
|
---|
[15610] | 125 | # Some users may set the above line manually
|
---|
[4952] | 126 |
|
---|
[15610] | 127 |
|
---|
| 128 | # This variable is set automatically:
|
---|
| 129 | _version=
|
---|
| 130 | if [ "x$gsdlpath" != "x" ]; then
|
---|
| 131 | get_version $gsdlpath
|
---|
| 132 | _version=$?
|
---|
| 133 | # otherwise $gsdlpath is not yet set
|
---|
| 134 | else
|
---|
[4952] | 135 | # Check the environment variable first
|
---|
[15610] | 136 | # Check whether environment variables for both GS2 and GS3 are set
|
---|
| 137 | # and if so, warn the user that we have defaulted to GS3
|
---|
| 138 | if [ "x$GSDLHOME" != "x" -a "x$GSDL3SRCHOME" != "x" ]; then
|
---|
| 139 | # _version not set, but both env vars set, so default to 3
|
---|
| 140 | _version=3
|
---|
| 141 | gsdlpath=$GSDL3SRCHOME
|
---|
| 142 | echo "Both Greenstone 2 and Greenstone 3 environments are set."
|
---|
| 143 | echo "It is assumed you want to run Greenstone 3."
|
---|
| 144 | echo "If you want to run Greenstone 2, please unset the"
|
---|
| 145 | echo "environment variable GSDL3SRCHOME before running GLI."
|
---|
| 146 | echo ""
|
---|
| 147 | elif [ "x$GSDL3SRCHOME" != "x" ]; then
|
---|
| 148 | echo "Only gsdl3srchome set"
|
---|
| 149 | gsdlpath=$GSDL3SRCHOME
|
---|
| 150 | _version=3
|
---|
| 151 | echo "$gsdlpath"
|
---|
| 152 | elif [ "x$GSDLHOME" != "x" ]; then
|
---|
[5003] | 153 | gsdlpath=$GSDLHOME
|
---|
[15610] | 154 | _version=2
|
---|
[4952] | 155 | # If it is not set, assume that the GLI is installed as a subdirectory of Greenstone
|
---|
| 156 | else
|
---|
[12286] | 157 | gsdlpath=`(cd .. && pwd)`
|
---|
[15610] | 158 | # Still need to find what version we are running:
|
---|
| 159 | # GS3 main directory contains file gs3-setup.sh, GS2 only setup.bash
|
---|
| 160 | get_version $gsdlpath
|
---|
| 161 | _version=$?
|
---|
[4952] | 162 | fi
|
---|
| 163 | fi
|
---|
| 164 |
|
---|
[15610] | 165 | echo "***Greenstone version found: $_version"
|
---|
| 166 | echo
|
---|
| 167 |
|
---|
| 168 | # Check that the main Greenstone installation for the version we're running looks OK
|
---|
| 169 | check_installation $gsdlpath $_version $glilang
|
---|
| 170 |
|
---|
| 171 |
|
---|
| 172 | # Need to source the correct setup file depending on whether we are running
|
---|
| 173 | # gs3 or gs2
|
---|
| 174 | # If we're running version GS2
|
---|
| 175 | if [ "$_version" -eq 2 ]; then
|
---|
| 176 | echo "Version is 2"
|
---|
| 177 | # Setup Greenstone 2, unless it has already been done
|
---|
| 178 | if [ "x$GSDLHOME" = "x" ]; then
|
---|
| 179 | cd "$gsdlpath"
|
---|
| 180 | . setup.bash
|
---|
| 181 | cd "$thisdir"
|
---|
[6702] | 182 | fi
|
---|
[15610] | 183 | # else, if we're running GS3
|
---|
| 184 | elif [ "$_version" -eq 3 ]; then
|
---|
| 185 | # Setup Greenstone 3, unless it has already been done
|
---|
| 186 | if [ "x$GSDL3HOME" = "x" -o "x$GSDL3SRCHOME" = "x" ]; then
|
---|
| 187 | cd "$gsdlpath"
|
---|
| 188 | . gs3-setup.sh
|
---|
| 189 | cd "$thisdir"
|
---|
| 190 | fi
|
---|
| 191 |
|
---|
| 192 | ## if Greenstone version 3 is running, we want to set gsdl2path
|
---|
| 193 | ## ---- Determine GSDLHOME ----
|
---|
| 194 | ## may be already set, or manually entered here.
|
---|
| 195 | gsdl2path=
|
---|
| 196 |
|
---|
| 197 | # Some users may set the above line manually
|
---|
| 198 | if [ "x$gsdl2path" = "x" ]; then
|
---|
| 199 | # Check the environment variable first
|
---|
| 200 | if [ "x$GSDLHOME" != "x" ]; then
|
---|
| 201 | echo "GSDLHOME environment variable is set to $GSDLHOME."
|
---|
| 202 | echo "Will use this to find build scripts."
|
---|
| 203 | gsdl2path=$GSDLHOME
|
---|
| 204 | # If it is not set, assume that the gs2build subdirectory of Greenstone 3 exists
|
---|
| 205 | else
|
---|
| 206 | gsdl2path=$GSDL3SRCHOME/gs2build
|
---|
| 207 | fi
|
---|
| 208 | fi
|
---|
| 209 | # Check that Greenstone 3's Greenstone 2 stuff looks OK (in gs2build)
|
---|
| 210 | check_installation $gsdl2path "" $glilang
|
---|
| 211 |
|
---|
| 212 | # Setup Greenstone 3's gs2build, unless it has already been done
|
---|
| 213 | if [ "x$GSDLHOME" = "x" ]; then
|
---|
| 214 | cd "$gsdl2path"
|
---|
| 215 | . setup.bash
|
---|
| 216 | cd "$thisdir"
|
---|
| 217 | fi
|
---|
| 218 |
|
---|
| 219 | else
|
---|
| 220 | echo "Greenstone version unknown."
|
---|
[4952] | 221 | exit 1
|
---|
| 222 | fi
|
---|
| 223 |
|
---|
[15610] | 224 | echo
|
---|
| 225 | echo "***GSDLHOME is: $GSDLHOME"
|
---|
| 226 | echo "***GSDL3SRCHOME is: $GSDL3SRCHOME"
|
---|
| 227 | echo "***GSDL3HOME is: $GSDL3HOME"
|
---|
| 228 | echo
|
---|
[4952] | 229 |
|
---|
[5003] | 230 | ## ---- Check Perl exists ----
|
---|
[4952] | 231 | perlpath=
|
---|
| 232 |
|
---|
| 233 | # Some users may set the above line manually
|
---|
[12286] | 234 | if [ "x$perlpath" = "x" ]; then
|
---|
[5003] | 235 | # Check if Perl is on the search path
|
---|
[4952] | 236 | perlpath=`which perl 2> /dev/null`
|
---|
| 237 | fi
|
---|
| 238 |
|
---|
[5003] | 239 | # Check that a Perl executable has been found
|
---|
[12286] | 240 | if [ "$glilang" = "es" ]; then
|
---|
[6745] | 241 | echo "Revisando Perl: $perlpath"
|
---|
[12286] | 242 | elif [ "$glilang" = "fr" ]; then
|
---|
[6712] | 243 | echo "Vérification de Perl: $perlpath"
|
---|
[12286] | 244 | elif [ "$glilang" = "ru" ]; then
|
---|
[6702] | 245 | echo "ðÒÏ×ÅÒËÁ Perl: $perlpath"
|
---|
| 246 | else
|
---|
| 247 | echo "Checking Perl: $perlpath"
|
---|
| 248 | fi
|
---|
[4952] | 249 | if [ ! -x "$perlpath" ] ; then
|
---|
[5003] | 250 | echo
|
---|
[12286] | 251 | if [ "$glilang" = "es" ]; then
|
---|
[14977] | 252 | echo "La Interfaz de la $PROGNAME requiere Perl para "
|
---|
[6745] | 253 | echo "poder operar, pero éste no aparece en su sistema. Por favor asegúrese "
|
---|
| 254 | echo "de que Perl está instalado y se encuentra en su ruta de búsqueda. A "
|
---|
| 255 | echo "continuación ejecute nuevamente este guión."
|
---|
[12286] | 256 | elif [ "$glilang" = "fr" ]; then
|
---|
[14977] | 257 | echo "$PROGNAME nécessite Perl pour son fonctionnement,"
|
---|
[6712] | 258 | echo "mais perl n'a pas pu être détecté dans votre système. Veuillez vous "
|
---|
| 259 | echo "assurer que perl est installé et est spécifié dans votre chemin de "
|
---|
| 260 | echo "recherche, puis redémarrez ce script."
|
---|
[12286] | 261 | elif [ "$glilang" = "ru" ]; then
|
---|
[14977] | 262 | echo "âÉÂÌÉÏÔÅÞÎÙÊ $PROGNAME ÔÒÅÂÕÅÔ Perl, ÞÔÏÂÙ ÉÍÅÔØ ×ÏÚÍÏÖÎÏÓÔØ"
|
---|
[6702] | 263 | echo "ÒÁÂÏÔÁÔØ, ÎÏ Perl ÎÅ ÂÙÌ × ×ÁÛÅÊ ÓÉÓÔÅÍÅ. ðÏÖÁÌÕÊÓÔÁ, ÐÏÄÔ×ÅÒÄÉÔÅ, ÞÔÏ "
|
---|
| 264 | echo "Perl ÕÓÔÁÎÏ×ÌÅÎ É ÎÁÈÏÄÉÔÓÑ ÎÁ ×ÁÛÅÍ ÐÕÔÉ ÐÏÉÓËÁ, ÚÁÔÅÍ ÐÏ×ÔÏÒÎÏ××ÅÄÉÔÅ"
|
---|
| 265 | echo "ÜÔÏÔ ÓËÒÉÐÔ."
|
---|
| 266 | else
|
---|
[14977] | 267 | echo "The $PROGNAME requires Perl in order to operate,"
|
---|
[6702] | 268 | echo "but perl could not be detected on your system. Please ensure that perl"
|
---|
| 269 | echo "is installed and is on your search path, then rerun this script."
|
---|
| 270 | fi
|
---|
[4952] | 271 | exit 1
|
---|
| 272 | fi
|
---|
| 273 |
|
---|
| 274 |
|
---|
[5003] | 275 | ## ---- Check Java exists ----
|
---|
[4952] | 276 | javapath=
|
---|
| 277 |
|
---|
| 278 | # Some users may set the above line manually
|
---|
[12286] | 279 | if [ "x$javapath" = "x" ]; then
|
---|
[5003] | 280 |
|
---|
[6467] | 281 | # If it is set, use the JAVA_HOME environment variable
|
---|
[12286] | 282 | if [ "x$JAVA_HOME" != "x" ]; then
|
---|
[6467] | 283 | javapath="$JAVA_HOME/bin/java"
|
---|
[4952] | 284 |
|
---|
[5003] | 285 | # Check if Java is on the search path
|
---|
[4952] | 286 | else
|
---|
| 287 | javapath=`which java 2> /dev/null`
|
---|
| 288 | fi
|
---|
| 289 | fi
|
---|
| 290 |
|
---|
[5003] | 291 | # Check that a Java executable has been found
|
---|
[12286] | 292 | if [ "$glilang" = "es" ]; then
|
---|
[6745] | 293 | echo "Revisando Java: $javapath"
|
---|
[12286] | 294 | elif [ "$glilang" = "fr" ]; then
|
---|
[6712] | 295 | echo "Vérification de Java: $javapath"
|
---|
[12286] | 296 | elif [ "$glilang" = "ru" ]; then
|
---|
[6702] | 297 | echo "ðÒÏ×ÅÒËÁ Java: $javapath"
|
---|
| 298 | else
|
---|
| 299 | echo "Checking Java: $javapath"
|
---|
| 300 | fi
|
---|
[4952] | 301 | if [ ! -x "$javapath" ]; then
|
---|
[5003] | 302 | echo
|
---|
[12286] | 303 | if [ "$glilang" = "es" ]; then
|
---|
[6745] | 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 1.4 o superior) "
|
---|
[14977] | 306 | echo "antes de correr la Interfaz de la $PROGNAME."
|
---|
[12286] | 307 | elif [ "$glilang" = "fr" ]; then
|
---|
[6712] | 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 1.4 ou"
|
---|
[14977] | 310 | echo "supérieur) avant de démarrer $PROGNAME."
|
---|
[12286] | 311 | elif [ "$glilang" = "ru" ]; then
|
---|
[6702] | 312 | echo "îÅ ÕÄÁÌÏÓØ ÏÐÒÅÄÅÌÉÔØ ÍÅÓÔÏÎÁÈÏÖÄÅÎÉÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÊ ×ÅÒÓÉÉ Java."
|
---|
| 313 | echo "÷Ù ÄÏÌÖÎÙ ÕÓÔÁÎÏ×ÉÔØ Java Runtime Environment (×ÅÒÓÉÀ 1.4 ÉÌÉ ×ÙÛÅ)"
|
---|
[14977] | 314 | echo "ÐÅÒÅÄ ××ÏÄÏÍ ÂÉÂÌÉÏÔÅÞÎÏÇÏ $PROGNAME."
|
---|
[6702] | 315 | else
|
---|
| 316 | echo "Failed to locate an appropriate version of Java. You must install a"
|
---|
| 317 | echo "Java Runtime Environment (version 1.4 or greater) before running the"
|
---|
[14977] | 318 | echo "$PROGNAME."
|
---|
[6702] | 319 | fi
|
---|
[4952] | 320 | exit 1
|
---|
| 321 | fi
|
---|
| 322 |
|
---|
| 323 |
|
---|
| 324 | ## -- Check the version of Java is new enough (1.4.0 or higher) to run the GLI --
|
---|
[9347] | 325 | `$javapath -classpath . CheckJavaVersion > /dev/null`
|
---|
[8901] | 326 | if [ $? -ne 2 ] ; then
|
---|
[5003] | 327 | echo
|
---|
[12286] | 328 | if [ "$glilang" = "es" ]; then
|
---|
[6745] | 329 | echo "La versión del Ambiente de Ejecución Java (JRE por sus siglas en "
|
---|
| 330 | echo "inglés) que usted tiene instalada es demasiado vieja para ejecutar "
|
---|
[14977] | 331 | echo "la Interfaz de la $PROGNAME. Por favor instale "
|
---|
[6745] | 332 | echo "una nueva versión del Ambiente de Ejecución Java (versión 1.4 o "
|
---|
| 333 | echo "posterior) y ejecute nuevamente este guión."
|
---|
[12286] | 334 | elif [ "$glilang" = "fr" ]; then
|
---|
[6712] | 335 | echo "La version de Java Runtime Environment que vous avez installée est"
|
---|
[14977] | 336 | echo "trop vielle pour faire fonctionner $PROGNAME."
|
---|
[6712] | 337 | echo "Veuillez installer une nouvelle version du JRE (version 1.4 ou plus"
|
---|
| 338 | echo "récente) et redémarrez le script."
|
---|
[12286] | 339 | elif [ "$glilang" = "ru" ]; then
|
---|
[6702] | 340 | echo "÷ÅÒÓÉÑ Java Runtime Environment, ËÏÔÏÒÕÀ ÷Ù ÕÓÔÁÎÏ×ÉÌÉ, ÏÞÅÎØ ÓÔÁÒÁ,"
|
---|
[14977] | 341 | echo "ÞÔÏÂÙ ÕÐÒÁ×ÌÑÔØ ÂÉÂÌÉÏÔÅÞÎÙÍ $PROGNAME. ðÏÖÁÌÕÊÓÔÁ, "
|
---|
[6702] | 342 | echo "ÕÓÔÁÎÏ×ÉÔÅ ÎÏ×ÕÀ ×ÅÒÓÉÀ JRE (×ÅÒÓÉÀ 1.4 ÉÌÉ ÂÏÌÅÅ ÎÏ×ÕÀ) É"
|
---|
| 343 | echo "ÐÅÒÅÕÓÔÁÎÏ×ÉÔÅ ÜÔÏÔ ÓËÒÉÐÔ"
|
---|
| 344 | else
|
---|
| 345 | echo "The version of the Java Runtime Environment you have installed is too"
|
---|
[14977] | 346 | echo "old to run the $PROGNAME. Please install a new"
|
---|
[6702] | 347 | echo "version of the JRE (version 1.4 or newer) and rerun this script."
|
---|
| 348 | fi
|
---|
[4952] | 349 | exit 1
|
---|
| 350 | fi
|
---|
| 351 |
|
---|
[5003] | 352 | ## ---- Check that the GLI has been compiled ----
|
---|
[7748] | 353 | if [ ! -f "classes/org/greenstone/gatherer/GathererProg.class" ] && [ ! -f "GLI.jar" ]; then
|
---|
[8901] | 354 | echo
|
---|
[12286] | 355 | if [ "$glilang" = "es" ]; then
|
---|
[6745] | 356 | echo "Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone"
|
---|
| 357 | echo "(por medio de makegli.sh) antes de ejecutar este guión."
|
---|
[12286] | 358 | elif [ "$glilang" = "fr" ]; then
|
---|
[6712] | 359 | echo "Vous devez compiler le Greenstone Interface (en utilisant makegli.sh)"
|
---|
| 360 | echo "avant d'exécuter ce script."
|
---|
[12286] | 361 | elif [ "$glilang" = "ru" ]; then
|
---|
[6702] | 362 | echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone"
|
---|
| 363 | echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
|
---|
| 364 | else
|
---|
| 365 | echo "You need to compile the Greenstone Librarian Interface (using makegli.sh)"
|
---|
| 366 | echo "before running this script."
|
---|
| 367 | fi
|
---|
[4952] | 368 | exit 1
|
---|
| 369 | fi
|
---|
| 370 |
|
---|
[5003] | 371 | ## ---- Finally, run the GLI ----
|
---|
| 372 | echo
|
---|
[12286] | 373 | if [ "$glilang" = "es" ]; then
|
---|
[14977] | 374 | echo "Ejecutando la Interfaz de la $PROGNAME..."
|
---|
[12286] | 375 | elif [ "$glilang" = "fr" ]; then
|
---|
[14977] | 376 | echo "Exécution de $PROGNAME..."
|
---|
[12286] | 377 | elif [ "$glilang" = "ru" ]; then
|
---|
[14977] | 378 | echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ $PROGNAME..."
|
---|
[6702] | 379 | else
|
---|
[14977] | 380 | echo "Running the $PROGNAME..."
|
---|
[6702] | 381 | fi
|
---|
[4952] | 382 |
|
---|
[15610] | 383 | # basic_command is the cmd string common to both Greenstone 3 and Greenstone 2 execution
|
---|
| 384 | basic_command="$javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar org.greenstone.gatherer.GathererProg"
|
---|
[12225] | 385 | stop_gli=0
|
---|
| 386 | while [ "$stop_gli" = "0" ] ; do
|
---|
[15610] | 387 |
|
---|
[6211] | 388 | # Other arguments you can provide to GLI to work around memory limitations, or debug
|
---|
| 389 | # -Xms<number>M To set minimum memory (by default 32MB)
|
---|
| 390 | # -Xmx<number>M To set maximum memory (by default the nearest 2^n to the total remaining physical memory)
|
---|
[4914] | 391 | # -verbose:gc To set garbage collection messages
|
---|
[6211] | 392 | # -Xincgc For incremental garbage collection (significantly slows performance)
|
---|
[4914] | 393 | # -Xprof Function call profiling
|
---|
| 394 | # -Xloggc:<file> Write garbage collection log
|
---|
[15610] | 395 |
|
---|
| 396 | exit_status=0
|
---|
| 397 | if [ "$_version" -eq 2 ]; then
|
---|
| 398 | `$basic_command -gsdl $GSDLHOME -gsdlos $GSDLOS $*`
|
---|
| 399 | exit_status=$?
|
---|
| 400 | elif [ "$_version" -eq 3 ]; then
|
---|
| 401 | `$basic_command -gsdl $GSDLHOME -gsdlos $GSDLOS -gsdl3 $GSDL3HOME -gsdl3src $GSDL3SRCHOME $*`
|
---|
| 402 | exit_status=$?
|
---|
| 403 | fi
|
---|
| 404 |
|
---|
| 405 | if [ "$exit_status" != "2" ] ; then
|
---|
| 406 | stop_gli=1
|
---|
[12225] | 407 | else
|
---|
[15610] | 408 | echo
|
---|
| 409 | if [ "$glilang" = "es" ]; then
|
---|
| 410 | echo "Restarting/Ejecutando la Interfaz de la $PROGNAME..."
|
---|
| 411 | elif [ "$glilang" = "fr" ]; then
|
---|
| 412 | echo "Restarting/Exécution de $PROGNAME..."
|
---|
| 413 | elif [ "$glilang" = "ru" ]; then
|
---|
| 414 | echo "Restarting/ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ $PROGNAME..."
|
---|
| 415 | else
|
---|
| 416 | echo "Restarting the $PROGNAME..."
|
---|
| 417 | fi
|
---|
| 418 |
|
---|
[12225] | 419 | fi
|
---|
| 420 | done
|
---|
| 421 |
|
---|
[12286] | 422 | if [ "$glilang" = "es" ]; then
|
---|
[6745] | 423 | echo "¡Hecho!"
|
---|
[12286] | 424 | elif [ "$glilang" = "fr" ]; then
|
---|
[6712] | 425 | echo "Terminé!"
|
---|
[12286] | 426 | elif [ "$glilang" = "ru" ]; then
|
---|
[6702] | 427 | echo "÷ÙÐÏÌÎÅÎÏ!"
|
---|
| 428 | else
|
---|
| 429 | echo "Done!"
|
---|
[15610] | 430 | fi |
---|