source: gli/trunk/gli.sh@ 17749

Last change on this file since 17749 was 17749, checked in by max, 15 years ago

Fixing some bugs on finding java on the Darwin platform.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 18.0 KB
RevLine 
[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.
6get_version() {
7 # first parameter is value of gsdlpath
8 if [ -f "${1}/gs3-setup.sh" ]; then
[17493]9 return 3
[15610]10 elif [ -f "${1}/setup.bash" ]; then
[17493]11 return 2
[15610]12 else
[17493]13 echo "Error: can't determine which Greenstone version is being run."
14 exit 1
[15610]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.
24check_installation() {
25# Check that the Greenstone installation looks OK
26 if [ "$3" = "es" ]; then
[17493]27 echo "Revisando GSDL$2: $1"
[15610]28 elif [ "$3" = "fr" ]; then
[17493]29 echo "Vérification de GSDL$2: $1"
[15610]30 elif [ "$3" = "ru" ]; then
[17493]31 echo "ðÒÏ×ÅÒËÁ GSDL$2: $1"
[15610]32 else
[17493]33 echo "Checking GSDL$2: $1"
[15610]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
[17493]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."
[15610]52 fi
[17493]53 exit 1
54 fi
[15610]55}
56
[6752]57glilang=en
[13251]58
[14977]59if [ "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
69fi
70
71if [ "x$PROGABBR" = "x" ] ; then
72 PROGABBR="GLI"
73fi
74
75if [ "x$PROGNAME_EN" = "x" ] ; then
76 PROGNAME_EN="Greenstone Librarian Interface"
77fi
78
[6262]79echo
[12286]80if [ "$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]86elif [ "$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]91elif [ "$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]96else
[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]101fi
[6223]102echo
[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]107thisdir=`pwd`
108if [ ! -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
[17493]112 echo "Ce script doit être exécuté à partir du répertoire dans lequel il se trouve."
[12286]113 elif [ "$glilang" = "ru" ]; then
[17493]114 echo "üÔÏÔ ÓËÒÉÐÔ ÄÏÌÖÅÎ ÂÙÔØ ×ÚÑÔ ÉÚ ÄÉÒÅËÔÏÒÉÉ, × ËÏÔÏÒÏÊ ÏÎ ÒÁÓÐÏÌÏÖÅÎ"
[6702]115 else
[17493]116 echo "This script must be run from the directory in which it resides."
[6702]117 fi
[4952]118 exit 1
[4914]119fi
120
[4952]121
[5003]122## ---- Determine GSDLHOME ----
[15610]123## gsdlpath can be either Greenstone 3 or Greenstone 2
[6624]124gsdlpath=
[15610]125# Some users may set the above line manually
[4952]126
[15610]127
128# This variable is set automatically:
129_version=
130if [ "x$gsdlpath" != "x" ]; then
131 get_version $gsdlpath
132 _version=$?
133# otherwise $gsdlpath is not yet set
134else
[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
[17493]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 ""
[15610]147 elif [ "x$GSDL3SRCHOME" != "x" ]; then
[17493]148 echo "Only gsdl3srchome set"
149 gsdlpath=$GSDL3SRCHOME
150 _version=3
151 echo "$gsdlpath"
[15610]152 elif [ "x$GSDLHOME" != "x" ]; then
[17493]153 gsdlpath=$GSDLHOME
154 _version=2
[4952]155 # If it is not set, assume that the GLI is installed as a subdirectory of Greenstone
156 else
[17493]157 gsdlpath=`(cd .. && pwd)`
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
163fi
164
[15626]165echo "Greenstone version found: $_version"
[15610]166
167# Check that the main Greenstone installation for the version we're running looks OK
168check_installation $gsdlpath $_version $glilang
169
170
171# Need to source the correct setup file depending on whether we are running
172# gs3 or gs2
173# If we're running version GS2
174if [ "$_version" -eq 2 ]; then
175 # Setup Greenstone 2, unless it has already been done
176 if [ "x$GSDLHOME" = "x" ]; then
[17493]177 cd "$gsdlpath"
[17670]178 . ./setup.bash
[17493]179 cd "$thisdir"
[6702]180 fi
[15610]181# else, if we're running GS3
182elif [ "$_version" -eq 3 ]; then
183 # Setup Greenstone 3, unless it has already been done
184 if [ "x$GSDL3HOME" = "x" -o "x$GSDL3SRCHOME" = "x" ]; then
[17493]185 cd "$gsdlpath"
[17670]186 . ./gs3-setup.sh
[17493]187 cd "$thisdir"
[15610]188 fi
189
190 ## if Greenstone version 3 is running, we want to set gsdl2path
191 ## ---- Determine GSDLHOME ----
192 ## may be already set, or manually entered here.
193 gsdl2path=
194
195 # Some users may set the above line manually
196 if [ "x$gsdl2path" = "x" ]; then
197 # Check the environment variable first
[17493]198 if [ "x$GSDLHOME" != "x" ]; then
199 echo "GSDLHOME environment variable is set to $GSDLHOME."
200 echo "Will use this to find build scripts."
201 gsdl2path=$GSDLHOME
[15610]202 # If it is not set, assume that the gs2build subdirectory of Greenstone 3 exists
[17493]203 else
204 gsdl2path=$GSDL3SRCHOME/gs2build
[15610]205 fi
[17493]206 fi
[15610]207 # Check that Greenstone 3's Greenstone 2 stuff looks OK (in gs2build)
208 check_installation $gsdl2path "" $glilang
209
210 # Setup Greenstone 3's gs2build, unless it has already been done
211 if [ "x$GSDLHOME" = "x" ]; then
[17493]212 cd "$gsdl2path"
[17670]213 . ./setup.bash
[17493]214 cd "$thisdir"
[15610]215 fi
216
217else
218 echo "Greenstone version unknown."
[4952]219 exit 1
220fi
221
[15610]222echo
[15626]223if [ "x$GSDL3SRCHOME" != "x" ]; then
224 echo "GSDL3SRCHOME is: $GSDL3SRCHOME"
225fi
226if [ "x$GSDL3HOME" != "x" ]; then
227 echo "GSDL3HOME is: $GSDL3HOME"
228fi
229if [ "x$GSDLHOME" != "x" ]; then
230 echo "GSDLHOME is: $GSDLHOME"
231fi
[15610]232echo
[4952]233
[5003]234## ---- Check Perl exists ----
[4952]235perlpath=
236
237# Some users may set the above line manually
[12286]238if [ "x$perlpath" = "x" ]; then
[5003]239 # Check if Perl is on the search path
[4952]240 perlpath=`which perl 2> /dev/null`
241fi
242
[5003]243# Check that a Perl executable has been found
[17493]244echo "Perl:"
[4952]245if [ ! -x "$perlpath" ] ; then
[5003]246 echo
[12286]247 if [ "$glilang" = "es" ]; then
[17493]248 echo "La Interfaz de la $PROGNAME requiere Perl para "
249 echo "poder operar, pero éste no aparece en su sistema. Por favor asegúrese "
250 echo "de que Perl está instalado y se encuentra en su ruta de búsqueda. A "
251 echo "continuación ejecute nuevamente este guión."
[12286]252 elif [ "$glilang" = "fr" ]; then
[17493]253 echo "$PROGNAME nécessite Perl pour son fonctionnement,"
254 echo "mais perl n'a pas pu être détecté dans votre système. Veuillez vous "
255 echo "assurer que perl est installé et est spécifié dans votre chemin de "
256 echo "recherche, puis redémarrez ce script."
[12286]257 elif [ "$glilang" = "ru" ]; then
[17493]258 echo "âÉÂÌÉÏÔÅÞÎÙÊ $PROGNAME ÔÒÅÂÕÅÔ Perl, ÞÔÏÂÙ ÉÍÅÔØ ×ÏÚÍÏÖÎÏÓÔØ"
259 echo "ÒÁÂÏÔÁÔØ, ÎÏ Perl ÎÅ ÂÙÌ × ×ÁÛÅÊ ÓÉÓÔÅÍÅ. ðÏÖÁÌÕÊÓÔÁ, ÐÏÄÔ×ÅÒÄÉÔÅ, ÞÔÏ "
260 echo "Perl ÕÓÔÁÎÏ×ÌÅÎ É ÎÁÈÏÄÉÔÓÑ ÎÁ ×ÁÛÅÍ ÐÕÔÉ ÐÏÉÓËÁ, ÚÁÔÅÍ ÐÏ×ÔÏÒÎÏ××ÅÄÉÔÅ"
261 echo "ÜÔÏÔ ÓËÒÉÐÔ."
[6702]262 else
[17493]263 echo "The $PROGNAME requires Perl in order to operate,"
264 echo "but perl could not be detected on your system. Please ensure that perl"
265 echo "is installed and is on your search path, then rerun this script."
[6702]266 fi
[4952]267 exit 1
268fi
[17493]269echo $perlpath
270echo
[4952]271
[17493]272## ---- Check Java ----
273echo "Java:"
274MINIMUM_JAVA_VERSION=1.4.0_00
[4952]275
[17493]276# Some users may set this line manually
[17718]277#JAVA_HOME=""
[17493]278
[17670]279if [ -z $javapath ]; then
[4952]280
[17493]281 # sus out search4j
[17670]282 if [ "$_version" -eq 2 -a -e "$GSDLHOME/bin/$GSDLOS/search4j" ]; then
[17552]283 SEARCH4J_EXECUTABLE=$GSDLHOME/bin/$GSDLOS/search4j
[17670]284 elif [ "$_version" -eq 3 -a -e "$GSDL3SRCHOME/bin/$GSDLOS/search4j" ]; then
[17602]285 SEARCH4J_EXECUTABLE=$GSDL3SRCHOME/bin/search4j
[17670]286 elif [ -e "../bin/$GSDLOS/search4j" ]; then
[17552]287 SEARCH4J_EXECUTABLE=../bin/$GSDLOS/search4j
[17670]288 elif [ -e "../bin/search4j" ]; then
[17602]289 SEARCH4J_EXECUTABLE=../bin/search4j
[17493]290 else
291 echo "Couldn't determine the location of the search4j executable"
292 echo "If you are running Greenstone2"
293 echo " * check GSDLHOME is set"
[17552]294 echo " * check bin/$GSDLOS/search4j exists"
295 echo " * check bin/$GSDLOS/search4j is executable"
[17493]296 echo "If you are running Greenstone3"
297 echo " * check GSDL3SRCHOME is set"
298 echo " * check bin/search4j exists"
299 echo " * check bin/search4j is executable"
300 echo " * try running 'ant compile-search4j'"
[5003]301
[17493]302 # last-resort tricks
[17670]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
[17733]316
[17493]317 fi
318
[17733]319 # Give search4j a hint to find Java depending on the platform
[17749]320 if [ $GSDLOS = linux ]; then
321 HINT=`cd ..;pwd`/packages/jre
322 elif [ $GSDLOS = darwin ]; then
323 HINT=/System/Library/Frameworks/JavaVM.framework/Home
[17733]324 fi
325
[17749]326 javapath=`$SEARCH4J_EXECUTABLE -e -p $HINT -m $MINIMUM_JAVA_VERSION`
[17493]327
[17484]328 if [ "$?" != "0" ]; then
[4952]329
[17733]330 OLDVER=`"$SEARCH4J_EXECUTABLE" -v -p "$HINT"`
[4952]331
[17669]332 if [ "$?" = "0" ]; then
[17484]333
[17493]334 if [ "$glilang" = "es" ]; then
335 echo "La versión del Ambiente de Ejecución Java (JRE por sus siglas en "
336 echo "inglés) que usted tiene instalada es demasiado vieja para ejecutar "
337 echo "la Interfaz de la $PROGNAME. Por favor instale "
338 echo "una nueva versión del Ambiente de Ejecución Java (versión $MINIMUM_JAVA_VERSION o "
339 echo "posterior) y ejecute nuevamente este guión."
340 elif [ "$glilang" = "fr" ]; then
341 echo "La version de Java Runtime Environment que vous avez installée est"
342 echo "trop vielle pour faire fonctionner $PROGNAME."
343 echo "Veuillez installer une nouvelle version du JRE (version $MINIMUM_JAVA_VERSION ou plus"
344 echo "récente) et redémarrez le script."
345 elif [ "$glilang" = "ru" ]; then
346 echo "÷ÅÒÓÉÑ Java Runtime Environment, ËÏÔÏÒÕÀ ÷Ù ÕÓÔÁÎÏ×ÉÌÉ, ÏÞÅÎØ ÓÔÁÒÁ,"
347 echo "ÞÔÏÂÙ ÕÐÒÁ×ÌÑÔØ ÂÉÂÌÉÏÔÅÞÎÙÍ $PROGNAME. ðÏÖÁÌÕÊÓÔÁ, "
348 echo "ÕÓÔÁÎÏ×ÉÔÅ ÎÏ×ÕÀ ×ÅÒÓÉÀ JRE (×ÅÒÓÉÀ $MINIMUM_JAVA_VERSION ÉÌÉ ÂÏÌÅÅ ÎÏ×ÕÀ) É"
349 echo "ÐÅÒÅÕÓÔÁÎÏ×ÉÔÅ ÜÔÏÔ ÓËÒÉÐÔ"
350 else
351 echo "The version of the Java Runtime Environment you have installed ($OLDVER)"
352 echo "is too old to run the $PROGNAME. Please install a new"
353 echo "version of the JRE (version $MINIMUM_JAVA_VERSION or newer) and rerun this script."
354 fi
355 exit 1
[17484]356
[17493]357 else
[17484]358
[17493]359 echo
360 if [ "$glilang" = "es" ]; then
361 echo "No se pudo localizar una versión apropiada de Java. Usted deberá "
362 echo "instalar un Ambiente de Ejecución Java (versión $MINIMUM_JAVA_VERSION o superior) "
363 echo "antes de correr la Interfaz de la $PROGNAME."
364 elif [ "$glilang" = "fr" ]; then
365 echo "Une version adéquate de Java n'a pas pu être localisée."
366 echo "Vous devez installer un Java Runtime Environment (version $MINIMUM_JAVA_VERSION ou"
367 echo "supérieur) avant de démarrer $PROGNAME."
[17718]368 echo "Si vous avez Java installé sur votre ordinateur veuillez vérifier la variable"
369 echo "d'environnement JAVA_HOME."
[17493]370 elif [ "$glilang" = "ru" ]; then
371 echo "îÅ ÕÄÁÌÏÓØ ÏÐÒÅÄÅÌÉÔØ ÍÅÓÔÏÎÁÈÏÖÄÅÎÉÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÊ ×ÅÒÓÉÉ Java."
372 echo "÷Ù ÄÏÌÖÎÙ ÕÓÔÁÎÏ×ÉÔØ Java Runtime Environment (×ÅÒÓÉÀ $MINIMUM_JAVA_VERSION ÉÌÉ ×ÙÛÅ)"
373 echo "ÐÅÒÅÄ ××ÏÄÏÍ ÂÉÂÌÉÏÔÅÞÎÏÇÏ $PROGNAME."
374 else
375 echo "Failed to locate an appropriate version of Java. You must install a"
376 echo "Java Runtime Environment (version $MINIMUM_JAVA_VERSION or greater) before running the"
377 echo "$PROGNAME."
[17718]378 echo "If you have Java intalled on your machine please set the environment variable JAVA_HOME."
[17493]379 fi
380 fi
[17484]381
[17493]382 fi
[17484]383
[6702]384fi
[17493]385echo $javapath
386echo
[4952]387
388
389## -- Check the version of Java is new enough (1.4.0 or higher) to run the GLI --
[9347]390`$javapath -classpath . CheckJavaVersion > /dev/null`
[8901]391if [ $? -ne 2 ] ; then
[5003]392 echo
[4952]393fi
394
[5003]395## ---- Check that the GLI has been compiled ----
[7748]396if [ ! -f "classes/org/greenstone/gatherer/GathererProg.class" ] && [ ! -f "GLI.jar" ]; then
[8901]397 echo
[12286]398 if [ "$glilang" = "es" ]; then
[17493]399 echo "Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone"
400 echo "(por medio de makegli.sh) antes de ejecutar este guión."
[12286]401 elif [ "$glilang" = "fr" ]; then
[17493]402 echo "Vous devez compiler le Greenstone Interface (en utilisant makegli.sh)"
403 echo "avant d'exécuter ce script."
[12286]404 elif [ "$glilang" = "ru" ]; then
[17493]405 echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone"
406 echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
[6702]407 else
[17493]408 echo "You need to compile the Greenstone Librarian Interface (using makegli.sh)"
409 echo "before running this script."
[6702]410 fi
[4952]411 exit 1
412fi
413
[17672]414## ---- Explain how to bypass Imagemagick and Ghostscript bundled with Greenstone if needed ----
415if [ -e "$GSDLHOME/bin/$GSDLOS/ghostscript" ] ; then
416echo "GhostScript bundled with Greenstone will be used, if you wish to use the version installed on your system (if any) please go to $GSDLHOME/bin/$GSDLOS and rename the folder called ghostscript to something else."
417fi
418echo
419echo
420if [ -e "$GSDLHOME/bin/$GSDLOS/imagemagick" ] ; then
421echo "ImageMagick bundled with Greenstone will be used, if you wish to use the version installed on your system (if any) please go to $GSDLHOME/bin/$GSDLOS and rename the folder called imagemagick to something else."
422echo
423echo
424fi
425
426
[5003]427## ---- Finally, run the GLI ----
[12286]428if [ "$glilang" = "es" ]; then
[14977]429 echo "Ejecutando la Interfaz de la $PROGNAME..."
[12286]430elif [ "$glilang" = "fr" ]; then
[14977]431 echo "Exécution de $PROGNAME..."
[12286]432elif [ "$glilang" = "ru" ]; then
[14977]433 echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ $PROGNAME..."
[6702]434else
[14977]435 echo "Running the $PROGNAME..."
[6702]436fi
[4952]437
[15610]438# basic_command is the cmd string common to both Greenstone 3 and Greenstone 2 execution
439basic_command="$javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar org.greenstone.gatherer.GathererProg"
[12225]440stop_gli=0
441while [ "$stop_gli" = "0" ] ; do
[15610]442
[17534]443 # Other arguments you can provide to GLI to work around memory limitations, or debug
444 # -Xms<number>M To set minimum memory (by default 32MB)
445 # -Xmx<number>M To set maximum memory (by default the nearest 2^n to the total remaining physical memory)
446 # -verbose:gc To set garbage collection messages
447 # -Xincgc For incremental garbage collection (significantly slows performance)
448 # -Xprof Function call profiling
449 # -Xloggc:<file> Write garbage collection log
[15610]450
451 exit_status=0
452 if [ "$_version" -eq 2 ]; then
[17534]453 $basic_command -gsdl $GSDLHOME -gsdlos $GSDLOS $*
454 exit_status=$?
[15610]455 elif [ "$_version" -eq 3 ]; then
[17534]456 $basic_command -gsdl $GSDLHOME -gsdlos $GSDLOS -gsdl3 $GSDL3HOME -gsdl3src $GSDL3SRCHOME $*
457 exit_status=$?
[15610]458 fi
459
460 if [ "$exit_status" != "2" ] ; then
[17534]461 stop_gli=1
[12225]462 else
[17534]463 echo
464 if [ "$glilang" = "es" ]; then
465 echo "Restarting/Ejecutando la Interfaz de la $PROGNAME..."
466 elif [ "$glilang" = "fr" ]; then
467 echo "Restarting/Exécution de $PROGNAME..."
468 elif [ "$glilang" = "ru" ]; then
469 echo "Restarting/ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ $PROGNAME..."
470 else
471 echo "Restarting the $PROGNAME..."
472 fi
[12225]473 fi
474done
475
[12286]476if [ "$glilang" = "es" ]; then
[6745]477 echo "¡Hecho!"
[12286]478elif [ "$glilang" = "fr" ]; then
[6712]479 echo "Terminé!"
[12286]480elif [ "$glilang" = "ru" ]; then
[6702]481 echo "÷ÙÐÏÌÎÅÎÏ!"
482else
483 echo "Done!"
[17672]484fi
Note: See TracBrowser for help on using the repository browser.