6 # Defines the environment variables used by the personalized unix
8 # Author: Chris Koeritz
12 if [ ! -z "$SHELL_DEBUG" ]; then echo variables initialization begins...; fi
16 # OS variable records the operating system we think we found.
20 export IS_DARWIN=$(echo $OSTYPE | grep -i darwin)
24 # windoze sometimes needs a special home variable setup.
25 if [ "$OS" == "Windows_NT" ]; then
26 # give them a default place if they don't have one already.
27 if [ -z "$HOME" ]; then
30 # patch home to undo cygwin style of drive letter.
31 export HOME=$(echo $HOME | sed -e 's/\/cygdrive\//\//g')
32 # make the home folder if it doesn't exist yet.
33 if [ ! -d $HOME ]; then
36 if [ ! -z "$SHELL_DEBUG" ]; then echo HOME is now $HOME; fi
41 # fallbacks to set crucial variables for feisty meow...
43 # set the main root directory variable for the feisty meow codebase.
44 # this is only used for extreme failure modes, when the values were not
45 # pulled in from our auto-generated config.
46 if [ -z "$FEISTY_MEOW_DIR" ]; then
47 if [ -d "$HOME/feisty_meow" ]; then
48 export FEISTY_MEOW_DIR="$HOME/feisty_meow"
52 # similarly, make sure we have someplace to look for our generated files, if
53 # we were not handed a value.
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
63 # umask sets a permission mask for all file creations. the mask used here
64 # disallows writing by the "group" and "others" categories.
66 # ulimit sets user limits. we set the maximum allowed core dump file size
67 # to zero, because it is obnoxious to see the core dumps from crashed
68 # programs lying around everywhere.
73 export SCRIPT_SYSTEM=feisty_meow
75 # include helpful functions.
76 source "$FEISTY_MEOW_SCRIPTS/core/functions.sh"
78 # LIBDIR is an older variable that points at the root of the yeti code.
79 export LIBDIR=$FEISTY_MEOW_DIR
83 # user variables, sort of... if they haven't given themselves a name yet,
84 # then we will make one up for them.
86 # define a default name, if one wasn't already set.
87 if [ -z "$NAME" ]; then
88 export NAME='Unset Q. Namington, Fixley Your Name III'
95 # sets the main prompt to a simple default, with user@host.
96 export PS1='\u@\h $ ';
100 if [ "$OS" != "Windows_NT" ]; then
101 PERLLIB+="/usr/lib/perl5"
103 export PERLIO=:perlio
104 # choose perl's IO over the ms-windows version so we can handle file
108 # iterate across our sub-directories and find the perl scripts.
109 # this currently only looks one level down.
110 for i in $FEISTY_MEOW_SCRIPTS/*; do
112 # check if there is a perl file present; add the folder to PERLLIB if so.
113 ls $i/*.pl &>/dev/null
114 if [ $? -eq 0 ]; then
119 #echo PERLLIB is now $PERLLIB
121 # set this so nechung can find its data.
122 export NECHUNG=$LIBDIR/database/fortunes.dat
124 # ensure we use the right kind of rsh for security.
127 # sets the history length and max file size so we can get some long history around here.
131 # the base checkout list is just to update feisty_meow. additional folder
132 # names can be added in your customized scripts.
133 export REPOSITORY_LIST="feisty_meow"
135 # set the editor for subversion if it hasn't already been set.
136 if [ -z "$SVN_EDITOR" ]; then
137 #hmmm: not sure what original reason for having these different was...
138 if [ "$OS" == "Windows_NT" ]; then
139 export SVN_EDITOR=$(which gvim)
141 export SVN_EDITOR=$(which vi)
145 # initialize the build variables, if possible.
147 if [ ! -z "$FEISTY_MEOW_DIR" ]; then
148 # first guess at using the old school bin directory.
149 bv="$FEISTY_MEOW_DIR/bin/build_variables.sh"
150 if [ -f "$bv" ]; then
151 # the old bin directory is present, so let's use its build vars.
155 # try again with the new school location for the file.
156 bv="$FEISTY_MEOW_DIR/scripts/generator/build_variables.sh"
157 if [ -f "$bv" ]; then
158 # yep, that one looks good, so pull in the build defs.
162 # try once more with new school and assume we're deep.
163 bv="$FEISTY_MEOW_DIR/../../scripts/generator/build_variables.sh"
164 if [ -f "$bv" ]; then
165 # sweet, there is something there.
173 # augment the configuration if we found our build variables.
174 if [ $found_build_vars == 1 ]; then
176 # the binary directory contains handy programs we use a lot in yeti. we set up the path to it
177 # here based on the operating system.
178 # note that yeti has recently become more dependent on hoople. hoople was always the source of
179 # the binaries, but now we don't ship them with yeti any more as pre-built items. this reduces
180 # the size of the code package a lot and shortens up our possible exposure to compromised
181 # binaries. people can bootstrap up their own set from hoople now instead.
182 export BINDIR=$FEISTY_MEOW_DIR/production/binaries
184 # add binaries created within build to the path.
185 export PATH="$(dos_to_msys_path $BUILD_TOP/build/bin):$PATH"
187 # Shared libraries are located via this variable.
188 export LD_LIBRARY_PATH="$(dos_to_msys_path $LD_LIBRARY_PATH):$(dos_to_msys_path $BINDIR)"
193 # windoze specific patching up missing things.
195 if [ "$OS" == "Windows_NT" ]; then
196 export HOSTNAME=$(echo $HOSTNAME | tr A-Z a-z)
201 # pull in the custom overrides for feisty_meow scripts. this is done last,
202 # because we want to set everything up as expected, then let the user
203 # override individual variables and definitions.
204 for i in $FEISTY_MEOW_GENERATED/custom/*.sh; do
205 if [ ! -f "$i" ]; then
206 # skip it if it's not real.
209 if [ ! -z "$SHELL_DEBUG" ]; then
210 echo "loading customization: $(basename $(dirname $i))/$(basename $i)"
217 # set the path for locating applications. this is done after any
218 # potential overrides from the user.
219 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:."
223 if [ ! -z "$SHELL_DEBUG" ]; then echo variables initialization ends....; fi