Changeset 6892
- Timestamp:
- 2004-02-25T17:09:55+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/setup.bash
r6820 r6892 2 2 # this should work under ash, bash, zsh, ksh, sh style shells. 3 3 gsdllang="" 4 # encoding inputs and outputs 5 gsdltoenc="" 6 gsdlfromenc="" 4 7 5 8 # see if the shell has any language environment variables set 6 9 # see locale(7) manpage for this ordering. 7 10 if test ! -z "$LC_ALL" ; then 8 gsdllang= $LC_ALL11 gsdllang="$LC_ALL" 9 12 elif test ! -z "$LANG"; then 10 gsdllang= $LANG13 gsdllang="$LANG" 11 14 fi 15 12 16 13 17 # note... all our output strings have the charset hard-coded, but 14 18 # people may be using a different encoding in their terminal. LANG 15 # strings look like "en_NZ.UTF-8". For now this doesn't check encodings 16 # or the _country bit 19 # strings look like "en_NZ.UTF-8". 20 21 # Determine the requested output encoding 22 case $gsdllang in 23 *.*) 24 gsdltoenc=`echo $gsdllang | sed 's/.*\.//'` 25 ;; 26 esac 17 27 18 28 # Our french and spanish strings are currently in iso-8859-1 encoding. 19 20 29 case $gsdllang in 21 30 fr*|FR*) 22 31 gsdllang=fr 32 gsdlfromenc="iso-8859-1" 23 33 ;; 24 34 es*|ES*) 25 35 gsdllang=es 36 gsdlfromenc="iso-8859-1" 26 37 ;; 27 38 ru*|RU*) 28 39 gsdllang=ru 40 gsdlfromenc="koi8r" 29 41 ;; 30 42 *) # default 31 43 gsdllang=en 44 gsdlfromenc="iso-8859-1" 32 45 ;; 33 46 esac 47 48 # "iconv" is the program for converting text between encodings. 49 gsdliconv=`which iconv 2>/dev/null` 50 if test $? -ne 0 || test -z "$gsdlfromenc" || test -z "$gsdltoenc"; then 51 # we can't convert encodings from some reason 52 gsdliconv="cat" 53 else 54 # add the encodings 55 gsdliconv="$gsdliconv -f $gsdlfromenc -t $gsdltoenc" 56 fi 34 57 35 58 # make sure we are sourced, and not run … … 47 70 case "$gsdllang" in 48 71 "es") 49 echo ' Error: Asegúrese de compilar este guión, no de ejecutarlo. P. ej.:' 50 echo ' $ source setup.bash' 51 echo ' o' 52 echo ' $ . ./setup.bash' 53 echo ' no' 54 echo ' $ ./setup.bash' 72 eval $gsdliconv <<EOF 73 Error: Asegúrese de compilar este guión, no de ejecutarlo. P. ej.: 74 $ source setup.bash 75 o 76 $ . ./setup.bash 77 no 78 $ ./setup.bash 79 EOF 55 80 ;; 56 81 "fr") 57 echo '-- Still coming --' 82 eval $gsdliconv <<EOF 83 -- Still coming -- 84 EOF 58 85 ;; 59 86 "ru") 60 echo ' ïÛÉÂËÁ: õÄÏÓÔÏ×ÅÒØÔÅÓØ × ÉÓÔÏÞÎÉËÅ ÜÔÏÇÏ ÓËÒÉÐÔÁ. îÅ ÉÓÐÏÌÎÑÊÔÅ ÅÇÏ.' 61 echo ' îÁÐÒÉÍÅÒ:' 62 echo ' $ source setup.bash' 63 echo ' ÉÌÉ' 64 echo ' $../setup.bash' 65 echo ' ÎÅÔ' 66 echo ' $./setup.bash' 87 eval $gsdliconv <<EOF 88 ïÛÉÂËÁ: õÄÏÓÔÏ×ÅÒØÔÅÓØ × ÉÓÔÏÞÎÉËÅ ÜÔÏÇÏ ÓËÒÉÐÔÁ. îÅ ÉÓÐÏÌÎÑÊÔÅ ÅÇÏ. 89 îÁÐÒÉÍÅÒ: 90 $ source setup.bash 91 ÉÌÉ 92 $ . ./setup.bash 93 ÎÅÔ 94 $ ./setup.bash 95 EOF 67 96 ;; 68 97 *) 69 echo ' Error: Make sure you source this script, not execute it. Eg:' 70 echo ' $ source setup.bash' 71 echo ' or' 72 echo ' $ . ./setup.bash' 73 echo ' not' 74 echo ' $ ./setup.bash' 98 eval $gsdliconv <<EOF 99 Error: Make sure you source this script, not execute it. Eg: 100 $ source setup.bash 101 or 102 $ . ./setup.bash 103 not 104 $ ./setup.bash 105 EOF 75 106 ;; 76 107 esac … … 78 109 case "$gsdllang" in 79 110 "es") 80 echo '¡Su ambiente ya está listo para Greenstone!' 111 echo '¡Su ambiente ya está listo para Greenstone!' | eval $gsdliconv 81 112 ;; 82 113 "fr") 83 echo 'Votre environnement est déjà préparé pour Greenstone!' 114 echo 'Votre environnement est déjà préparé pour Greenstone!' | eval $gsdliconv 84 115 ;; 85 116 "ru") 86 echo '÷ÁÛÅ ÏËÒÕÖÅÎÉÅ ÕÖÅ ÎÁÓÔÒÏÅÎÏ ÄÌÑ Greenstone!' 117 echo '÷ÁÛÅ ÏËÒÕÖÅÎÉÅ ÕÖÅ ÎÁÓÔÒÏÅÎÏ ÄÌÑ Greenstone!' | eval $gsdliconv 87 118 ;; 88 119 *) … … 93 124 case "$gsdllang" in 94 125 "es") 95 echo 'Usted debe compilar el guión desde el interior del directorio de inicio' 96 echo 'de Greenstone.' 126 eval $gsdliconv <<EOF 127 Usted debe compilar el guión desde el interior del directorio de inicio 128 de Greenstone. 129 EOF 97 130 ;; 98 131 "fr") 99 echo 'Vous devez trouver la source du script dans le répertoire de base de Greenstone' 132 echo 'Vous devez trouver la source du script dans le répertoire de base de Greenstone' | eval $gsdliconv 100 133 ;; 101 134 "ru") 102 echo '÷ÁÍ ÎÅÏÂÈÏÄÉÍ ÉÓÔÏÞÎÉË ÓËÒÉÐÔÁ ÉÚ ÂÁÚÏ×ÏÊ ÄÉÒÅËÔÏÒÉÉ Greenstone' 135 eval $gsdliconv <<EOF 136 ÷ÁÍ ÎÅÏÂÈÏÄÉÍ ÉÓÔÏÞÎÉË ÓËÒÉÐÔÁ ÉÚ ÂÁÚÏ×ÏÊ ÄÉÒÅËÔÏÒÉÉ Greenstone 137 EOF 103 138 ;; 104 139 *) … … 123 158 case "$gsdllang" in 124 159 "es") 125 echo 'Su ambiente ha sido configurado para correr los programas Greenstone.' 160 echo 'Su ambiente ha sido configurado para correr los programas Greenstone.' | eval $gsdliconv 126 161 ;; 127 162 "fr") 128 echo 'Votre environnement a été configuére avec succès pour exécuter Greenstone' 163 echo 'Votre environnement a été configuére avec succès pour exécuter Greenstone' | eval $gsdliconv 129 164 ;; 130 165 "ru") 131 echo '÷ÁÛÅ ÏËÒÕÖÅÎÉÅ ÂÙÌÏ ÕÓÐÅÛÎÏ ÎÁÓÔÒÏÅÎÏ, ÞÔÏÂÙ ÕÓÔÁÎÏ×ÉÔØ Greenstone' 166 eval $gsdliconv <<EOF 167 ÷ÁÛÅ ÏËÒÕÖÅÎÉÅ ÂÙÌÏ ÕÓÐÅÛÎÏ ÎÁÓÔÒÏÅÎÏ, ÞÔÏÂÙ ÕÓÔÁÎÏ×ÉÔØ Greenstone 168 EOF 132 169 ;; 133 170 *) … … 137 174 fi 138 175 unset gsdl_not_sourced 176 unset gsdliconv 177 unset gsdlfromenc 178 unset gsdltoenc
Note:
See TracChangeset
for help on using the changeset viewer.