From 8f1a85cd21d35aad6cba6d6929656a112fe002dc Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Sun, 12 Feb 2012 14:06:52 -0500 Subject: [PATCH] updated and cleaned... --- scripts/core/common.alias | 2 +- scripts/core/variables.sh | 75 ++++++++++++++++++++++----------------- 2 files changed, 43 insertions(+), 34 deletions(-) diff --git a/scripts/core/common.alias b/scripts/core/common.alias index 930bbf0b..99c33130 100644 --- a/scripts/core/common.alias +++ b/scripts/core/common.alias @@ -88,7 +88,7 @@ alias play='bash $FEISTY_MEOW_SCRIPTS/multimedia/sound_play.sh' # says goodbye when leaving a shell. alias bye='. $FEISTY_MEOW_SCRIPTS/users/goodbye.sh' # redoes fred's set of custom scripts. -alias recustomize='cpdiff $FEISTY_MEOW_DIR/examples/custom_overrides/fred $FEISTY_MEOW_GENERATED/custom; regenerate' +alias recustomize='echo "copying custom overrides for fred..."; cpdiff $FEISTY_MEOW_DIR/examples/custom_overrides/fred $FEISTY_MEOW_GENERATED/custom; regenerate' # makes root user's home directory's permissions right. alias reroot='chown -R root:root /root' # replace the vi command with a graphical version on windows. diff --git a/scripts/core/variables.sh b/scripts/core/variables.sh index 1faf0d1b..8eebb44f 100644 --- a/scripts/core/variables.sh +++ b/scripts/core/variables.sh @@ -13,48 +13,63 @@ if [ ! -z "$SHELL_DEBUG" ]; then echo variables initialization begins...; fi ############## -# System variables... - # OS variable records the operating system we think we found. if [ -z "$OS" ]; then export OS=UNIX fi export IS_DARWIN=$(echo $OSTYPE | grep -i darwin) -if [ -z "$HOME" ]; then - if [ "$OS" == "Windows_NT" ]; then +############## + +# windoze sometimes needs a special home variable setup. +if [ "$OS" == "Windows_NT" ]; then + # give them a default place if they don't have one already. + if [ -z "$HOME" ]; then export HOME=/c/home - if [ ! -d $HOME ]; then - mkdir $HOME - fi fi + # patch home to undo cygwin style of drive letter. + export HOME=$(echo $HOME | sed -e 's/\/cygdrive\//\//g') + # make the home folder if it doesn't exist yet. + if [ ! -d $HOME ]; then + mkdir $HOME + fi + if [ ! -z "$SHELL_DEBUG" ]; then echo HOME is now $HOME; fi fi ############## -# windoze specific stuff. +# fallbacks to set crucial variables for feisty meow... -# patch home to undo cygwin style of drive letter. -export HOME=$(echo $HOME | sed -e 's/\/cygdrive\//\//g') -#echo HOME is now $HOME +# set the main root directory variable for the feisty meow codebase. +# this is only used for extreme failure modes, when the values were not +# pulled in from our auto-generated config. +if [ -z "$FEISTY_MEOW_DIR" ]; then + if [ -d "$HOME/feisty_meow" ]; then + export FEISTY_MEOW_DIR="$HOME/feisty_meow" + fi +fi -if [ "$OS" == "Windows_NT" ]; then - export HOSTNAME=$(echo $HOSTNAME | tr A-Z a-z) +# similarly, make sure we have someplace to look for our generated files, if +# we were not handed a value. +if [ -z "$FEISTY_MEOW_GENERATED" ]; then + # The generated scripts directory is where automatically generated files live. + # It is separate from the main body of the shell scripts in order to keep things from + # exploding. + export FEISTY_MEOW_GENERATED=$HOME/.zz_auto_gen fi ############## -# ulimit and umask. umask sets a permission mask for all file -# creations. The mask shown here disallows writing by the "group" and -# "others" categories of users. ulimit sets the user limits. the core -# file size is set to zero. +# umask sets a permission mask for all file creations. the mask used here +# disallows writing by the "group" and "others" categories. umask 022 +# ulimit sets user limits. we set the maximum allowed core dump file size +# to zero, because it is obnoxious to see the core dumps from crashed +# programs lying around everywhere. ulimit -c 0 ############## -# Directory variables... - export SCRIPT_SYSTEM=feisty_meow # include helpful functions. @@ -63,13 +78,6 @@ 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 -if [ -z "$FEISTY_MEOW_GENERATED" ]; then - # The generated scripts directory is where automatically generated files live. - # It is separate from the main body of the shell scripts in order to keep things from - # exploding. - export FEISTY_MEOW_GENERATED=$HOME/.zz_auto_gen -fi - ############## # user variables, sort of... if they haven't given themselves a name yet, @@ -134,13 +142,6 @@ if [ -z "$SVN_EDITOR" ]; then fi fi -# include variables needed for compiling hoople and using its scripts. -if [ -z "$FEISTY_MEOW_DIR" ]; then - if [ -d "$HOME/feisty_meow" ]; then - export FEISTY_MEOW_DIR="$HOME/feisty_meow" - fi -fi - # initialize the build variables, if possible. found_build_vars=0 if [ ! -z "$FEISTY_MEOW_DIR" ]; then @@ -189,6 +190,14 @@ fi ############## +# windoze specific patching up missing things. + +if [ "$OS" == "Windows_NT" ]; then + export HOSTNAME=$(echo $HOSTNAME | tr A-Z a-z) +fi + +############## + # pull in the custom overrides for feisty_meow scripts. this is done last, # because we want to set everything up as expected, then let the user # override individual variables and definitions. -- 2.34.1