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 "$FEISTY_MEOW_DIR" ]; then export FEISTY_MEOW_DIR="$HOME/$SCRIPT_SYSTEM"; fi
45 #if [ -z "$FEISTY_MEOW_SCRIPTS" ]; then export FEISTY_MEOW_SCRIPTS="$FEISTY_MEOW_DIR/scripts"; fi
46 #if [ -z "$FEISTY_MEOW_SCRIPTS" ]; then export FEISTY_MEOW_SCRIPTS="$FEISTY_MEOW_SCRIPTS"; fi
48 # include helpful functions.
49 source "$FEISTY_MEOW_SCRIPTS/core/functions.sh"
51 # LIBDIR is an older variable that points at the root of the yeti code.
52 export LIBDIR=$FEISTY_MEOW_DIR
54 if [ -z "$FEISTY_MEOW_GENERATED" ]; 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 FEISTY_MEOW_GENERATED=$HOME/.zz_auto_gen
61 ##############################################################################
63 ##############################################################################
65 # pull in the custom overrides for feisty_meow scripts.
66 for i in $FEISTY_MEOW_SCRIPTS/custom/*.sh; do
67 if [ ! -z "$SHELL_DEBUG" ]; then
68 echo "loading customization: $(basename $(dirname $i))/$(basename $i)"
73 # sets the prompts to what we (i.e., i) like...
74 # there are four different prompts. the first one, PS1, is the one that users
76 export PS1='\u@\h $ ';
77 ### export PS2='> '; export PS3='#? '; export PS4='+ '
81 if [ "$OS" != "Windows_NT" ]; then
82 PERLLIB+="/usr/lib/perl5"
84 #echo "the scripts dir is $FEISTY_MEOW_SCRIPTS"
85 FEISTY_MEOW_SCRIPTS="$(echo $FEISTY_MEOW_SCRIPTS | sed -e 's/\\/\//g')"
86 FEISTY_MEOW_SCRIPTS="$FEISTY_MEOW_SCRIPTS"
87 #echo "the scripts dir is now $FEISTY_MEOW_SCRIPTS"
89 # choose perl's IO over the system's so we can handle file bytes exactly.
93 PERLLIB+=":$FEISTY_MEOW_SCRIPTS/core:$FEISTY_MEOW_SCRIPTS/text:$FEISTY_MEOW_SCRIPTS/files:$FEISTY_MEOW_SCRIPTS/archival"
95 # set this so nechung can find its data.
96 export NECHUNG=$LIBDIR/database/fortunes.dat
98 # ensure we use the right kind of rsh for security.
101 # sets the history length and max file size so we can get some long history around here.
105 # set the editor for subversion if it hasn't already been set.
106 if [ -z "$SVN_EDITOR" ]; then
107 #hmmm: not sure what original reason for having these different was...
108 if [ "$OS" == "Windows_NT" ]; then
109 export SVN_EDITOR=$(which gvim)
111 export SVN_EDITOR=$(which vi)
115 # include variables needed for compiling hoople and using its scripts.
116 if [ -z "$FEISTY_MEOW_DIR" ]; then
117 if [ -d "$HOME/feisty_meow" ]; then
118 export FEISTY_MEOW_DIR="$HOME/feisty_meow"
122 # initialize the build variables, if possible.
124 if [ ! -z "$FEISTY_MEOW_DIR" ]; then
125 # first guess at using the old school bin directory.
126 bv="$FEISTY_MEOW_DIR/bin/build_variables.sh"
127 if [ -f "$bv" ]; then
128 # the old bin directory is present, so let's use its build vars.
132 # try again with the new school location for the file.
133 bv="$FEISTY_MEOW_DIR/scripts/generator/build_variables.sh"
134 if [ -f "$bv" ]; then
135 # yep, that one looks good, so pull in the build defs.
139 # try once more with new school and assume we're deep.
140 bv="$FEISTY_MEOW_DIR/../../scripts/generator/build_variables.sh"
141 if [ -f "$bv" ]; then
142 # sweet, there is something there.
150 # augment the configuration if we found our build variables.
151 if [ $found_build_vars == 1 ]; then
153 # the binary directory contains handy programs we use a lot in yeti. we set up the path to it
154 # here based on the operating system.
155 # note that yeti has recently become more dependent on hoople. hoople was always the source of
156 # the binaries, but now we don't ship them with yeti any more as pre-built items. this reduces
157 # the size of the code package a lot and shortens up our possible exposure to compromised
158 # binaries. people can bootstrap up their own set from hoople now instead.
159 export BINDIR=$FEISTY_MEOW_DIR/production/binaries
161 # add binaries created within build to the path.
162 export PATH="$(dos_to_msys_path $BUILD_TOP/build/bin):$PATH"
164 # Shared libraries are located via this variable.
165 export LD_LIBRARY_PATH="$(dos_to_msys_path $LD_LIBRARY_PATH):$(dos_to_msys_path $BINDIR)"
168 # Set the path for locating applications.
169 export PATH="$(dos_to_msys_path $BINDIR):$(dos_to_msys_path $FEISTY_MEOW_GENERATED):$PATH:/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/lib:/usr/games:/usr/bin:."
171 if [ ! -z "$SHELL_DEBUG" ]; then echo variables initialization ends....; fi