6 # Defines the environment variables used by the personalized unix
8 # Author: Chris Koeritz
12 # we'll run this again only if we think it's needed.
13 if [ -z "$NECHUNG" ]; then
15 if [ ! -z "$SHELL_DEBUG" ]; then echo variables initialization begins...; fi
19 # start with some simpler things.
21 export SCRIPT_SYSTEM=feisty_meow
23 # OS variable records the operating system we think we found.
27 export IS_DARWIN=$(echo $OSTYPE | grep -i darwin)
31 # fallbacks to set crucial variables for feisty meow...
33 # set the main root directory variable for the feisty meow codebase.
34 # this is only used for extreme failure modes, when the values were not
35 # pulled in from our auto-generated config.
36 if [ -z "$FEISTY_MEOW_DIR" ]; then
37 if [ -d "$HOME/feisty_meow" ]; then
38 export FEISTY_MEOW_DIR="$HOME/feisty_meow"
39 export FEISTY_MEOW_SCRIPTS="$FEISTY_MEOW_DIR/scripts"
43 # similarly, make sure we have someplace to look for our generated files, if
44 # we were not handed a value.
45 if [ -z "$FEISTY_MEOW_GENERATED" ]; then
46 # The generated scripts directory is where automatically generated files live.
47 # It is separate from the main body of the shell scripts in order to keep things from
49 export FEISTY_MEOW_GENERATED=$HOME/.zz_auto_gen
54 # umask sets a permission mask for all file creations. the mask used here
55 # disallows writing by the "group" and "others" categories.
57 # ulimit sets user limits. we set the maximum allowed core dump file size
58 # to zero, because it is obnoxious to see the core dumps from crashed
59 # programs lying around everywhere.
64 # include helpful functions.
65 source "$FEISTY_MEOW_SCRIPTS/core/functions.sh"
69 # user variables, sort of... if they haven't given themselves a name yet,
70 # then we will make one up for them.
72 # define a default name, if one wasn't already set.
73 if [ -z "$NAME" ]; then
74 export NAME='Unset Q. Namington, Fixley Your Name III'
79 # sets the main prompt to a simple default, with user@host.
80 export PS1='\u@\h $ ';
87 if [ "$OS" != "Windows_NT" ]; then
88 PERLLIB+="/usr/lib/perl5"
91 # choose perl's IO over the ms-windows version so we can handle file
95 # iterate across our sub-directories and find the perl scripts.
96 # this currently only looks one level down.
97 for i in $FEISTY_MEOW_SCRIPTS/*; do
99 # check if there is a perl file present; add the folder to PERLLIB if so.
100 ls $i/*.pl &>/dev/null
101 if [ $? -eq 0 ]; then
106 #echo PERLLIB is now $PERLLIB
110 # set this so nechung can find its data.
111 export NECHUNG=$FEISTY_MEOW_DIR/database/fortunes.dat
113 # ensure we use the right kind of rsh for security.
116 # sets the history length and max file size so we can get some long history around here.
120 # the base checkout list is just to update feisty_meow. additional folder
121 # names can be added in your customized scripts.
122 export REPOSITORY_LIST="feisty_meow"
124 # set the editor for subversion if it hasn't already been set.
125 if [ -z "$SVN_EDITOR" ]; then
126 #hmmm: not sure what original reason for having these different was...
127 if [ "$OS" == "Windows_NT" ]; then
128 export SVN_EDITOR=$(which gvim)
130 export SVN_EDITOR=$(which vi)
134 # initializes the feisty meow build variables, if possible.
135 function initialize_build_variables()
138 # we need to know the feisty meow directory, or we bail.
139 if [ -z "$FEISTY_MEOW_DIR" ]; then return; fi
140 # pick from our expected generator folder, but make sure it's there...
141 buildvars="$FEISTY_MEOW_DIR/scripts/generator/build_variables.sh"
142 if [ -f "$buildvars" ]; then
143 # yep, that one looks good, so pull in the build defs.
144 source "$buildvars" "$buildvars"
147 # now augment the environment if we found our build variables.
148 if [ $found_build_vars == 1 ]; then
149 # the binary directory contains handy programs we use a lot in yeti. we set up the path to it
150 # here based on the operating system.
151 # note that yeti has recently become more dependent on hoople. hoople was always the source of
152 # the binaries, but now we don't ship them with yeti any more as pre-built items. this reduces
153 # the size of the code package a lot and shortens up our possible exposure to compromised
154 # binaries. people can bootstrap up their own set from hoople now instead.
155 export BINDIR=$FEISTY_MEOW_DIR/production/binaries
157 # add binaries created within build to the path.
158 # export PATH="$(dos_to_msys_path $BUILD_TOP/build/bin):$PATH"
159 export 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)"
163 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$BINDIR"
167 # load in the build environment.
168 initialize_build_variables
172 # windoze specific patching up missing things.
174 if [ "$OS" == "Windows_NT" ]; then
175 export HOSTNAME=$(echo $HOSTNAME | tr A-Z a-z)
180 # pull in the custom overrides for feisty_meow scripts. this is done last,
181 # because we want to set everything up as expected, then let the user
182 # override individual variables and definitions.
183 for i in $FEISTY_MEOW_GENERATED/custom/*.sh; do
184 if [ ! -f "$i" ]; then
185 # skip it if it's not real.
188 if [ ! -z "$SHELL_DEBUG" ]; then
189 echo "loading customization: $(basename $(dirname $i))/$(basename $i)"
196 # set the path for locating applications. this is done after any
197 # potential overrides from the user.
198 #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:."
199 export PATH="$BINDIR:$FEISTY_MEOW_GENERATED:$PATH:/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/lib:/usr/games:/usr/bin:."
203 if [ ! -z "$SHELL_DEBUG" ]; then echo variables initialization ends....; fi
206 # we are seeing this lot again, we believe, so make things easier for the
207 # rest of initialization.
208 export LIGHTWEIGHT_INIT=true
209 if [ ! -z "$SHELL_DEBUG" ]; then
210 echo skipped var init and put in lightweight mode due to belief in previous existence.;