#!/bin/sh # snapshot: Snap shot testing command script for HDF4. # This script should be run nightly from cron. It checks out hdf4 # from the CVS source tree and compares it against the previous # snapshot. If anything significant changed, it is build and tested. # After the test passes and if snapshot release is desired, a new snapshot # is created, the minor version number is incremented, and the change is # checked back into the CVS repository. # function definitions TIMESTAMP() { echo "=====" "$1": "`date`" "=====" } EXIT_BANNER() { TIMESTAMP "Exit $PROGNAME with status=$?" } # MAIN # SGI /bin/sh replaces $0 as function name if used in a function. # Set the name here to avoid that ambiguity and better style too. PROGNAME=$0 echo "=====================================" echo "$PROGNAME $*" echo "=====================================" TIMESTAMP MAIN uname -a # setup exit banner message trap EXIT_BANNER 0 # The path isn't properly initialized on hawkwind -- /usr/local/bin is # either missing or is after /usr/bin when it should be before. PATH="/usr/local/bin:$PATH" # Where are the snapshots stored? ARCHIVES_default=/afs/ncsa/ftp/HDF/pub/outgoing/hdf4/snapshots ARCHIVES=$ARCHIVES_default # Where is the zlib library? # At NCSA, half of the machines have it in /usr/lib, the other half at # /usr/ncsa/lib. Leave it unset. ZLIB_default= ZLIB=$ZLIB_default # What compression methods to use? METHODS="gzip bzip2" # Hard set to gmake. # No parallel make (-j) because dependences are not set correctly for it. # Must use gmake for --srcdir support. MAKE=gmake export MAKE # # Command options cmd="all" test_opt="" errcode=0 while [ $# -gt 0 ] ; do case "$1" in all) cmd="all" ;; checkout) cmdcheckout="checkout" cmd="" ;; diff) cmddiff="diff" cmd="" ;; test) cmdtest="test" cmd="" ;; srcdir) #use srcdir option for test srcdir="yes" ;; srcdirname) shift if [ $# -lt 1 ]; then echo "srcdirname missing" errcode=1 cmd="help" break fi SRCDIRNAME="$1" ;; release) cmdrel="release" cmd="" ;; clean | distclean) cmdclean="$1" cmd="" ;; help) cmd="help" break ;; echo) set -x break ;; zlib) shift if [ $# -lt 1 ]; then echo "ZLIB information missing" errcode=1 cmd="help" break fi ZLIB="$1" ;; archive) shift if [ $# -lt 1 ]; then echo "Archive pathname missing" errcode=1 cmd="help" break fi ARCHIVES="$1" ;; --*) OP_CONFIGURE="$OP_CONFIGURE $1" ;; op-configure) shift if [ $# -lt 1 ]; then echo "op-configure option missing" errcode=1 cmd="help" break fi OP_CONFIGURE="$OP_CONFIGURE $1" ;; *) echo "Unkown option $1" errcode=1 cmd="help" break ;; esac shift done if [ "$cmd" = help ]; then set - cat <] [archive ] [dir ] [op-configure