From a22a9fe733731a6f03e07550cd9236ebbf310904 Mon Sep 17 00:00:00 2001 From: lrknox Date: Fri, 17 Feb 2017 15:16:15 -0600 Subject: Remove references to SVN. --- bin/snapshot | 552 ++++++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 433 insertions(+), 119 deletions(-) diff --git a/bin/snapshot b/bin/snapshot index a496edd..cc4bbc9 100755 --- a/bin/snapshot +++ b/bin/snapshot @@ -13,13 +13,14 @@ # http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have # access to either file, you may request a copy from help@hdfgroup.org. -# This script should be run nightly from cron. It checks out hdf5 +# This script should be run nightly from cron. It checks out the source # from the source repository 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 source repository. # + # function definitions TIMESTAMP() { @@ -28,7 +29,7 @@ TIMESTAMP() EXIT_BANNER() { -TIMESTAMP "Exit $PROGNAME with status=$?" + TIMESTAMP "Exit $PROGNAME with status=$?" } # Show current total disk usage. @@ -38,11 +39,178 @@ DISKUSAGE() ( read x y; echo "Disk Usage=$x KB" ) } +# function provided for testing software downloaded as tar files. A version of +# this function that properly extracts the downloaded files can be provided in +# the snapshots-${sw}-overrides file. +EXTRACT() +{ + echo "Error: ${SWVERSION} is in source repository - does not need extraction." +} + +# Standard procedure for checking out or updating source code from an hdfgroup +# git repository. Override the function for other repositories or procedures. +SOURCE_CHECKOUT() +{ + if test -n $GIT_URL; then + if [ -n "$AUTOGEN" ]; then + echo "Creating fresh clone of $GIT_URL in $BASEDIR/current_src" + # Check out the current version from source repository. + (cd $BASEDIR; rm -rf current_src + if test -z $GIT_BRANCH; then + echo "Testing empty branch $GIT_BRANCH." + git clone $GIT_URL current_src + else + echo "Testing branch $GIT_BRANCH." + git clone $GIT_URL -b $GIT_BRANCH current_src + fi + ) || exit 1 + else + echo "Creating fresh clone of $GIT_URL in $BASEDIR/current" + # Check out the current version from source repository. + (cd $BASEDIR; rm -rf current + if test -n $GIT_BRANCH; then + git clone $GIT_URL -b $GIT_BRANCH current + else + git clone $GIT_URL current + fi ) || exit 1 + fi + else + echo "Warning! Source directory ("current") is not checked out from git." + fi +} + +# Standard procedure for running the configure command in a build (test) +# directory +RUNCONFIGURE() +{ + if [ "${CURRENT}" != "${TESTDIR}" -a "$CPSRC" = "yes" ]; then + echo "Copying source files to ${TESTDIR}." + cp -pr ${CURRENT}/* ${TESTDIR} + cd ${TESTDIR} + ./${CONFIGURE} + elif [ -n "${AUTOGEN}" ]; then + ${CURRENTSRC}/${CONFIGURE} + else + ${CURRENT}/${CONFIGURE} + fi +} + +# Sometimes "make distclean" doesn't adequately remove files from the previous +# build. If a build (test) directory was used, its contents can be entirely +# deleted to provide a clean start. If the test is building in the source +# directory, the contents can't be deleted, so run "make distclean". +DISTCLEAN() +{ + if [ "${srcdir}" = "yes" -a -n "${SRCDIRNAME}" -a -d ${BASEDIR}/TestDir/${SRCDIRNAME} ]; then + echo "Remove contents of $SRCDIRNAME.\n" + rm -rf ${BASEDIR}/TestDir/${SRCDIRNAME}/* + else + echo "$MAKE distclean" + (cd ${TESTDIR} && ${MAKE} distclean) + fi +} + +# Several of the software packages tested do not support make check-install. +# Those that support it should have a version of this function in their +# override with the following lines: +# TIMESTAMP "check-install $1" +# ${MAKE} check-install $1 +CHECKINSTALL() +{ + echo "check-install is not supported for ${SWVERSION}" +} + +# Function for hdf4 and hdf5 to override to check in changes after snapshot. +# Safety measure to avoid unintended checkins to other repositories. +COMMITSNAPSHOT() +{ + echo "original hdf5 script committed code changes back into git." +} + +DISPLAYUSAGE() +{ + set - + cat < [diff] [test] [srcdir] [release] [help] + [clean] [distclean] [echo] [deploy ] [deploydir ] + [zlib ] [releasedir ] [srcdirname ] [check-vfd] + [exec ] [module-load ] [op-configure