[svn-commits] r195 - in main: . buildtools

thich01 at ingres.com thich01 at ingres.com
Fri Aug 22 12:14:30 PDT 2008


Author: thich01
Date: 2008-08-22 12:14:29 -0700 (Fri, 22 Aug 2008)
New Revision: 195

Modified:
   main/buildtools/buildAndTest.sh
   main/buildtools/cleanbuild.sh
   main/buildtools/root_setup.sh
   main/buildtools/runtest.sh
   main/runbuild.sh
Log:
#245 - Add the command line arguments.  Clean up other scripts so they run properly from the new buildtools location.

Modified: main/buildtools/buildAndTest.sh
===================================================================
--- main/buildtools/buildAndTest.sh	2008-08-18 20:18:21 UTC (rev 194)
+++ main/buildtools/buildAndTest.sh	2008-08-22 19:14:29 UTC (rev 195)
@@ -13,6 +13,13 @@
 #
 # Supported platforms: Linux.
 
+function usage()
+{
+    echo "Usage: buildAndTest.sh installation_code"
+    trap - 0
+    exit 1
+}
+
 echo "Checking effective userid...."
 echo ""
 export WHOAMI=`whoami`
@@ -42,6 +49,24 @@
 
 export II_INSTALLATION
 
+# we should set BUILDTOOLS so we know where the other tools are
+PWD=`pwd`
+if [ -z ${BUILDTOOLS} ]
+then
+  if [ -d ./buildtools ]
+  then
+    BUILDTOOLS="${PWD}/buildtools"
+    export BUILDTOOLS
+  else
+    echo "Error: I'm sorry, I can't find the buildtools directory"
+    echo "There are tools that I need from there."
+    echo "Please re-source set_env.sh from the root of the source tree."
+    echo "This is where README.txt and runbuild.sh are stored."
+    echo "I cannot continue."
+    return
+  fi
+fi
+
 # This script should be run from $ING_ROOT at this time.
 export ING_ROOT=`pwd`
 
@@ -61,7 +86,7 @@
 # Verify the existance of the task specific scripts.
 echo "Verifying existance of required tools."
 echo ""
-for fileName in $ING_ROOT/cleanbuild.sh $ING_ROOT/runbuild.sh $ING_ROOT/createdbms $ING_ROOT/root_setup.sh $ING_ROOT/runtest.sh $ING_ROOT/test_env.sh $ING_ROOT/set_env.sh $ING_ROOT/clear_env.sh
+for fileName in $BUILDTOOLS/cleanbuild.sh $ING_ROOT/runbuild.sh $BUILDTOOLS/createdbms $BUILDTOOLS/root_setup.sh $BUILDTOOLS/runtest.sh $BUILDTOOLS/test_env.sh $BUILDTOOLS/set_env.sh $BUILDTOOLS/clear_env.sh
 do
     if [ ! -f $fileName ]
     then
@@ -90,7 +115,7 @@
 # use set_env.sh to set OSVER - that way the test for whether the OS is
 # Debian-based remains in one place should it need to change
 
-source set_env.sh
+source $BUILDTOOLS/set_env.sh
 if [ "$OSVER" == "DEBIAN" ]
 then
   echo testenv:ca-testenv | chpasswd
@@ -106,7 +131,7 @@
 # Clean up all the old artifacts so they aren't used for testing.
 echo "Clean up all old build artifacts."
 echo ""
-su $OLD_USER -c $ING_ROOT/cleanbuild.sh
+su $OLD_USER -c $BUILDTOOLS/cleanbuild.sh
 
 # Change all files to ingres ownership.
 echo "Change ownership of files to ingres user to enable testing."
@@ -120,25 +145,25 @@
 
 # Create a mini script to install the database and copy the test suites.
 # This mini script is executed as ingres and removed on completion.
-echo $ING_ROOT/createdbms $II_INSTALLATION > $ING_ROOT/tmpCmd
+echo $BUILDTOOLS/createdbms $II_INSTALLATION > $ING_ROOT/tmpCmd
 echo "cp -r $TST_LOC $ING_ROOT/install/$II_INSTALLATION/tst" >> $ING_ROOT/tmpCmd
 chmod 777 $ING_ROOT/tmpCmd
 su ingres -c $ING_ROOT/tmpCmd
 rm $ING_ROOT/tmpCmd
 
 # Complete root only setup for the installation
-$ING_ROOT/root_setup.sh $II_INSTALLATION
+$BUILDTOOLS/root_setup.sh $II_INSTALLATION
 
 # Create a mini script to run the test suite.  This is executed as testenv
 # and removed on completion.
-echo $ING_ROOT/runtest.sh $II_INSTALLATION > $ING_ROOT/tstTmpCmd
+echo $BUILDTOOLS/runtest.sh $II_INSTALLATION > $ING_ROOT/tstTmpCmd
 chmod 777 $ING_ROOT/tstTmpCmd
 su testenv -c $ING_ROOT/tstTmpCmd
 rm $ING_ROOT/tstTmpCmd
 
 # Create a mini script to shutdown the running instance.  This is executed as
 # ingres and removed on completion.
-echo . $ING_ROOT/test_env.sh $II_INSTALLATION > $ING_ROOT/tmpStopCmd
+echo . $BUILDTOOLS/test_env.sh $II_INSTALLATION > $ING_ROOT/tmpStopCmd
 echo ingstop >> $ING_ROOT/tmpStopCmd
 chmod 777 $ING_ROOT/tmpStopCmd
 su ingres -m -c $ING_ROOT/tmpStopCmd

Modified: main/buildtools/cleanbuild.sh
===================================================================
--- main/buildtools/cleanbuild.sh	2008-08-18 20:18:21 UTC (rev 194)
+++ main/buildtools/cleanbuild.sh	2008-08-22 19:14:29 UTC (rev 195)
@@ -4,10 +4,27 @@
 # return a work area to the state it would be immediately after an svn co, or
 # as close as possible.
 
+# we should set BUILDTOOLS so we know where the other tools are
+PWD=`pwd`
+if [ -z ${BUILDTOOLS} ]
+then
+  if [ -d ./buildtools ]
+  then
+    BUILDTOOLS="${PWD}/buildtools"
+    export BUILDTOOLS
+  else
+    echo "Error: I'm sorry, I can't find the buildtools directory"
+    echo "There are tools that I need from there."
+    echo "Please re-source set_env.sh from the root of the source tree."
+    echo "This is where README.txt and runbuild.sh are stored."
+    echo "I cannot continue."
+    return
+  fi
+fi
 # if we're starting fresh, set up the environment
-if [ -f set_env.sh ]
+if [ -f ${BUILDTOOLS}/set_env.sh ]
 then
-  . ./set_env.sh
+  . $BUILDTOOLS/set_env.sh
 else
   echo "Error, I cannot find the set_env.sh script"
   echo "This is required to use cleanbuild.sh"

Modified: main/buildtools/root_setup.sh
===================================================================
--- main/buildtools/root_setup.sh	2008-08-18 20:18:21 UTC (rev 194)
+++ main/buildtools/root_setup.sh	2008-08-22 19:14:29 UTC (rev 195)
@@ -11,7 +11,6 @@
     exit 1
 }
 
-
 # we should set BUILDTOOLS so we know where the other tools are
 PWD=`pwd`
 if [ -z ${BUILDTOOLS} ]

Modified: main/buildtools/runtest.sh
===================================================================
--- main/buildtools/runtest.sh	2008-08-18 20:18:21 UTC (rev 194)
+++ main/buildtools/runtest.sh	2008-08-22 19:14:29 UTC (rev 195)
@@ -38,9 +38,27 @@
 
 export II_INSTALLATION
 
-if [ -f test_env.sh ]
+# we should set BUILDTOOLS so we know where the other tools are
+PWD=`pwd`
+if [ -z ${BUILDTOOLS} ]
 then
-    . ./test_env.sh $II_INSTALLATION
+  if [ -d ./buildtools ]
+  then 
+    BUILDTOOLS="${PWD}/buildtools"
+    export BUILDTOOLS
+  else
+    echo "Error: I'm sorry, I can't find the buildtools directory"
+    echo "There are tools that I need from there."
+    echo "Please re-source set_env.sh from the root of the source tree."
+    echo "This is where README.txt and runbuild.sh are stored."
+    echo "I cannot continue."
+    return
+  fi
+fi
+
+if [ -f ${BUILDTOOLS}/test_env.sh ]
+then
+    . $BUILDTOOLS/test_env.sh $II_INSTALLATION
 else
     echo "Error, test_env.sh script not found."
     echo "This is required to use root_setup.sh"

Modified: main/runbuild.sh
===================================================================
--- main/runbuild.sh	2008-08-18 20:18:21 UTC (rev 194)
+++ main/runbuild.sh	2008-08-22 19:14:29 UTC (rev 195)
@@ -14,7 +14,34 @@
 PWD=`pwd`
 LOGDIR="${PWD}/logs"
 LOGFILE="${LOGDIR}/jam_${NOW}.log"
+DEBUGOPT=""
+REBUILDOPT=""
+CLEANOPT=""
 
+function usage()
+{
+  cat <<STOP
+Usage: -a to force a rebuild (i.e. jam -a)
+       -c to clean a build (i.e. jam clean)
+       -g to compile with extra debugging information
+       -h for this help text.
+STOP
+}
+
+while getopts "acgh" options; do
+  case $options in
+     a ) REBUILDOPT="-a";;
+     c ) CLEANOPT="clean";;
+     g ) DEBUGOPT="-sIIOPTIM=-g";;
+     h ) usage
+       exit 1;;
+    \? ) usage
+       exit 1;;
+     * ) usage
+       exit 1;;
+  esac
+done
+
 # Check to see where the rest of the build tools are
 if [ -d ./buildtools ]
 then
@@ -41,6 +68,16 @@
   exit 1
 fi
 
+if [ $CLEANOPT ]
+then
+  cd $ING_SRC
+  date > ${LOGFILE}
+  jam $CLEANOPT >> ${LOGFILE} 2>&1
+  echo "Clean complete."
+  echo "Logs are in: ${LOGFILE}"
+  exit 0
+fi
+
 date > ${LOGFILE}
 echo " "
 echo "Starting Ingres build."
@@ -53,7 +90,7 @@
 echo "RESULTS:"
 cd $ING_ROOT/src/tools/port/jam/; jam >> ${LOGFILE} 2>&1
 cd $ING_SRC; mkjams >> ${LOGFILE} 2>&1 
-jam >> ${LOGFILE} 2>&1
+jam $REBUILDOPT $DEBUGOPT >> ${LOGFILE} 2>&1
 
 # Check if the build succeeded or failed by the presence of
 # skipped or failed targets




More information about the svn-commits mailing list