hudson build: updates for publish
diff --git a/publish.sh b/publish.sh
index 09097ab..b34079b 100644
--- a/publish.sh
+++ b/publish.sh
@@ -14,73 +14,35 @@
 #
 
 #Define common variables
-THIS=$0
 ARG1=$1
-PROGNAME=`basename ${THIS}`
-CUR_DIR=`dirname ${THIS}`
 umask 0002
 ANT_ARGS=" "
 ANT_OPTS="-Xmx512m"
 START_DATE=`date '+%y%m%d-%H%M'`
 
 #Directories
-JAVA_HOME=/shared/common/jdk-1.6.x86_64
 ANT_HOME=/shared/common/apache-ant-1.7.0
 HOME_DIR=/shared/rt/eclipselink
+JAVA_HOME=/shared/common/jdk-1.6.x86_64
 LOG_DIR=${HOME_DIR}/logs
 
+#Files
+ant.buildfile=
+
+# Need to export after parsing:
+# BLD_DEPS_DIR
+BRANCH
+GITHASH
+BLDDATE
+handoff
+
 PATH=${JAVA_HOME}/bin:${ANT_HOME}/bin:/usr/bin:/usr/local/bin:${PATH}
 
 # Export necessary global environment variables
-export ANT_ARGS ANT_OPTS ANT_HOME HOME_DIR JAVA_HOME JUNIT_HOME LOG_DIR PATH BLD_DEPS_DIR JUNIT_HOME
+export ANT_ARGS ANT_OPTS ANT_HOME HOME_DIR JAVA_HOME LOG_DIR PATH
 #==========================
 #   Functions Definitions
 #
-unset Usage
-Usage() {
-    echo "ERROR: Invalid usage detected!"
-    echo "USAGE: ./${PROGNAME} [\> LOGFILE 2\>\&1]"
-}
-
-unset CreatePath
-CreatePath() {
-    #echo "Running CreateHome!"
-    newdir=
-    for directory in `echo $1 | tr '/' ' '`
-    do
-        newdir=${newdir}/${directory}
-        if [ ! -d "/${newdir}" ] ; then
-            #echo "creating ${newdir}"
-            mkdir ${newdir}
-            if [ $? -ne 0 ]
-            then
-                echo "    Create failed!"
-                exit
-            fi
-        fi
-    done
-}
-
-unset genSafeTmpDir
-genSafeTmpDir() {
-    tmp=${TMPDIR-/tmp}
-    tmp=$tmp/somedir.$RANDOM.$RANDOM.$RANDOM.$$
-    (umask 077 && mkdir $tmp) || {
-      echo "Could not create temporary directory! Exiting." 1>&2
-      exit 1
-    }
-    echo "results stored in: '${tmp}'"
-}
-
-unset getHandoff
-getHandoff() {
-    curdir=`pwd`
-    cd $HOME_DIR
-
-    handoff=`ls handoff-file*.dat | grep -m1 *`
-
-}
-
 unset parseHandoff
 parseHandoff() {
     handoff_file=$1
@@ -114,7 +76,7 @@
         exit 2
     fi
     if [ "${DEBUG}" = "true" ] ; then
-        echo "BRANCH='${BRANCH}' QUALIFIER='${QUALIFIER}' PROC='${PROC}'"
+        echo "BRANCH='${BRANCH}' QUALIFIER='${QUALIFIER}' PROC='${PROC}' HOST='${HOST}' BUILD_ARCHIVE_LOC='${BUILD_ARCHIVE_LOC}'"
     fi
 }
 
@@ -124,28 +86,29 @@
     BRANCH=$1
     QUALIFIER=$2
     PROC=$3
+    HOST=$4
+    BUILD_ARCHIVE_LOC=$5
 
     if [ ! "${BRANCH}" = "master" ] ; then
-        BRANCH=${BRANCH}
-        BRANCH=branches/${BRANCH}/
+        # Need to figure out version
     else
-        BRANCH_NM="trunk"
-        BRANCH=
+        $Need to figure out version
+        BRANCH=$Version
     fi
 
     #Directories
-    BRANCH_PATH=${WORKSPACE}
-    BLD_DEPS_DIR=${HOME_DIR}/bld_deps/${BRANCH_NM}
-    JUNIT_HOME=${BLD_DEPS_DIR}/junit
+#    BRANCH_PATH=${WORKSPACE}
+#    BLD_DEPS_DIR=${HOME_DIR}/bld_deps/${BRANCH}
+#    JUNIT_HOME=${BLD_DEPS_DIR}/junit
 
     #Files
-    JDBC_LOGIN_INFO_FILE=${HOME_DIR}/db-${BRANCH_NM}.dat
+#    JDBC_LOGIN_INFO_FILE=${HOME_DIR}/db-${BRANCH_NM}.dat
     LOGFILE_NAME=bsb-${BRANCH_NM}_pub${PROC}_${START_DATE}.log
     DATED_LOG=${LOG_DIR}/${LOGFILE_NAME}
 
     # Define build dependency paths (build needs em, NOT compile dependencies)
-    OLD_CLASSPATH=${CLASSPATH}
-    CLASSPATH=${JUNIT_HOME}/junit.jar:${ANT_HOME}/lib/ant-junit.jar
+#    OLD_CLASSPATH=${CLASSPATH}
+#   CLASSPATH=${JUNIT_HOME}/junit.jar:${ANT_HOME}/lib/ant-junit.jar
 
     # Export run specific variables
     export BLD_DEPS_DIR BRANCH_NM BRANCH_PATH CLASSPATH JUNIT_HOME TARGET
@@ -165,7 +128,7 @@
     fi
 
     # Setup parameters for Ant build
-    ANT_BASEARG="-f \"${BOOTSTRAP_BLDFILE}\" -Dbranch.name=\"${BRANCH}\" ${ANT_BASEARG} -Dgit.hash=${GITHASH}"
+    ANT_BASEARG="-f \"${ant.buildfile}\" -Dbranch.name=\"${BRANCH}\" -Dgit.hash=${GITHASH}"
     ANT_BASEARG="${ANT_BASEARG} -Dbuild.date=${BLDDATE} -Dhandoff.file=${handoff}"
 
     cd ${HOME_DIR}
@@ -185,27 +148,14 @@
     echo "Publish complete."
 }
 
-unset postProcess
-postProcess() {
-    #genSafeTmpDir
-    echo "PostProcessing..."
-    echo "   Generating notification for ${PROC} publishing for ${BRANCH} build ${QUALIFIER}..."
-    echo "   Not sent..."
-    # cleanup
-    #rm -r ${tmp}
-    echo "Done."
-}
-
 #==========================
 #   Main Begins
 #
 #==========================
 #  If anything is in ARG1 then do a dummy "DEBUG"
 #  run (Don't call ant, don't remove handoff, do report variable states
-if [ -z "$ARG1" ] ; then
-    DEBUG=false
-    echo "Debug is off!"
-else
+DEBUG=false
+if [ -n "$ARG1" ] ; then
     DEBUG=true
     echo "Debug is on!"
 fi
@@ -219,7 +169,7 @@
     echo "Detected handoff file:'${handoff}'. Process starting..."
     # Do stuff
     parseHandoff ${handoff}
-    echo "runAnt ${BRANCH} ${QUALIFIER} ${PROC} ${BUILD_ARCHIVE_LOC}"
-    postProcess
+    runAnt ${BRANCH} ${QUALIFIER} ${PROC} ${BUILD_ARCHIVE_LOC} ${HOST}
+    echo "Done."
 done