#!/bin/sh # # Copyright by The HDF Group. # Copyright by the Board of Trustees of the University of Illinois. # All rights reserved. # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in # the COPYING file, which can be found at the root of the source code # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # 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 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() { echo "=====" "$1": "`date`" "=====" } EXIT_BANNER() { TIMESTAMP "Exit $PROGNAME with status=$?" } # Show current total disk usage. DISKUSAGE() { du -ks | \ ( 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