From 4bb80f419dbc6ea61640b47f9b5982a63b50106f Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Sun, 12 Feb 2012 14:19:02 -0500 Subject: [PATCH] cleaning build variable process up some. --- scripts/core/variables.sh | 91 ++++++++++++++---------------- scripts/schedule/start_calendar.sh | 2 +- 2 files changed, 42 insertions(+), 51 deletions(-) diff --git a/scripts/core/variables.sh b/scripts/core/variables.sh index 8eebb44f..2eb0c6c4 100644 --- a/scripts/core/variables.sh +++ b/scripts/core/variables.sh @@ -13,6 +13,10 @@ if [ ! -z "$SHELL_DEBUG" ]; then echo variables initialization begins...; fi ############## +# start with some simpler things. + +export SCRIPT_SYSTEM=feisty_meow + # OS variable records the operating system we think we found. if [ -z "$OS" ]; then export OS=UNIX @@ -46,6 +50,7 @@ fi if [ -z "$FEISTY_MEOW_DIR" ]; then if [ -d "$HOME/feisty_meow" ]; then export FEISTY_MEOW_DIR="$HOME/feisty_meow" + export FEISTY_MEOW_SCRIPTS="$FEISTY_MEOW_DIR/scripts" fi fi @@ -70,14 +75,9 @@ ulimit -c 0 ############## -export SCRIPT_SYSTEM=feisty_meow - # include helpful functions. source "$FEISTY_MEOW_SCRIPTS/core/functions.sh" -# LIBDIR is an older variable that points at the root of the yeti code. -export LIBDIR=$FEISTY_MEOW_DIR - ############## # user variables, sort of... if they haven't given themselves a name yet, @@ -90,12 +90,13 @@ fi ############## -# other variables... - # sets the main prompt to a simple default, with user@host. export PS1='\u@\h $ '; +############## + # variables for perl. + export PERLLIB if [ "$OS" != "Windows_NT" ]; then PERLLIB+="/usr/lib/perl5" @@ -118,8 +119,10 @@ for i in $FEISTY_MEOW_SCRIPTS/*; do done #echo PERLLIB is now $PERLLIB +############## + # set this so nechung can find its data. -export NECHUNG=$LIBDIR/database/fortunes.dat +export NECHUNG=$FEISTY_MEOW_DIR/database/fortunes.dat # ensure we use the right kind of rsh for security. export CVS_RSH=ssh @@ -142,51 +145,39 @@ if [ -z "$SVN_EDITOR" ]; then fi fi -# initialize the build variables, if possible. -found_build_vars=0 -if [ ! -z "$FEISTY_MEOW_DIR" ]; then - # first guess at using the old school bin directory. - bv="$FEISTY_MEOW_DIR/bin/build_variables.sh" - if [ -f "$bv" ]; then - # the old bin directory is present, so let's use its build vars. - source "$bv" "$bv" +# initializes the feisty meow build variables, if possible. +function initialize_build_variables() +{ + found_build_vars=0 + # we need to know the feisty meow directory, or we bail. + if [ -z "$FEISTY_MEOW_DIR" ]; then return; fi + # pick from our expected generator folder, but make sure it's there... + buildvars="$FEISTY_MEOW_DIR/scripts/generator/build_variables.sh" + if [ -f "$buildvars" ]; then + # yep, that one looks good, so pull in the build defs. + source "$buildvars" "$buildvars" found_build_vars=1 - else - # try again with the new school location for the file. - bv="$FEISTY_MEOW_DIR/scripts/generator/build_variables.sh" - if [ -f "$bv" ]; then - # yep, that one looks good, so pull in the build defs. - source "$bv" "$bv" - found_build_vars=1 - else - # try once more with new school and assume we're deep. - bv="$FEISTY_MEOW_DIR/../../scripts/generator/build_variables.sh" - if [ -f "$bv" ]; then - # sweet, there is something there. - source "$bv" "$bv" - found_build_vars=1 - fi - fi fi -fi - -# augment the configuration if we found our build variables. -if [ $found_build_vars == 1 ]; then - - # the binary directory contains handy programs we use a lot in yeti. we set up the path to it - # here based on the operating system. - # note that yeti has recently become more dependent on hoople. hoople was always the source of - # the binaries, but now we don't ship them with yeti any more as pre-built items. this reduces - # the size of the code package a lot and shortens up our possible exposure to compromised - # binaries. people can bootstrap up their own set from hoople now instead. - export BINDIR=$FEISTY_MEOW_DIR/production/binaries - - # add binaries created within build to the path. - export PATH="$(dos_to_msys_path $BUILD_TOP/build/bin):$PATH" + # now augment the environment if we found our build variables. + if [ $found_build_vars == 1 ]; then + # the binary directory contains handy programs we use a lot in yeti. we set up the path to it + # here based on the operating system. + # note that yeti has recently become more dependent on hoople. hoople was always the source of + # the binaries, but now we don't ship them with yeti any more as pre-built items. this reduces + # the size of the code package a lot and shortens up our possible exposure to compromised + # binaries. people can bootstrap up their own set from hoople now instead. + export BINDIR=$FEISTY_MEOW_DIR/production/binaries + + # add binaries created within build to the path. + export PATH="$(dos_to_msys_path $BUILD_TOP/build/bin):$PATH" + + # Shared libraries are located via this variable. + export LD_LIBRARY_PATH="$(dos_to_msys_path $LD_LIBRARY_PATH):$(dos_to_msys_path $BINDIR)" + fi +} - # Shared libraries are located via this variable. - export LD_LIBRARY_PATH="$(dos_to_msys_path $LD_LIBRARY_PATH):$(dos_to_msys_path $BINDIR)" -fi +# load in the build environment. +initialize_build_variables ############## diff --git a/scripts/schedule/start_calendar.sh b/scripts/schedule/start_calendar.sh index cd263b90..1a3a0db3 100644 --- a/scripts/schedule/start_calendar.sh +++ b/scripts/schedule/start_calendar.sh @@ -1,4 +1,4 @@ #!/bin/bash perl $FEISTY_MEOW_SCRIPTS/schedule/generate_reminders.pl -echo '(export LIBDIR=$LIBDIR; bash $FEISTY_MEOW_SCRIPTS/schedule/start_calendar.sh) &>/dev/null' | at 4:20am +echo '(bash $FEISTY_MEOW_SCRIPTS/schedule/start_calendar.sh) &>/dev/null' | at 4:20am -- 2.34.1