rumblings of change; got custom scripts sorted, improved approach to
authorChris Koeritz <fred@gruntose.com>
Wed, 25 Jan 2012 07:21:20 +0000 (02:21 -0500)
committerChris Koeritz <fred@gruntose.com>
Wed, 25 Jan 2012 07:21:20 +0000 (02:21 -0500)
loading them, found a new name for core which i need to move to.  so now
i get to see how well git can move a hierarchy.

makefile
scripts/core/variables.sh
scripts/custom/examples/fred/java_profile.sh [new file with mode: 0644]
scripts/custom/examples/fred/mac_profile_additions.txt [deleted file]
scripts/custom/examples/fred/uva_profile_additions.txt [deleted file]
scripts/custom/examples/readme.txt

index 1162976acf31a2806483d48955599fa91f617bd3..d775b5abd96ab746ac7629357bcc5762ff40456d 100644 (file)
--- a/makefile
+++ b/makefile
@@ -1,7 +1,7 @@
 include variables.def
 
 PROJECT = feisty_meow_sources
 include variables.def
 
 PROJECT = feisty_meow_sources
-BUILD_BEFORE = start_make core scripts octopi graphiq production end_make
+BUILD_BEFORE = start_make nucleus scripts octopi graphiq production end_make
 
 include rules.def
 
 
 include rules.def
 
index 16574ec5eb03f53b595a554f61c1b586b521a9fc..07e03ee65d0d8d6314fa42e1cdd81faf01206b0c 100644 (file)
@@ -62,10 +62,11 @@ fi
 # other variables...
 ##############################################################################
 
 # other variables...
 ##############################################################################
 
-# pull in the custom variable overrides for bash.
-if [ -f "$YETI_SCRIPTS/custom/c_variables.sh" ]; then
-  source "$YETI_SCRIPTS/custom/c_variables.sh"
-fi
+# pull in the custom overrides for feisty_meow scripts.
+for i in $YETI_SCRIPTS/custom/*.sh; do
+  echo "Sourcing custom file: $i"
+  source $i
+done
 
 # sets the prompts to what we (i.e., i) like...
 # there are four different prompts.  the first one, PS1, is the one that users
 
 # sets the prompts to what we (i.e., i) like...
 # there are four different prompts.  the first one, PS1, is the one that users
diff --git a/scripts/custom/examples/fred/java_profile.sh b/scripts/custom/examples/fred/java_profile.sh
new file mode 100644 (file)
index 0000000..7186b44
--- /dev/null
@@ -0,0 +1,100 @@
+#!/bin/bash
+# this script tries to intuit where java is installed on this machine.
+
+############################
+
+function intuition_failure()
+{
+  missing="$1"; shift
+  echo "We cannot intuit your $missing variable for this host."
+  # remove the variable because its value is busted.
+  unset $missing
+}
+
+############################
+
+# set some fairly liberal limits for ant.
+export ANT_OPTS="-Xms512m -Xmx768m -XX:MaxPermSize=768m"
+
+############################
+
+# start guessing some settings...
+
+# this bin portion works for most javas...
+export JAVA_BIN_PIECE=bin
+
+if [ ! -d "$JAVA_HOME" ]; then
+  # first try a recent linux version.
+  export JAVA_HOME=/usr/lib/jvm/java-6-sun/jre
+fi
+if [ ! -d "$JAVA_HOME" ]; then
+  # try using a windows version.
+#note: this logic is untested.
+# probably will break due to space in path issues.
+  declare -a any_there=$(find "/c/Program Files/java" -type d -iname "jdk" 2>/dev/null)
+  if [ ${#any_there[*]} -gt 0 ]; then
+    (( last = ${#any_there[@]} - 1 ))
+    JAVA_HOME="${any_there[$last]}"
+  fi
+  if [ ! -d "$JAVA_HOME" ]; then
+    # if no jdk, try a jre.
+    declare -a any_there=$(find "/c/Program Files/java" -type d -iname "jre" 2>/dev/null)
+    if [ ${#any_there[*]} -gt 0 ]; then
+      (( last = ${#any_there[@]} - 1 ))
+      JAVA_HOME="${any_there[$last]}"
+    fi
+  fi
+fi
+# this should go last, since it changes the bin dir.
+if [ ! -d "$JAVA_HOME" ]; then
+  # if that didn't work, try the location for mac os x.
+  JAVA_HOME=/Library/Java/Home
+  JAVA_BIN_PIECE=Commands
+fi
+# last thing is to tell them we couldn't find it.
+if [ ! -d "$JAVA_HOME" ]; then
+  intuition_failure JAVA_HOME
+  unset JAVA_BIN_PIECE
+fi
+
+############################
+
+# intuit where we have our local eclipse.
+if [ ! -d "$ECLIPSE_DIR" ]; then
+  export ECLIPSE_DIR=/usr/local/eclipse_jee
+fi
+if [ ! -d "$ECLIPSE_DIR" ]; then
+  ECLIPSE_DIR=$HOME/eclipse
+fi
+if [ ! -d "$ECLIPSE_DIR" ]; then
+  ECLIPSE_DIR=$HOME/apps/eclipse
+fi
+if [ ! -d "$ECLIPSE_DIR" ]; then
+#uhhh, default on winders?
+  ECLIPSE_DIR="/c/Program Files/eclipse"
+fi
+if [ ! -d "$ECLIPSE_DIR" ]; then
+  ECLIPSE_DIR="/c/tools/eclipse"
+fi
+if [ ! -d "$ECLIPSE_DIR" ]; then
+  ECLIPSE_DIR="/d/tools/eclipse"
+fi
+if [ ! -d "$ECLIPSE_DIR" ]; then
+  ECLIPSE_DIR="/e/tools/eclipse"
+fi
+# final option is to whine.
+if [ ! -d "$ECLIPSE_DIR" ]; then intuition_failure ECLIPSE_DIR; fi
+
+############################
+
+# use the variables we just set in our path, and try to make them override
+# any other paths to different versions.
+
+if [ ! -z "$JAVA_HOME" ]; then
+  export PATH=$JAVA_HOME/$JAVA_BIN_PIECE:$PATH
+fi
+if [ ! -z "$ECLIPSE_DIR" ]; then
+  export PATH=$ECLIPSE_DIR:$PATH
+fi
+
+
diff --git a/scripts/custom/examples/fred/mac_profile_additions.txt b/scripts/custom/examples/fred/mac_profile_additions.txt
deleted file mode 100644 (file)
index cb59c2a..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-# added this after the bashrc setup stuff for feisty_meow scripts...
-
-# extras for uva
-export JAVA_HOME=/Library/Java/Home
-export PATH=$PATH:$JAVA_HOME/Commands
-
-# ant options to get the wsdl files to all build properly.
-export ANT_OPTS="-Xms512m -Xmx768m -XX:MaxPermSize=768m"
-
diff --git a/scripts/custom/examples/fred/uva_profile_additions.txt b/scripts/custom/examples/fred/uva_profile_additions.txt
deleted file mode 100644 (file)
index ed1bde7..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-
-# added this after the bashrc setup stuff for feisty_meow...
-
-# extras for uva
-export JAVA_HOME=/usr/lib/jvm/java-6-sun/jre
-
-# ant options to get the wsdl files to all build properly.
-export ANT_OPTS="-Xms512m -Xmx768m -XX:MaxPermSize=768m"
-
-# where we have our local eclipse.
-export ECLIPSE_DIR=/usr/local/eclipse_jee
-
-# add in the places we'd like in the path.
-# java and eclipse go first to override any other installed versions.
-export PATH=$JAVA_HOME/bin:$ECLIPSE_DIR:$PATH
-
index cf04e876633119688b74019a728aeebcb79a7617..e8e14a5cf88b68163aee408c5db099ed4487ad53 100644 (file)
@@ -3,8 +3,11 @@
 this folder has some examples of how various people (or one person right now)
 do their custom scripts.
 
 this folder has some examples of how various people (or one person right now)
 do their custom scripts.
 
-the scripts should have the same name as the main yeti script's corresponding
-name, but with a "c_" in front.
+the scripts often have the same name as the main script's name, but with
+a "c_" in front.  ones understood currently are:
+  c_common_aliases.txt
+  c_sh_aliases.txt
+  c_variables.sh
 
 when you have some custom scripts you want to use, copy them from your own
 folder to the scripts/custom directory.  be careful though, because these
 
 when you have some custom scripts you want to use, copy them from your own
 folder to the scripts/custom directory.  be careful though, because these