source: trunk/gsdl/setup.bash@ 6820

Last change on this file since 6820 was 6820, checked in by jrm21, 20 years ago

changed echo "..." to echo '...' to escape $ and high-bit chars. ksh didn't
like trying to parse some of it.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 3.6 KB
Line 
1# if this file is executed, /bin/sh is used, as we don't start with #!
2# this should work under ash, bash, zsh, ksh, sh style shells.
3gsdllang=""
4
5# see if the shell has any language environment variables set
6# see locale(7) manpage for this ordering.
7if test ! -z "$LC_ALL" ; then
8 gsdllang=$LC_ALL
9elif test ! -z "$LANG"; then
10 gsdllang=$LANG
11fi
12
13# note... all our output strings have the charset hard-coded, but
14# 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
17
18# Our french and spanish strings are currently in iso-8859-1 encoding.
19
20case $gsdllang in
21 fr*|FR*)
22 gsdllang=fr
23 ;;
24 es*|ES*)
25 gsdllang=es
26 ;;
27 ru*|RU*)
28 gsdllang=ru
29 ;;
30 *) # default
31 gsdllang=en
32 ;;
33esac
34
35# make sure we are sourced, and not run
36
37if test "$0" != "`echo $0 | sed s/setup\.bash//`" ; then
38# if $0 contains "setup.bash" we've been run... $0 is shellname if sourced.
39# One exception is zsh has an option to set it temporarily to the script name
40 if test -z "$ZSH_NAME" ; then
41 # we aren't using zsh
42 gsdl_not_sourced=true
43 fi
44fi
45
46if test -n "$gsdl_not_sourced" ; then
47 case "$gsdllang" in
48 "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'
55 ;;
56 "fr")
57 echo '-- Still coming --'
58 ;;
59 "ru")
60 echo ' ïÛÉÂËÁ: õÄÏÓÔÏ×ÅÒØÔÅÓØ × ÉÓÔÏÞÎÉËÅ ÜÔÏÇÏ ÓËÒÉÐÔÁ. îÅ ÉÓÐÏÌÎÑÊÔÅ ÅÇÏ.'
61 echo ' îÁÐÒÉÍÅÒ:'
62 echo ' $ source setup.bash'
63 echo ' ÉÌÉ'
64 echo ' $../setup.bash'
65 echo ' ÎÅÔ'
66 echo ' $./setup.bash'
67 ;;
68 *)
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'
75 ;;
76 esac
77elif test -n "$GSDLHOME" ; then
78 case "$gsdllang" in
79 "es")
80 echo '¡Su ambiente ya está listo para Greenstone!'
81 ;;
82 "fr")
83 echo 'Votre environnement est déjà préparé pour Greenstone!'
84 ;;
85 "ru")
86 echo '÷ÁÛÅ ÏËÒÕÖÅÎÉÅ ÕÖÅ ÎÁÓÔÒÏÅÎÏ ÄÌÑ Greenstone!'
87 ;;
88 *)
89 echo 'Your environment is already set up for Greenstone!'
90 ;;
91 esac
92elif test ! -f setup.bash ; then
93 case "$gsdllang" in
94 "es")
95 echo 'Usted debe compilar el guión desde el interior del directorio de inicio'
96 echo 'de Greenstone.'
97 ;;
98 "fr")
99 echo 'Vous devez trouver la source du script dans le répertoire de base de Greenstone'
100 ;;
101 "ru")
102 echo '÷ÁÍ ÎÅÏÂÈÏÄÉÍ ÉÓÔÏÞÎÉË ÓËÒÉÐÔÁ ÉÚ ÂÁÚÏ×ÏÊ ÄÉÒÅËÔÏÒÉÉ Greenstone'
103 ;;
104 *)
105 echo 'You must source the script from within the Greenstone home directory'
106 ;;
107 esac
108else
109 GSDLHOME=`pwd`
110 export GSDLHOME
111 GSDLOS=`uname -s | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
112 # check for running bash under cygwin
113 if test "`echo $GSDLOS | sed 's/cygwin//'`" != "$GSDLOS" ;
114 then
115 GSDLOS=windows
116 fi
117 export GSDLOS
118
119 PATH=$PATH:$GSDLHOME/bin/script:$GSDLHOME/bin/$GSDLOS
120 export PATH
121 MANPATH=$MANPATH:$GSDLHOME/packages/mg/man
122 export MANPATH
123 case "$gsdllang" in
124 "es")
125 echo 'Su ambiente ha sido configurado para correr los programas Greenstone.'
126 ;;
127 "fr")
128 echo 'Votre environnement a été configuére avec succès pour exécuter Greenstone'
129 ;;
130 "ru")
131 echo '÷ÁÛÅ ÏËÒÕÖÅÎÉÅ ÂÙÌÏ ÕÓÐÅÛÎÏ ÎÁÓÔÒÏÅÎÏ, ÞÔÏÂÙ ÕÓÔÁÎÏ×ÉÔØ Greenstone'
132 ;;
133 *)
134 echo 'Your environment has successfully been set up to run Greenstone'
135 ;;
136 esac
137fi
138unset gsdl_not_sourced
Note: See TracBrowser for help on using the repository browser.