1998-07-31 03:52:24 +08:00
|
|
|
#!/bin/sh
|
|
|
|
set -x
|
1998-08-06 06:22:59 +08:00
|
|
|
date
|
1999-11-04 14:54:44 +08:00
|
|
|
uname -a
|
1998-07-31 03:52:24 +08:00
|
|
|
#
|
|
|
|
# This script should be run nightly from cron. It checks out hdf5
|
|
|
|
# from the CVS source tree and compares it against the previous
|
|
|
|
# snapshot. If anything significant changed then a new snapshot is
|
|
|
|
# created, the minor version number is incremented, and the change is
|
|
|
|
# checked back into the CVS repository.
|
|
|
|
#
|
|
|
|
|
1998-08-14 04:17:47 +08:00
|
|
|
# The path isn't properly initialized on hawkwind -- /usr/local/bin is
|
|
|
|
# either missing or is after /usr/bin when it should be before.
|
1998-08-19 01:14:43 +08:00
|
|
|
PATH="/usr/local/bin:$PATH"
|
1998-08-14 04:17:47 +08:00
|
|
|
|
1998-07-31 03:52:24 +08:00
|
|
|
# Where are the snapshots stored?
|
1999-07-04 13:16:03 +08:00
|
|
|
ARCHIVES_default=/afs/ncsa/ftp/HDF/pub/outgoing/hdf5/snapshots
|
|
|
|
ARCHIVES=$ARCHIVES_default
|
1998-07-31 04:24:10 +08:00
|
|
|
|
1999-07-04 13:16:03 +08:00
|
|
|
# Where are the HDF4 library?
|
1999-06-15 12:01:09 +08:00
|
|
|
# At NCSA, the standard place to find HDF4 software is in /usr/ncsa/.
|
1999-07-04 13:16:03 +08:00
|
|
|
HDF4LIB_default="/usr/ncsa/include,/usr/ncsa/lib"
|
1999-07-07 00:54:45 +08:00
|
|
|
HDF4LIB=$HDF4LIB_default
|
1999-02-19 00:55:00 +08:00
|
|
|
|
1999-07-04 13:16:03 +08:00
|
|
|
# What compression methods to use?
|
|
|
|
METHODS="gzip bzip2"
|
1998-07-31 03:52:24 +08:00
|
|
|
|
1999-12-04 06:42:55 +08:00
|
|
|
# Use User's MAKE if set. Else use generic make.
|
|
|
|
MAKE=${MAKE:-make}
|
|
|
|
|
1999-07-04 13:16:03 +08:00
|
|
|
# Make sure cvs would work
|
1998-07-31 03:52:24 +08:00
|
|
|
if [ -z "$CVSROOT" ]; then
|
|
|
|
echo "Where is the CVS repository?" 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
1999-07-04 13:16:03 +08:00
|
|
|
#
|
|
|
|
# Command options
|
|
|
|
cmd="all"
|
2000-01-05 22:18:52 +08:00
|
|
|
test_opt=""
|
1999-07-04 13:16:03 +08:00
|
|
|
errcode=0
|
|
|
|
echo '$#=' $# '$*="' $* '"'
|
|
|
|
while [ $# -gt 0 ] ; do
|
|
|
|
case "$1" in
|
|
|
|
all)
|
|
|
|
cmd="all"
|
|
|
|
;;
|
1999-07-07 00:54:45 +08:00
|
|
|
checkout)
|
|
|
|
cmdcheckout="checkout"
|
|
|
|
cmd=""
|
|
|
|
;;
|
1999-07-04 13:16:03 +08:00
|
|
|
test)
|
|
|
|
cmdtest="test"
|
|
|
|
cmd=""
|
|
|
|
;;
|
2000-01-05 22:18:52 +08:00
|
|
|
srcdir)
|
|
|
|
#use srcdir option for test
|
|
|
|
srcdir="yes"
|
|
|
|
;;
|
2000-02-23 01:27:48 +08:00
|
|
|
srcdirname)
|
|
|
|
shift
|
|
|
|
if [ $# -lt 1 ]; then
|
|
|
|
echo "srcdirname <dir> missing"
|
|
|
|
errcode=1
|
|
|
|
cmd="help"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
SRCDIRNAME="$1"
|
|
|
|
;;
|
1999-07-04 13:16:03 +08:00
|
|
|
release)
|
|
|
|
cmdrel="release"
|
|
|
|
cmd=""
|
|
|
|
;;
|
2000-03-23 13:45:04 +08:00
|
|
|
clean | distclean)
|
|
|
|
cmdclean="$1"
|
|
|
|
cmd=""
|
|
|
|
;;
|
1999-07-04 13:16:03 +08:00
|
|
|
help)
|
|
|
|
cmd="help"
|
|
|
|
break
|
|
|
|
;;
|
|
|
|
hdf4)
|
|
|
|
shift
|
|
|
|
if [ $# -lt 1 ]; then
|
|
|
|
echo "HDF4LIB information missing"
|
|
|
|
errcode=1
|
|
|
|
cmd="help"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
HDF4LIB="$1"
|
|
|
|
;;
|
|
|
|
archive)
|
|
|
|
shift
|
|
|
|
if [ $# -lt 1 ]; then
|
|
|
|
echo "Archive pathname missing"
|
|
|
|
errcode=1
|
|
|
|
cmd="help"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
ARCHIVES="$1"
|
|
|
|
;;
|
2000-02-23 01:27:48 +08:00
|
|
|
op-configure)
|
|
|
|
shift
|
|
|
|
if [ $# -lt 1 ]; then
|
|
|
|
echo "op-configure option missing"
|
|
|
|
errcode=1
|
|
|
|
cmd="help"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
OP_CONFIGURE="$OP_CONFIGURE $1"
|
|
|
|
;;
|
1999-07-04 13:16:03 +08:00
|
|
|
*)
|
|
|
|
echo "Unkown option $1"
|
|
|
|
errcode=1
|
|
|
|
cmd="help"
|
|
|
|
break
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ "$cmd" = help ]; then
|
|
|
|
set -
|
2000-02-23 01:59:23 +08:00
|
|
|
cat <<EOF
|
|
|
|
Usage: $0 [all] [checkout] [test] [srcdir] [release] [help]
|
|
|
|
[hdf4 <hdf4lib_path>] [archive <arch_path>] [dir <dir>]
|
|
|
|
[op-configure <option>]
|
|
|
|
all: Run all commands (checkout, test & release)
|
|
|
|
[Default is all]
|
|
|
|
checkout: Run cvs checkout
|
|
|
|
test: Run test
|
|
|
|
release: Run release
|
2000-03-23 13:45:04 +08:00
|
|
|
clean: Run make clean
|
|
|
|
distclean:Run make distclean
|
2000-02-23 01:59:23 +08:00
|
|
|
srcdir: Use srcdir option (does not imply other commands)
|
|
|
|
"snapshot srcdir" is equivalent to "snapshot srcdir all"
|
|
|
|
"snapshot srcdir checkout" is equivalent to "snapshot checkout"
|
|
|
|
srcdirname <dir>:
|
|
|
|
Use <dir> as the srcdir testing directory if srcdir is choosen.
|
|
|
|
If <dir> starts with '-', it is append to the default name
|
|
|
|
E.g., "snapshot srcdir srcdirname -xx" uses hostname-xx
|
|
|
|
[Default is hostname]
|
|
|
|
help: Print this message
|
|
|
|
hdf4 <hdf4lib_path>:
|
|
|
|
Use <hdf4lib_path> as the HDF4LIB locations
|
|
|
|
[Default is $HDF4LIB_default]
|
|
|
|
archive <arch_path>:
|
|
|
|
Use <arch_path> as the release ARCHIVE area
|
|
|
|
[Default is $ARCHIVES_default]
|
|
|
|
op-configure <option>:
|
|
|
|
Pass <option> to the configure command
|
|
|
|
E.g., "snapshot op-configure --enable-parallel"
|
|
|
|
configures for parallel mode
|
|
|
|
EOF
|
1999-07-04 13:16:03 +08:00
|
|
|
exit $errcode
|
|
|
|
fi
|
1999-07-07 00:54:45 +08:00
|
|
|
|
|
|
|
# Setup the proper configure option (--with-hdf4) to use hdf4 library
|
|
|
|
# provide HDF4LIB is non-empty.
|
|
|
|
HDF4LIB=${HDF4LIB:+"--with-hdf4="$HDF4LIB}
|
2000-02-23 01:27:48 +08:00
|
|
|
CONFIGURE="./configure $HDF4LIB $OP_CONFIGURE"
|
1999-07-07 00:54:45 +08:00
|
|
|
|
1999-07-04 13:16:03 +08:00
|
|
|
# Execute the requests
|
1998-08-14 04:17:47 +08:00
|
|
|
snapshot=yes
|
1999-07-04 13:16:03 +08:00
|
|
|
|
2000-04-11 06:29:11 +08:00
|
|
|
H5VERSION=hdf5
|
|
|
|
BASEDIR=${HOME}/snapshots-${H5VERSION}
|
2000-02-23 01:27:48 +08:00
|
|
|
CURRENT=${BASEDIR}/current
|
|
|
|
PREVIOUS=${BASEDIR}/previous
|
1999-07-04 13:16:03 +08:00
|
|
|
|
1999-07-07 00:54:45 +08:00
|
|
|
#=============================
|
|
|
|
# Run CVS checkout
|
|
|
|
#=============================
|
|
|
|
if [ "$cmd" = "all" -o -n "$cmdcheckout" ]; then
|
1999-07-04 13:16:03 +08:00
|
|
|
# Create a working directory. Hopefully one is left over from last
|
|
|
|
# time that still has the contents of the previous release. But if
|
|
|
|
# not, just create one and assume that a snapshot is necessary.
|
2000-02-23 01:27:48 +08:00
|
|
|
test -d ${BASEDIR} || mkdir -p ${BASEDIR} || exit 1
|
1999-07-04 13:16:03 +08:00
|
|
|
|
|
|
|
# Check out the current version from CVS
|
2000-01-05 22:18:52 +08:00
|
|
|
cvs -Q co -d ${CURRENT} hdf5 || exit 1
|
1999-07-07 04:06:16 +08:00
|
|
|
fi # Do CVS checkout
|
1999-07-04 13:16:03 +08:00
|
|
|
|
1999-07-07 00:54:45 +08:00
|
|
|
|
|
|
|
#=============================
|
|
|
|
# Run Test the HDF5 library
|
|
|
|
#=============================
|
|
|
|
if [ "$cmd" = "all" -o -n "$cmdtest" ]; then
|
2000-01-05 22:18:52 +08:00
|
|
|
# setup if srcdir is used.
|
|
|
|
if [ -z "$srcdir" ]; then
|
|
|
|
TESTDIR=${CURRENT}
|
|
|
|
else
|
|
|
|
#create TESTDIR if not exist yet
|
2000-02-23 01:27:48 +08:00
|
|
|
case "$SRCDIRNAME" in
|
|
|
|
"")
|
|
|
|
SRCDIRNAME=`hostname`
|
|
|
|
;;
|
|
|
|
-*)
|
|
|
|
SRCDIRNAME="`hostname`$SRCDIRNAME"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
TESTDIR=${BASEDIR}/TestDir/${SRCDIRNAME}
|
2000-01-05 22:18:52 +08:00
|
|
|
test -d ${TESTDIR} || mkdir ${TESTDIR}
|
|
|
|
fi
|
1999-11-05 04:35:23 +08:00
|
|
|
# Make sure current version exists and is clean
|
2000-01-05 22:18:52 +08:00
|
|
|
if [ -d ${TESTDIR} ]; then
|
|
|
|
(cd ${TESTDIR} && ${MAKE} distclean)
|
1999-11-05 04:35:23 +08:00
|
|
|
else
|
|
|
|
errcode=$?
|
|
|
|
snapshot=no
|
|
|
|
exit $errcode
|
|
|
|
fi
|
|
|
|
|
1999-07-04 13:16:03 +08:00
|
|
|
# Compare it with the previous version. Compare only files listed in
|
|
|
|
# the MANIFEST plus the MANIFEST itself.
|
2000-01-05 22:18:52 +08:00
|
|
|
if [ -d ${PREVIOUS} ]; then
|
|
|
|
if (diff -c ${PREVIOUS}/MANIFEST ${CURRENT}/MANIFEST); then
|
1999-07-04 13:16:03 +08:00
|
|
|
snapshot=no
|
2000-01-05 22:18:52 +08:00
|
|
|
for src in `grep '^\.' ${CURRENT}/MANIFEST|expand|cut -f1 -d' '`; do
|
1999-07-04 13:16:03 +08:00
|
|
|
diff -I H5_VERS_RELEASE -I " released on " \
|
|
|
|
-I " currently under development" \
|
2000-01-05 22:18:52 +08:00
|
|
|
${PREVIOUS}/$src ${CURRENT}/$src || \
|
1999-07-04 13:16:03 +08:00
|
|
|
snapshot=yes
|
|
|
|
# Don't break because we want to see all the diffs.
|
|
|
|
done
|
|
|
|
fi
|
1998-07-31 03:52:24 +08:00
|
|
|
fi
|
1998-08-11 02:15:14 +08:00
|
|
|
|
1999-07-04 13:16:03 +08:00
|
|
|
# Make sure all the serial tests work.
|
|
|
|
if [ "$snapshot" = "yes" ]; then
|
2000-01-05 22:18:52 +08:00
|
|
|
if (cd ${TESTDIR}; \
|
|
|
|
${srcdir:+${CURRENT}/}${CONFIGURE}; \
|
1999-12-04 06:42:55 +08:00
|
|
|
${MAKE} check); then
|
1999-07-04 13:16:03 +08:00
|
|
|
:
|
|
|
|
else
|
1999-11-04 14:54:44 +08:00
|
|
|
errcode=$?
|
1999-07-04 13:16:03 +08:00
|
|
|
snapshot=no
|
1999-11-04 14:54:44 +08:00
|
|
|
exit $errcode
|
1999-07-04 13:16:03 +08:00
|
|
|
fi
|
1998-08-11 02:15:14 +08:00
|
|
|
fi
|
1999-07-04 13:16:03 +08:00
|
|
|
fi # Test the HDF5 library
|
|
|
|
|
1999-07-07 00:54:45 +08:00
|
|
|
|
|
|
|
#=============================
|
|
|
|
# Run Release snapshot, update version, and commit to cvs and tag
|
|
|
|
#=============================
|
|
|
|
if [ "$cmd" = "all" -o -n "$cmdrel" ]; then
|
1999-07-04 13:16:03 +08:00
|
|
|
if [ "$snapshot" = "yes" ]; then
|
2000-01-05 22:18:52 +08:00
|
|
|
(cd ${CURRENT}; ${MAKE} distclean)
|
1999-07-04 13:16:03 +08:00
|
|
|
(
|
1999-07-07 00:54:45 +08:00
|
|
|
# Turn on exit on error in the sub-shell so that it does not
|
|
|
|
# cvs commit if errors encounter here.
|
1999-07-04 13:16:03 +08:00
|
|
|
set -e
|
2000-01-05 22:18:52 +08:00
|
|
|
cd ${CURRENT}
|
1999-07-04 13:16:03 +08:00
|
|
|
bin/release -d $ARCHIVES $METHODS
|
1999-09-22 13:47:46 +08:00
|
|
|
RELEASE_VERSION="`perl bin/h5vers -v`"
|
|
|
|
perl bin/h5vers -i
|
1999-07-04 13:16:03 +08:00
|
|
|
cvs -Q commit -m "Snapshot $RELEASE_VERSION"
|
|
|
|
)
|
1999-11-04 14:54:44 +08:00
|
|
|
errcode=$?
|
1999-07-04 13:16:03 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Replace the previous version with the current version.
|
2000-03-13 23:20:46 +08:00
|
|
|
# Should check if the errcode of the release process but there
|
|
|
|
# are other failures after release was done (e.g. h5vers or cvs failures)
|
|
|
|
# that should allow the replacement to occure.
|
2000-01-05 22:18:52 +08:00
|
|
|
rm -rf ${PREVIOUS}
|
|
|
|
mv ${CURRENT} ${PREVIOUS}
|
1999-07-04 13:16:03 +08:00
|
|
|
fi #Release snapshot
|
1998-07-31 03:52:24 +08:00
|
|
|
|
2000-03-23 13:45:04 +08:00
|
|
|
|
|
|
|
#=============================
|
|
|
|
# Clean the test area. Default is no clean.
|
|
|
|
#=============================
|
|
|
|
if [ -n "$cmdclean" ]; then
|
|
|
|
# setup if srcdir is used.
|
|
|
|
if [ -z "$srcdir" ]; then
|
|
|
|
TESTDIR=${CURRENT}
|
|
|
|
else
|
|
|
|
case "$SRCDIRNAME" in
|
|
|
|
"")
|
|
|
|
SRCDIRNAME=`hostname`
|
|
|
|
;;
|
|
|
|
-*)
|
|
|
|
SRCDIRNAME="`hostname`$SRCDIRNAME"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
TESTDIR=${BASEDIR}/TestDir/${SRCDIRNAME}
|
|
|
|
fi
|
|
|
|
# Make sure current version exists and is clean
|
|
|
|
if [ -d ${TESTDIR} ]; then
|
|
|
|
(cd ${TESTDIR} && ${MAKE} $cmdclean )
|
|
|
|
else
|
|
|
|
errcode=$?
|
|
|
|
snapshot=no
|
|
|
|
exit $errcode
|
|
|
|
fi
|
|
|
|
fi # Clean the Test directory
|
|
|
|
|
1999-11-04 14:54:44 +08:00
|
|
|
exit $errcode
|