3 ##############################################################################
5 # Defines the environment variables used by the personalized unix
7 ##############################################################################
9 if [ ! -z "$SHELL_DEBUG" ]; then echo variables initialization begins...; fi
11 ##############################################################################
13 ##############################################################################
14 # OS stands for the operating system that we think is running.
18 export IS_DARWIN=$(echo $OSTYPE | grep -i darwin)
20 if [ -z "$HOME" ]; then
21 if [ "$OS" == "Windows_NT" ]; then
23 if [ ! -d $HOME ]; then
29 # patch home to undo cygwin style of drive letter.
30 export HOME=$(echo $HOME | sed -e 's/\/cygdrive\//\//g')
31 #echo HOME is now $HOME
33 if [ "$OS" == "Windows_NT" ]; then
34 export HOSTNAME=$(echo $HOSTNAME | tr A-Z a-z)
37 ##############################################################################
38 # Directory variables.
39 ##############################################################################
40 # The yeti library directory holds useful shell scripts, public databases,
41 # configuration examples, javascript code, and other stuff.
42 export SCRIPT_SYSTEM=feisty_meow
44 #if [ -z "$YETI_DIR" ]; then export YETI_DIR="$HOME/$SCRIPT_SYSTEM"; fi
45 #if [ -z "$YETI_SCRIPTS" ]; then export YETI_SCRIPTS="$YETI_DIR/scripts"; fi
46 #if [ -z "$SHELLDIR" ]; then export SHELLDIR="$YETI_SCRIPTS"; fi
48 # include helpful functions.
49 source "$YETI_SCRIPTS/core/functions.sh"
51 # LIBDIR is an older variable that points at the root of the yeti code.
52 export LIBDIR=$YETI_DIR
54 if [ -z "$GENERADIR" ]; then
55 # The generated scripts directory is where automatically generated files live.
56 # It is separate from the main body of the shell scripts in order to keep things from
58 export GENERADIR=$HOME/.zz_auto_gen
61 ##############################################################################
63 ##############################################################################
65 # pull in the custom variable overrides for bash.
66 if [ -f "$YETI_SCRIPTS/custom/c_variables.sh" ]; then
67 source "$YETI_SCRIPTS/custom/c_variables.sh"
70 # sets the prompts to what we (i.e., i) like...
71 # there are four different prompts. the first one, PS1, is the one that users
73 export PS1='\u@\h $ ';
74 ### export PS2='> '; export PS3='#? '; export PS4='+ '
78 if [ "$OS" != "Windows_NT" ]; then
79 PERLLIB+="/usr/lib/perl5"
81 #echo "the scripts dir is $YETI_SCRIPTS"
82 YETI_SCRIPTS="$(echo $YETI_SCRIPTS | sed -e 's/\\/\//g')"
83 SHELLDIR="$YETI_SCRIPTS"
84 #echo "the scripts dir is now $SHELLDIR"
86 # choose perl's IO over the system's so we can handle file bytes exactly.
90 PERLLIB+=":$YETI_SCRIPTS/core:$YETI_SCRIPTS/text:$YETI_SCRIPTS/files:$YETI_SCRIPTS/archival"
92 # set this so nechung can find its data.
93 export NECHUNG=$LIBDIR/database/fortunes.dat
95 # ensure we use the right kind of rsh for security.
98 # sets the history length and max file size so we can get some long history around here.
102 # set the editor for subversion if it hasn't already been set.
103 if [ -z "$SVN_EDITOR" ]; then
104 #hmmm: not sure what original reason for having these different was...
105 if [ "$OS" == "Windows_NT" ]; then
106 export SVN_EDITOR=$(which gvim)
108 export SVN_EDITOR=$(which vi)
112 # include variables needed for compiling hoople and using its scripts.
113 if [ -z "$REPOSITORY_DIR" ]; then
114 if [ -d "$HOME/feisty_meow" ]; then
115 export REPOSITORY_DIR="$HOME/feisty_meow"
119 # initialize the build variables, if possible.
121 if [ ! -z "$REPOSITORY_DIR" ]; then
122 # first guess at using the old school bin directory.
123 bv="$REPOSITORY_DIR/bin/build_variables.sh"
124 if [ -f "$bv" ]; then
125 # the old bin directory is present, so let's use its build vars.
129 # try again with the new school location for the file.
130 bv="$REPOSITORY_DIR/scripts/generator/build_variables.sh"
131 if [ -f "$bv" ]; then
132 # yep, that one looks good, so pull in the build defs.
136 # try once more with new school and assume we're deep.
137 bv="$REPOSITORY_DIR/../../scripts/generator/build_variables.sh"
138 if [ -f "$bv" ]; then
139 # sweet, there is something there.
147 # augment the configuration if we found our build variables.
148 if [ $found_build_vars == 1 ]; then
150 # the binary directory contains handy programs we use a lot in yeti. we set up the path to it
151 # here based on the operating system.
152 # note that yeti has recently become more dependent on hoople. hoople was always the source of
153 # the binaries, but now we don't ship them with yeti any more as pre-built items. this reduces
154 # the size of the code package a lot and shortens up our possible exposure to compromised
155 # binaries. people can bootstrap up their own set from hoople now instead.
156 export BINDIR=$REPOSITORY_DIR/production/binaries
158 # add binaries created within build to the path.
159 export PATH="$(dos_to_msys_path $BUILD_TOP/build/bin):$PATH"
161 # Shared libraries are located via this variable.
162 export LD_LIBRARY_PATH="$(dos_to_msys_path $LD_LIBRARY_PATH):$(dos_to_msys_path $BINDIR)"
165 # Set the path for locating applications.
166 export PATH="$(dos_to_msys_path $BINDIR):$(dos_to_msys_path $GENERADIR):$PATH:/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/lib:/usr/games:/usr/bin:."
168 if [ ! -z "$SHELL_DEBUG" ]; then echo variables initialization ends....; fi