- Timestamp:
- 2008-10-08T12:44:18+13:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gli/trunk/gli.sh
r17484 r17493 7 7 # first parameter is value of gsdlpath 8 8 if [ -f "${1}/gs3-setup.sh" ]; then 9 9 return 3 10 10 elif [ -f "${1}/setup.bash" ]; then 11 12 else 13 14 11 return 2 12 else 13 echo "Error: can't determine which Greenstone version is being run." 14 exit 1 15 15 fi 16 16 } … … 25 25 # Check that the Greenstone installation looks OK 26 26 if [ "$3" = "es" ]; then 27 27 echo "Revisando GSDL$2: $1" 28 28 elif [ "$3" = "fr" ]; then 29 29 echo "Vérification de GSDL$2: $1" 30 30 elif [ "$3" = "ru" ]; then 31 32 else 33 31 echo "ðÒÏ×ÅÒËÁ GSDL$2: $1" 32 else 33 echo "Checking GSDL$2: $1" 34 34 fi 35 35 # even if we are only checking for gs2build (gsdl2path), we still 36 36 # need the file setup.bash to exist in the following condition: 37 37 if [ ! -f "${1}/gs3-setup.sh" -a ! -f "${1}/setup.bash" ] ; then 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 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 54 fi 55 55 } … … 110 110 echo "Este guión deberá ejecutarse desde el directorio en el que reside." 111 111 elif [ "$glilang" = "fr" ]; then 112 112 echo "Ce script doit être exécuté à partir du répertoire dans lequel il se trouve." 113 113 elif [ "$glilang" = "ru" ]; then 114 115 else 116 114 echo "üÔÏÔ ÓËÒÉÐÔ ÄÏÌÖÅÎ ÂÙÔØ ×ÚÑÔ ÉÚ ÄÉÒÅËÔÏÒÉÉ, × ËÏÔÏÒÏÊ ÏÎ ÒÁÓÐÏÌÏÖÅÎ" 115 else 116 echo "This script must be run from the directory in which it resides." 117 117 fi 118 118 exit 1 … … 138 138 if [ "x$GSDLHOME" != "x" -a "x$GSDL3SRCHOME" != "x" ]; then 139 139 # _version not set, but both env vars set, so default to 3 140 141 142 143 144 145 146 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 147 elif [ "x$GSDL3SRCHOME" != "x" ]; then 148 149 150 151 148 echo "Only gsdl3srchome set" 149 gsdlpath=$GSDL3SRCHOME 150 _version=3 151 echo "$gsdlpath" 152 152 elif [ "x$GSDLHOME" != "x" ]; then 153 154 153 gsdlpath=$GSDLHOME 154 _version=2 155 155 # If it is not set, assume that the GLI is installed as a subdirectory of Greenstone 156 156 else 157 158 159 160 161 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=$? 162 162 fi 163 163 fi … … 175 175 # Setup Greenstone 2, unless it has already been done 176 176 if [ "x$GSDLHOME" = "x" ]; then 177 178 179 177 cd "$gsdlpath" 178 . setup.bash 179 cd "$thisdir" 180 180 fi 181 181 # else, if we're running GS3 … … 183 183 # Setup Greenstone 3, unless it has already been done 184 184 if [ "x$GSDL3HOME" = "x" -o "x$GSDL3SRCHOME" = "x" ]; then 185 186 187 185 cd "$gsdlpath" 186 . gs3-setup.sh 187 cd "$thisdir" 188 188 fi 189 189 … … 196 196 if [ "x$gsdl2path" = "x" ]; then 197 197 # Check the environment variable first 198 199 200 201 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 202 202 # If it is not set, assume that the gs2build subdirectory of Greenstone 3 exists 203 204 205 203 else 204 gsdl2path=$GSDL3SRCHOME/gs2build 205 fi 206 206 fi 207 207 # Check that Greenstone 3's Greenstone 2 stuff looks OK (in gs2build) … … 210 210 # Setup Greenstone 3's gs2build, unless it has already been done 211 211 if [ "x$GSDLHOME" = "x" ]; then 212 213 214 212 cd "$gsdl2path" 213 . setup.bash 214 cd "$thisdir" 215 215 fi 216 216 … … 242 242 243 243 # Check that a Perl executable has been found 244 if [ "$glilang" = "es" ]; then 245 echo "Revisando Perl: $perlpath" 246 elif [ "$glilang" = "fr" ]; then 247 echo "Vérification de Perl: $perlpath" 248 elif [ "$glilang" = "ru" ]; then 249 echo "ðÒÏ×ÅÒËÁ Perl: $perlpath" 250 else 251 echo "Checking Perl: $perlpath" 252 fi 244 echo "Perl:" 253 245 if [ ! -x "$perlpath" ] ; then 254 246 echo 255 247 if [ "$glilang" = "es" ]; then 256 257 258 259 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." 260 252 elif [ "$glilang" = "fr" ]; then 261 262 263 264 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." 265 257 elif [ "$glilang" = "ru" ]; then 266 echo "âÉÂÌÉÏÔÅÞÎÙÊ $PROGNAME ÔÒÅÂÕÅÔ Perl, ÞÔÏÂÙ ÉÍÅÔØ ×ÏÚÍÏÖÎÏÓÔØ" 267 echo "ÒÁÂÏÔÁÔØ, ÎÏ Perl ÎÅ ÂÙÌ × ×ÁÛÅÊ ÓÉÓÔÅÍÅ. ðÏÖÁÌÕÊÓÔÁ, ÐÏÄÔ×ÅÒÄÉÔÅ, ÞÔÏ " 268 echo "Perl ÕÓÔÁÎÏ×ÌÅÎ É ÎÁÈÏÄÉÔÓÑ ÎÁ ×ÁÛÅÍ ÐÕÔÉ ÐÏÉÓËÁ, ÚÁÔÅÍ ÐÏ×ÔÏÒÎÏ××ÅÄÉÔÅ" 269 echo "ÜÔÏÔ ÓËÒÉÐÔ." 270 else 271 echo "The $PROGNAME requires Perl in order to operate," 272 echo "but perl could not be detected on your system. Please ensure that perl" 273 echo "is installed and is on your search path, then rerun this script." 274 fi 275 exit 1 276 fi 277 258 echo "âÉÂÌÉÏÔÅÞÎÙÊ $PROGNAME ÔÒÅÂÕÅÔ Perl, ÞÔÏÂÙ ÉÍÅÔØ ×ÏÚÍÏÖÎÏÓÔØ" 259 echo "ÒÁÂÏÔÁÔØ, ÎÏ Perl ÎÅ ÂÙÌ × ×ÁÛÅÊ ÓÉÓÔÅÍÅ. ðÏÖÁÌÕÊÓÔÁ, ÐÏÄÔ×ÅÒÄÉÔÅ, ÞÔÏ " 260 echo "Perl ÕÓÔÁÎÏ×ÌÅÎ É ÎÁÈÏÄÉÔÓÑ ÎÁ ×ÁÛÅÍ ÐÕÔÉ ÐÏÉÓËÁ, ÚÁÔÅÍ ÐÏ×ÔÏÒÎÏ××ÅÄÉÔÅ" 261 echo "ÜÔÏÔ ÓËÒÉÐÔ." 262 else 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." 266 fi 267 exit 1 268 fi 269 echo $perlpath 270 echo 278 271 279 272 ## ---- Check Java ---- 280 # Some users may set the above line manually 273 echo "Java:" 274 MINIMUM_JAVA_VERSION=1.4.0_00 275 276 # Some users may set this line manually 281 277 javapath= 278 282 279 if [ "$javapath" == "" ]; then 283 280 284 HINT=`cd ..;pwd` 285 javapath=`../bin/search4j -e -p $HINT -m 1.4.0_00` 281 # sus out search4j 282 if [ "$_version" -eq 2 -a -x "$GSDLHOME/bin/search4j" ]; then 283 SEARCH4J_EXECUTABLE=$GSDLHOME/bin/search4j 284 elif [ "$_version" -eq 3 -a -x "$GSDL3SRCHOME/bin/search4j" ]; then 285 SEARCH4J_EXECUTABLE=$GSDL3SRCHOME/bin/search4j 286 elif [ -x "../bin/search4j/search4j" ]; then 287 SEARCH4J_EXECUTABLE=../bin/search4j 288 else 289 echo "Couldn't determine the location of the search4j executable" 290 echo "If you are running Greenstone2" 291 echo " * check GSDLHOME is set" 292 echo " * check bin/search4j exists" 293 echo " * check bin/search4j is executable" 294 echo "If you are running Greenstone3" 295 echo " * check GSDL3SRCHOME is set" 296 echo " * check bin/search4j exists" 297 echo " * check bin/search4j is executable" 298 echo " * try running 'ant compile-search4j'" 299 300 # last-resort tricks 301 if [ -e "../packages/jre" ]; then 302 function search4j_shell_function() { 303 echo `cd ../packages/jre/bin; pwd`/java 304 } 305 SEARCH4J_EXECUTABLE=search4j_shell_function 306 elif [ "$JAVA_HOME" != "" ]; then 307 function search4j_shell_function() { 308 echo $JAVA_HOME/bin/java 309 } 310 SEARCH4J_EXECUTABLE=search4j_shell_function 311 else 312 exit 1 313 fi 314 fi 315 316 HINT=`cd ..;pwd` 317 javapath=`$SEARCH4J_EXECUTABLE -e -p $HINT -m $MINIMUM_JAVA_VERSION` 286 318 287 319 if [ "$?" != "0" ]; then 288 320 289 ../bin/search4j -e -p $HINT 290 291 if [ "$?" != "0" ]; then292 293 294 295 296 297 echo "una nueva versión del Ambiente de Ejecución Java (versión 1.4o "298 299 300 301 302 echo "Veuillez installer une nouvelle version du JRE (version 1.4ou plus"303 304 305 306 307 echo "ÕÓÔÁÎÏ×ÉÔÅ ÎÏ×ÕÀ ×ÅÒÓÉÀ JRE (×ÅÒÓÉÀ 1.4ÉÌÉ ÂÏÌÅÅ ÎÏ×ÕÀ) É"308 309 310 echo "The version of the Java Runtime Environment you have installed is too"311 echo "old to run the $PROGNAME. Please install a new"312 echo "version of the JRE (version 1.4or newer) and rerun this script."313 314 315 316 317 318 319 320 321 echo "instalar un Ambiente de Ejecución Java (versión 1.4o superior) "322 323 324 325 echo "Vous devez installer un Java Runtime Environment (version 1.4ou"326 327 328 329 echo "÷Ù ÄÏÌÖÎÙ ÕÓÔÁÎÏ×ÉÔØ Java Runtime Environment (×ÅÒÓÉÀ 1.4ÉÌÉ ×ÙÛÅ)"330 331 332 333 echo "Java Runtime Environment (version 1.4or greater) before running the"334 335 336 337 338 339 340 fi 341 342 echo "Java: $javapath"321 OLDVER=`$SEARCH4J_EXECUTABLE -v -p $HINT` 322 323 if [ "$?" == "0" ]; then 324 325 if [ "$glilang" = "es" ]; then 326 echo "La versión del Ambiente de Ejecución Java (JRE por sus siglas en " 327 echo "inglés) que usted tiene instalada es demasiado vieja para ejecutar " 328 echo "la Interfaz de la $PROGNAME. Por favor instale " 329 echo "una nueva versión del Ambiente de Ejecución Java (versión $MINIMUM_JAVA_VERSION o " 330 echo "posterior) y ejecute nuevamente este guión." 331 elif [ "$glilang" = "fr" ]; then 332 echo "La version de Java Runtime Environment que vous avez installée est" 333 echo "trop vielle pour faire fonctionner $PROGNAME." 334 echo "Veuillez installer une nouvelle version du JRE (version $MINIMUM_JAVA_VERSION ou plus" 335 echo "récente) et redémarrez le script." 336 elif [ "$glilang" = "ru" ]; then 337 echo "÷ÅÒÓÉÑ Java Runtime Environment, ËÏÔÏÒÕÀ ÷Ù ÕÓÔÁÎÏ×ÉÌÉ, ÏÞÅÎØ ÓÔÁÒÁ," 338 echo "ÞÔÏÂÙ ÕÐÒÁ×ÌÑÔØ ÂÉÂÌÉÏÔÅÞÎÙÍ $PROGNAME. ðÏÖÁÌÕÊÓÔÁ, " 339 echo "ÕÓÔÁÎÏ×ÉÔÅ ÎÏ×ÕÀ ×ÅÒÓÉÀ JRE (×ÅÒÓÉÀ $MINIMUM_JAVA_VERSION ÉÌÉ ÂÏÌÅÅ ÎÏ×ÕÀ) É" 340 echo "ÐÅÒÅÕÓÔÁÎÏ×ÉÔÅ ÜÔÏÔ ÓËÒÉÐÔ" 341 else 342 echo "The version of the Java Runtime Environment you have installed ($OLDVER)" 343 echo "is too old to run the $PROGNAME. Please install a new" 344 echo "version of the JRE (version $MINIMUM_JAVA_VERSION or newer) and rerun this script." 345 fi 346 exit 1 347 348 else 349 350 echo 351 if [ "$glilang" = "es" ]; then 352 echo "No se pudo localizar una versión apropiada de Java. Usted deberá " 353 echo "instalar un Ambiente de Ejecución Java (versión $MINIMUM_JAVA_VERSION o superior) " 354 echo "antes de correr la Interfaz de la $PROGNAME." 355 elif [ "$glilang" = "fr" ]; then 356 echo "Une version adéquate de Java n'a pas pu être localisée." 357 echo "Vous devez installer un Java Runtime Environment (version $MINIMUM_JAVA_VERSION ou" 358 echo "supérieur) avant de démarrer $PROGNAME." 359 elif [ "$glilang" = "ru" ]; then 360 echo "îÅ ÕÄÁÌÏÓØ ÏÐÒÅÄÅÌÉÔØ ÍÅÓÔÏÎÁÈÏÖÄÅÎÉÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÊ ×ÅÒÓÉÉ Java." 361 echo "÷Ù ÄÏÌÖÎÙ ÕÓÔÁÎÏ×ÉÔØ Java Runtime Environment (×ÅÒÓÉÀ $MINIMUM_JAVA_VERSION ÉÌÉ ×ÙÛÅ)" 362 echo "ÐÅÒÅÄ ××ÏÄÏÍ ÂÉÂÌÉÏÔÅÞÎÏÇÏ $PROGNAME." 363 else 364 echo "Failed to locate an appropriate version of Java. You must install a" 365 echo "Java Runtime Environment (version $MINIMUM_JAVA_VERSION or greater) before running the" 366 echo "$PROGNAME." 367 fi 368 fi 369 370 fi 371 372 fi 373 echo $javapath 374 echo 343 375 344 376 … … 353 385 echo 354 386 if [ "$glilang" = "es" ]; then 355 356 387 echo "Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone" 388 echo "(por medio de makegli.sh) antes de ejecutar este guión." 357 389 elif [ "$glilang" = "fr" ]; then 358 359 390 echo "Vous devez compiler le Greenstone Interface (en utilisant makegli.sh)" 391 echo "avant d'exécuter ce script." 360 392 elif [ "$glilang" = "ru" ]; then 361 362 363 else 364 365 393 echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone" 394 echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ" 395 else 396 echo "You need to compile the Greenstone Librarian Interface (using makegli.sh)" 397 echo "before running this script." 366 398 fi 367 399 exit 1 … … 395 427 exit_status=0 396 428 if [ "$_version" -eq 2 ]; then 397 398 429 `$basic_command -gsdl $GSDLHOME -gsdlos $GSDLOS $*` 430 exit_status=$? 399 431 elif [ "$_version" -eq 3 ]; then 400 401 432 `$basic_command -gsdl $GSDLHOME -gsdlos $GSDLOS -gsdl3 $GSDL3HOME -gsdl3src $GSDL3SRCHOME $*` 433 exit_status=$? 402 434 fi 403 435 404 436 if [ "$exit_status" != "2" ] ; then 405 406 else 407 408 409 410 411 412 413 414 415 416 417 437 stop_gli=1 438 else 439 echo 440 if [ "$glilang" = "es" ]; then 441 echo "Restarting/Ejecutando la Interfaz de la $PROGNAME..." 442 elif [ "$glilang" = "fr" ]; then 443 echo "Restarting/Exécution de $PROGNAME..." 444 elif [ "$glilang" = "ru" ]; then 445 echo "Restarting/ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ $PROGNAME..." 446 else 447 echo "Restarting the $PROGNAME..." 448 fi 449 418 450 fi 419 451 done
Note:
See TracChangeset
for help on using the changeset viewer.