diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2022-03-23 13:48:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-23 13:48:05 (GMT) |
commit | fbb532cd633e216f47ce846493b38af02cfbb43a (patch) | |
tree | 1ef7bc9f25ec0832f8b25bb8ea4be34d53bd144d /bin | |
parent | 78375882485a99a81caa933928ed08d7a38ef88b (diff) | |
download | hdf5-fbb532cd633e216f47ce846493b38af02cfbb43a.zip hdf5-fbb532cd633e216f47ce846493b38af02cfbb43a.tar.gz hdf5-fbb532cd633e216f47ce846493b38af02cfbb43a.tar.bz2 |
VFD SWMR: Normalization with develop (#1506)
* Brought over plugin and test script changes
* Removes remaining register keywords (#1481)
* Fixed warnings in the aux process code
* Minor fixes from develop
* Minor changes from develop, fixed format warnings
* Formatted source
* Added HD prefix to timespec_get
* Cleanup in new files
* Removes the MANIFEST file and unused release files (#1497)
* Removes the MANIFEST file and unused release files
* Updated tar command
* checkposix corrections
* More checkposix fixes
* Ripped out unused instrumentation functionality
* Brought over cache tagging changes from develop
* Changes to tagged metadata expulsion iteration
* Fixed typo
* Brought over H5O__free() changes from develop
* Brings (unused) parallel page buffer test in line with develop
* Moved the functionality in supervise.subr to test_vfd_swmr.sh
* Tools VFD parameter updates
* Committing clang-format changes
* H5F VFD SWMR refactoring
* Committing clang-format changes
* Misc changes
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/bbrelease | 238 | ||||
-rwxr-xr-x | bin/checkposix | 14 | ||||
-rwxr-xr-x | bin/chkmanifest | 154 | ||||
-rwxr-xr-x | bin/locate_sw | 238 | ||||
-rwxr-xr-x | bin/release | 80 | ||||
-rwxr-xr-x | bin/runtest | 966 | ||||
-rwxr-xr-x | bin/snapshot | 837 | ||||
-rw-r--r-- | bin/snapshot_version | 19 | ||||
-rwxr-xr-x | bin/timekeeper | 129 |
9 files changed, 112 insertions, 2563 deletions
diff --git a/bin/bbrelease b/bin/bbrelease index a45be2e..d056f6d 100755 --- a/bin/bbrelease +++ b/bin/bbrelease @@ -14,32 +14,13 @@ # Make a release of hdf5. # -# Programmer: Robb Matzke -# Creation date: on or before 1998-01-29. +# NOTE: +# This script differs from bin/release in that this has an added +# --revision option to create private releases with the code revision +# hash in the version strings. # -# Modifications -# Robb Matzke, 1999-07-16 -# The SunOS 5.6 sed *must* have slashes as delimiters. I changed things like -# `sed s+/CVS++' to `sed 's/\/CVS//' -# -# Albert Cheng, 1999-10-26 -# Moved the MANIFEST checking to a separate command file so that -# it can be invoked individually. -# -# Albert Cheng, 2004-08-14 -# Added the --private option. -# -# James Laird, 2005-09-07 -# Added the md5 method. -# -# Larry Knox, 2016-08-30 -# Added the --revision option to create private releases with the -# code revision hash in the version strings. Currently the version -# of this script with the --revision option is named bbrelease. It -# can probably be merged into the original release script in the -# future. -# Commands to get the revision hash have now been converted to git -# to match the source repository change. +# This script can probably be merged into the original release script in +# the future. # Function definitions # @@ -47,26 +28,25 @@ USAGE() { cat << EOF -Usage: $0 -d <dir> [--docver BRANCHNAME] [-h] [--nocheck] [--private] <methods> ... - -d DIR The name of the directory where the release(s) should be +Usage: $0 -d <dir> [--docver BRANCHNAME] [-h] [--private] [--revision] <methods> ... + -d DIR The name of the directory where the release(s) should be placed. --docver BRANCHNAME This is added for 1.8 and beyond to get the correct version of documentation files from the hdf5docs repository. BRANCHNAME for v1.8 should be hdf5_1_8. -h print the help page. - --nocheck Ignore errors in MANIFEST file. - --private Make a private release with today's date in version information. - --revision Make a private release with the code revision number in version information. - + --private Make a private release with today's date in version information. + --revision Make a private release with the code revision number in version information. + This must be run at the top level of the source directory. The other command-line options are the names of the programs to use for compressing the resulting tar archive (if none are given then "tar" is assumed): - tar -- use tar and don't do any compressing. - gzip -- use gzip with "-9" and append ".gz" to the output name. + tar -- use tar and don't do any compressing. + gzip -- use gzip with "-9" and append ".gz" to the output name. bzip2 -- use bzip2 with "-9" and append ".bz2" to the output name. - zip -- convert all text files to DOS style and form a zip file for Windows use. + zip -- convert all text files to DOS style and form a zip file for Windows use. doc -- produce the latest doc tree in addition to the archive. An md5 checksum is produced for each archive created and stored in the md5 file. @@ -97,15 +77,10 @@ EOF # Function name: tar2zip # Convert the release tarball to a Windows zipball. # -# Programmer: Albert Cheng -# Creation date: 2014-04-23 -# -# Modifications -# # Steps: # 1. untar the tarball in a temporary directory; # Note: do this in a temporary directory to avoid changing -# the original source directory which maybe around. +# the original source directory which may be around. # 2. convert all its text files to DOS (LF-CR) style; # 3. form a zip file which is usable by Windows users. # @@ -119,8 +94,8 @@ EOF tar2zip() { if [ $# -ne 3 ]; then - echo "usage: tar2zip <tarfilename> <zipfilename>" - return 1 + echo "usage: tar2zip <tarfilename> <zipfilename>" + return 1 fi ztmpdir=/tmp/tmpdir$$ mkdir -p $ztmpdir @@ -132,23 +107,23 @@ tar2zip() (cd $ztmpdir; tar xf -) < $tarfile # sanity check if [ ! -d $ztmpdir/$version ]; then - echo "untar did not create $ztmpdir/$version source dir" - # cleanup - rm -rf $ztmpdir - return 1 + echo "untar did not create $ztmpdir/$version source dir" + # cleanup + rm -rf $ztmpdir + return 1 fi # step 2: convert text files # There maybe a simpler way to do this. # options used in unix2dos: - # -k Keep the date stamp + # -k Keep the date stamp # -q quiet mode # grep redirect output to /dev/null because -q or -s are not portable. find $ztmpdir/$version | \ - while read inf; do \ - if file $inf | grep "$inf\: .*text" > /dev/null 2>&1 ; then \ - unix2dos -q -k $inf; \ - fi\ - done + while read inf; do \ + if file $inf | grep "$inf\: .*text" > /dev/null 2>&1 ; then \ + unix2dos -q -k $inf; \ + fi\ + done # step 3: make zipball # -9 maximum compression # -y Store symbolic links as such in the zip archive @@ -163,14 +138,6 @@ tar2zip() # This command must be run at the top level of the hdf5 source directory. # Verify this requirement. -# Since we are running bbrelease to create an HDF5 source tarfile for buildbot -# testing with source that is not for release, there is not a file named -# "configure" but there will be one named "configure.ac". The "configure" -# file will be created when autogen.sh runs. There probably will always -# be a bin/release file, but just in case it is removed, we can check for -# this script, bbrelease, in the bin directory. The bin/release script should -# continue to check for "configure" because it should be present in release -# source. if [ ! \( -f configure.ac -a -f bin/bbrelease \) ]; then echo "$0 must be run at the top level of the hdf5 source directory" exit 1 @@ -182,12 +149,11 @@ VERS=`perl bin/h5vers` VERS_OLD= test "$VERS" || exit 1 verbose=yes -check=yes release_date=`date +%F` today=`date +%Y%m%d` pmode='no' revmode='no' -tmpdir="../#release_tmp.$$" # tmp work directory +tmpdir="../#release_tmp.$$" # tmp work directory DOC_URL=https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5doc.git CPPLUS_RM_NAME=cpplus_RM @@ -195,11 +161,11 @@ CPPLUS_RM_NAME=cpplus_RM RESTORE_VERSION() { if [ X-${VERS_OLD} != X- ]; then - echo restoring version information back to $VERS_OLD - rm -f config/lt_vers.am - cp $tmpdir/lt_vers.am config/lt_vers.am - bin/h5vers -s $VERS_OLD - VERS_OLD= + echo restoring version information back to $VERS_OLD + rm -f config/lt_vers.am + cp $tmpdir/lt_vers.am config/lt_vers.am + bin/h5vers -s $VERS_OLD + VERS_OLD= fi } @@ -209,20 +175,17 @@ while [ -n "$1" ]; do arg=$1 shift case "$arg" in - -d) - DEST=$1 - shift - ;; - --nocheck) - check=no - ;; - -h) - USAGE - exit 0 - ;; - --private) - pmode=yes - ;; + -d) + DEST=$1 + shift + ;; + -h) + USAGE + exit 0 + ;; + --private) + pmode=yes + ;; --revision) revmode=yes ;; @@ -230,14 +193,14 @@ while [ -n "$1" ]; do DOCVERSION=$1 shift ;; - -*) - echo "Unknown switch: $arg" 1>&2 - USAGE - exit 1 - ;; - *) - methods="$methods $arg" - ;; + -*) + echo "Unknown switch: $arg" 1>&2 + USAGE + exit 1 + ;; + *) + methods="$methods $arg" + ;; esac done @@ -278,7 +241,7 @@ if [ X$revmode = Xyes ]; then cp config/lt_vers.am $tmpdir branch=`git branch | grep '*' | awk '{print $NF}'` revision=`git rev-parse --short HEAD` -# Set version information to m.n.r-r$revision. + # Set version information to m.n.r-r$revision. # (h5vers does not correctly handle just m.n.r-$today.) VERS=`echo $VERS | sed -e s/-.*//`-$revision echo Private release of $VERS @@ -299,23 +262,10 @@ if [ ! -d $DEST ]; then exit 1 fi -# Check the validity of the MANIFEST file. -bin/chkmanifest || fail=yes -if [ "X$fail" = "Xyes" ]; then - if [ $check = yes ]; then - exit 1 - else - echo "Continuing anyway..." - fi -fi - -# Create a manifest that contains only files for distribution. -MANIFEST=$tmpdir/H5_MANIFEST -grep '^\.' MANIFEST | grep -v _DO_NOT_DISTRIBUTE_ >$MANIFEST - -# Prepare the source tree for a release. -#ln -s `pwd` $tmpdir/$HDF5_VERS || exit 1 +# Create a symlink to the source so files in the tarball have the prefix +# we want (gnu's --transform isn't portable) ln -s `pwd` $tmpdir/$HDF5_IN_VERS || exit 1 + # Save a backup copy of Makefile if exists. test -f Makefile && mv Makefile $tmpdir/Makefile.x cp -p Makefile.dist Makefile @@ -330,64 +280,60 @@ for f in README.md release_docs/RELEASE.txt; do chmod 644 $f done -# trunk is different than branches. +# develop is different than branches. if [ "${DOCVERSION}" ]; then DOC_URL=https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5doc.git -b ${DOCVERSION} fi # Create the tar file test "$verbose" && echo " Running tar..." 1>&2 -( \ - cd $tmpdir; \ - tar cf $HDF5_VERS.tar $HDF5_IN_VERS/Makefile \ - `sed 's/^\.\//'$HDF5_IN_VERS'\//' $MANIFEST` || exit 1 \ -) +(cd "$tmpdir" && exec tar -ch --exclude-vcs -f "$HDF5_VERS.tar" "./$HDF5_IN_VERS" || exit 1 ) # Compress MD5file=$HDF5_VERS.md5 cp /dev/null $DEST/$MD5file for comp in $methods; do case $comp in - tar) - cp -p $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.tar - (cd $DEST; md5sum $HDF5_VERS.tar >> $MD5file) - ;; - gzip) - test "$verbose" && echo " Running gzip..." 1>&2 - gzip -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.gz - (cd $DEST; md5sum $HDF5_VERS.tar.gz >> $MD5file) - ;; - bzip2) - test "$verbose" && echo " Running bzip2..." 1>&2 - bzip2 -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.bz2 - (cd $DEST; md5sum $HDF5_VERS.tar.bz2 >> $MD5file) - ;; - zip) - test "$verbose" && echo " Creating zip ball..." 1>&2 - tar2zip $HDF5_IN_VERS $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.zip 1>&2 - (cd $DEST; md5sum $HDF5_VERS.zip >> $MD5file) - ;; - doc) + tar) + cp -p $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.tar + (cd $DEST; md5sum $HDF5_VERS.tar >> $MD5file) + ;; + gzip) + test "$verbose" && echo " Running gzip..." 1>&2 + gzip -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.gz + (cd $DEST; md5sum $HDF5_VERS.tar.gz >> $MD5file) + ;; + bzip2) + test "$verbose" && echo " Running bzip2..." 1>&2 + bzip2 -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.bz2 + (cd $DEST; md5sum $HDF5_VERS.tar.bz2 >> $MD5file) + ;; + zip) + test "$verbose" && echo " Creating zip ball..." 1>&2 + tar2zip $HDF5_IN_VERS $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.zip 1>&2 + (cd $DEST; md5sum $HDF5_VERS.zip >> $MD5file) + ;; + doc) if [ "${DOCVERSION}" = "" ]; then DOCVERSION=master fi - test "$verbose" && echo " Creating docs..." 1>&2 - # Check out docs from git repo - (cd $tmpdir; git clone $DOC_URL > /dev/null) || exit 1 - # Create doxygen C++ RM - (cd c++/src && doxygen cpp_doc_config > /dev/null ) || exit 1 - # Replace version of C++ RM with just-created version + test "$verbose" && echo " Creating docs..." 1>&2 + # Check out docs from git repo + (cd $tmpdir; git clone $DOC_URL > /dev/null) || exit 1 + # Create doxygen C++ RM + (cd c++/src && doxygen cpp_doc_config > /dev/null ) || exit 1 + # Replace version of C++ RM with just-created version rm -rf $tmpdir/${DOCVERSION}/html/$CPPLUS_RM_NAME mv c++/src/$CPPLUS_RM_NAME $tmpdir/${DOCVERSION}/html/$CPPLUS_RM_NAME # Compress the docs and move them to the release area mv $tmpdir/$DOCVERSION $tmpdir/${HDF5_VERS}_docs - (cd $tmpdir && tar cf ${HDF5_VERS}_docs.tar ${HDF5_VERS}_docs) - mv $tmpdir/${HDF5_VERS}_docs.tar $DEST - ;; - *) - echo "***Error*** Unknown method $comp" - exit 1 - ;; + (cd $tmpdir && tar cf ${HDF5_VERS}_docs.tar ${HDF5_VERS}_docs) + mv $tmpdir/${HDF5_VERS}_docs.tar $DEST + ;; + *) + echo "***Error*** Unknown method $comp" + exit 1 + ;; esac done @@ -408,4 +354,6 @@ fi # Remove temporary things rm -rf $tmpdir +echo "DONE" + exit 0 diff --git a/bin/checkposix b/bin/checkposix index 36d07a8..79c59ad 100755 --- a/bin/checkposix +++ b/bin/checkposix @@ -115,7 +115,7 @@ foreach $arg (@ARGV) { # These are really HDF5 functions/macros even though they don't # start with `h' or `H'. - next if $name =~ /^FUNC_(ENTER|LEAVE)(_(NO)?API|_PACKAGE|_STATIC)?(_NOFS|_NOCLEAR|_NOINIT|_NOPUSH)?(_NOFUNC|_TAG)?$/; + next if $name =~ /^FUNC_(ENTER|LEAVE)(_(NO)?API|_PACKAGE|_STATIC)?(_NAMECHECK_ONLY|_NO_EOT|_NOFS|_NOCLEAR|_NOINIT|_NOPUSH)?(_NOFUNC|_TAG)?$/; next if $name =~ /^(BEGIN|END)_FUNC$/; next if $name =~ /^U?INT(8|16|32|64)(ENCODE|DECODE)(_VAR)?$/; next if $name =~ /^CI_(PRINT_STATS|INC_SRC|INC_DST)$/; @@ -123,10 +123,16 @@ foreach $arg (@ARGV) { next if $name =~ /^(MIN3?|MAX3?|NELMTS|POWER_OF_TWO|REGION_OVERFLOW)$/; next if $name =~ /^(SIZE_OVERFLOW|UNIQUE_MEMBERS|S_ISDIR)$/; next if $name =~ /^addr_defined$/; + next if $name =~ /^TERMINATOR$/; - # These functions/macros are exempt. - # op, cb, and OP are often spuriously flagged so ignore them. - next if $name =~ /^(main|op|cb|OP)$/; + # BSD queue functions + next if $name =~ /^(TAILQ_|SIMPLEQ_)/; + + # Ignore callback invocation + next if $name =~ /^(op|cb|OP|iter_op|func)$/; + + # Ignore main + next if $name =~ /^main$/; # This often appears in preprocessor lines that span multiple lines next if $name =~ /^(defined)$/; diff --git a/bin/chkmanifest b/bin/chkmanifest deleted file mode 100755 index 08ca1fa..0000000 --- a/bin/chkmanifest +++ /dev/null @@ -1,154 +0,0 @@ -#!/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://www.hdfgroup.org/licenses. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# - -# Check that all the files in MANIFEST exist and (if this is a -# GIT checkout) that all the GIT-managed files appear in the -# MANIFEST. -# - -verbose=yes -MANIFEST=/tmp/HD_MANIFEST.$$ -AUTOGEN=./autogen.sh -AUTOGEN_LOG=/tmp/autogen.log.$$ - -# Main -test "$verbose" && echo " Checking MANIFEST..." 1>&2 -# clean up $MANIFEST file when exits -trap "rm -f $MANIFEST" 0 - -# Only split lines on newline, not whitespace -set -f -IFS=' -' - -# First make sure i am in the directory in which there is an MANIFEST file -# and then do the checking from there. Will try the following, -# current directory, parent directory, the directory this command resides. -if [ -f MANIFEST ]; then - continue -elif [ -f ../MANIFEST ]; then - cd .. -else - commanddir=`dirname $0` - if [ -d "$commanddir" -a -f $commanddir/MANIFEST ]; then - cd $commanddir - continue - else - echo MANIFEST file not found. Abort. - exit 1 - fi -fi - -# Do an autogen if generated files (e.g., configure) is not present -if [ ! -f configure ]; then - echo " running $AUTOGEN" - $AUTOGEN > $AUTOGEN_LOG 2>&1 - if [ $? -ne 0 ]; then - echo $AUTOGEN encountered error. Abort. - echo output from $AUTOGEN: - cat $AUTOGEN_LOG - exit 1 - fi - rm $AUTOGEN_LOG -fi - -# Check for duplicate entries. This can be done at any time, but it may as -# well be sooner so that if something else fails the presence of duplicates -# will already be known. -errcode=0 -DUPLICATES=`perl -ne 's/#.*//; next if /^\s*$/; if ($uniq{$_}++) { print $_; }' MANIFEST` -if [ "$DUPLICATES" ]; then - cat 1>&2 <<EOF -These entries appear more than once in the MANIFEST: -$DUPLICATES -Please remove the duplicate lines and try again. - -EOF -errcode=1 -fi - -# Copy the manifest file to get a list of file names. -grep '^\.' MANIFEST | expand | cut -f1 -d' ' >$MANIFEST - -for file in `cat $MANIFEST`; do - if [ ! -f $file ]; then - echo "- $file" - fail=yes - fi -done - -# Get the list of files under version control and check that they are -# present. -# -# First get a list of all the pending files with git status and -# check those. -git_stat=`git status -s` -for file in $git_stat; do - - # Newly added files are not listed by git ls-files, which - # we check later. - - # The line listing new files starts with 'A'. - letter=`echo $file | head -c 1` - if [ "$letter" = "A" ]; then - # Convert the git status columns to './' so it matches - # the manifest file name. - # - # There is a space between the status columns and file name, hence - # the '3'. - path=`echo $file | sed 's/^.\{3\}/\.\//g'` - # Ignore directories - if [ ! -d $path ]; then - if (grep ^$path$ $MANIFEST >/dev/null); then - : - else - echo "- $path" - fail=yes - fi - fi - fi -done - -# Next check git ls-files, which gets a list of all files that are -# checked in. -git_ls=`git ls-files` -for file in $git_ls; do - path="./${file}" - # Ignore directories - if [ ! -d $path ]; then - if (grep ^$path$ $MANIFEST >/dev/null); then - : - else - echo "+ $path" - fail=yes - fi - fi -done - -# Finish up -if [ "X$fail" = "Xyes" ]; then - cat 1>&2 <<EOF -The MANIFEST is out of date. Files marked with a minus sign (-) no -longer exist; files marked with a plus sign (+) are GIT-managed but do -not appear in the MANIFEST. Please remedy the situation and try again. -EOF - exit 1 -fi - -if [ $errcode -ne 0 ]; then - exit 1 -fi - -test "$verbose" && echo " The MANIFEST is up to date." 1>&2 -exit 0 diff --git a/bin/locate_sw b/bin/locate_sw deleted file mode 100755 index 1cf84e2..0000000 --- a/bin/locate_sw +++ /dev/null @@ -1,238 +0,0 @@ -#!/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://www.hdfgroup.org/licenses. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# - -# Try to locate the software as named in argument. -# This is a sequential search of all possible locations of the software. -# Usage: locate_sw <SW-Name> -# It prints a string showing the paths leading to the include, lib and bin -# directory of the software, separated by colons. E.g., if the software is -# located in /usr/sdt/*, it prints -# /usr/sdt/include:/usr/sdt/lib:/usr/sdt/bin -# Any component that is not found will be returned as an empty string. E.g., -# if somehow the header files of the software are not found, it prints -# :/usr/sdt/lib;/usr/sdt/bin - -# Function definitions -USAGE() -{ - echo "Usage: locate_sw <SW-Name>" - echo " where <SW-Name> can be hdf4, hdf5, zlib" - echo " It prints the paths leading the header files (include)," - echo " library (lib), and tools (bin). E.g.," - echo " /usr/sdt/include:/usr/sdt/lib:/usr/sdt/bin" - echo " Any component that is not found will be returned as an empty string. E.g.," - echo " if somehow the header files of the software are not found, it prints" - echo " :/usr/sdt/lib;/usr/sdt/bin" - echo "Exit code: 0 if software located; otherwise non-zero" -} - -# locate hdf4 software -locate_hdf4() -{ -# this default is the best guess of locating hdf4 software -swpaths_defaults="/usr/ncsa /usr/sdt /usr/local" -swpaths= - -case "$OSname" in - SunOS) - case "$OSrelease" in - 5.7) - swpaths="/afs/ncsa/packages/hdf/SunOS_5.7" - ;; - *) - # use default - ;; - esac - ;; - HP-UX) - case "$OSrelease" in - B.11.00) - swpaths="/afs/ncsa/packages/hdf/HPUX_11.00" - ;; - *) - # use default - ;; - esac - ;; - Linux) - swpaths="/afs/ncsa/packages/hdf/Linux" - ;; - OSF1) - swpaths="/afs/ncsa/packages/hdf/OSF1_V4.0" - ;; - *) - # just use the defaults - ;; -esac - -# Check if the hdf4 software is actually available. -# Accept the directory only if needed .h, .a and tools are found -# in the same place. That way, they are more likely to be of the -# same version. -# -swpaths="$swpaths $swpaths_defaults" -for sw in $swpaths; do - if [ -r $sw/include/hdf.h -a -r $sw/lib/libdf.a -a -r $sw/bin/hdp ]; then - SW_inc=$sw/include - SW_lib=$sw/lib - SW_bin=$sw/bin - SW_Location=$sw - break - fi -done -} - -# locate hdf5 software -locate_hdf5() -{ -# this default is the best guess of locating hdf5 software -swpaths_defaults="/usr/ncsa /usr/sdt /usr/local" -swpaths= - -case "$OSname" in - SunOS) - case "$OSrelease" in - 5.7) - swpaths="/afs/ncsa/packages/hdf5/SunOS_5.7" - ;; - *) - # use default - ;; - esac - ;; - HP-UX) - case "$OSrelease" in - B.11.00) - swpaths="/afs/ncsa/packages/hdf5/HPUX_11.00" - ;; - *) - # use default - ;; - esac - ;; - Linux) - swpaths="/afs/ncsa/packages/hdf5/Linux" - ;; - FreeBSD) - swpaths="/afs/ncsa/packages/hdf5/FreeBSD" - ;; - OSF1) - swpaths="/afs/ncsa/packages/hdf5/OSF1_V4.0" - ;; - *) - # just use the defaults - ;; -esac - -# Check if the hdf5 software is actually available. -# Accept the directory only if needed .h, .a and tools are found -# in the same place. That way, they are more likely to be of the -# same version. -# -swpaths="$swpaths $swpaths_defaults" -for sw in $swpaths; do - if [ -r $sw/include/hdf5.h -a -r $sw/lib/libhdf5.a -a -r $sw/bin/h5dump ]; then - SW_inc=$sw/include - SW_lib=$sw/lib - SW_bin=$sw/bin - SW_Location=$sw - break - fi -done -} - -# locate zlib software -locate_zlib() -{ -# this default is the best guess of locating zlib software -swpaths_defaults="/usr /usr/local /usr/ncsa /usr/sdt" -swpaths= - - -# Check if the zlib software is actually available. -# Accept the directory only if needed .h, .a and tools are found -# in the same place. That way, they are more likely to be of the -# same version. -# Don't know something specific to check the bin directory. Maybe gzip? -# Just make sure it exists. -# -swpaths="$swpaths $swpaths_defaults" -for sw in $swpaths; do - if [ -r $sw/include/zlib.h -a \ - \( -r $sw/lib/libz.a -o -r $sw/lib/libz.so \) -a -d $cw/bin ]; then - SW_inc=$sw/include - SW_lib=$sw/lib - SW_bin=$sw/bin - SW_Location=$sw - break - fi -done - -# if none found, try HDF4 software which contains a version of zlib. -if [ x-$SW_Location = x- ]; then - locate_hdf4 -fi - -} - -# Main -# -# Options -# -if [ $# -lt 1 ]; then - USAGE - exit 1 -fi - -if [ "$1" = -h ]; then - USAGE - exit 0 -fi - -SW=$1 -shift - -# locations of the software seeked. -SW_inc= # include place -SW_lib= # library place -SW_bin= # binary place -SW_Location= # parent directory of all the above - -OSname=`uname -s` -OSrelease=`uname -r` - -case $SW in -hdf4|hdf) - locate_hdf4 - ;; -hdf5) - locate_hdf5 - ;; -zlib) - locate_zlib - ;; -*) - echo "unknown software ($SW)" - USAGE - exit 1 - ;; -esac - -# show the results located, separated by commas. -if [ -n "${SW_inc}" -a -n "${SW_lib}" -a -n "${SW_bin}" ]; then - echo ${SW_inc},${SW_lib},${SW_bin} - exit 0 -else - exit 1 -fi diff --git a/bin/release b/bin/release index e71a38e..84555b6 100755 --- a/bin/release +++ b/bin/release @@ -13,24 +13,6 @@ # # Make a release of hdf5. -# -# Programmer: Robb Matzke -# Creation date: on or before 1998-01-29. -# -# Modifications -# Robb Matzke, 1999-07-16 -# The SunOS 5.6 sed *must* have slashes as delimiters. I changed things like -# `sed s+/CVS++' to `sed 's/\/CVS//' -# -# Albert Cheng, 1999-10-26 -# Moved the MANIFEST checking to a separate command file so that -# it can be invoked individually. -# -# Albert Cheng, 2004-08-14 -# Added the --private option. -# -# James Laird, 2005-09-07 -# Added the md5 method. # Function definitions # @@ -38,14 +20,13 @@ USAGE() { cat << EOF -Usage: $0 -d <dir> [--docver BRANCHNAME] [-h] [--nocheck] [--private] <methods> ... - -d DIR The name of the directory where the release(es) should be +Usage: $0 -d <dir> [--docver BRANCHNAME] [-h] [--private] <methods> ... + -d DIR The name of the directory where the release(s) should be placed. --docver BRANCHNAME This is added for 1.8 and beyond to get the correct version of documentation files from the hdf5docs repository. BRANCHNAME for v1.8 should be hdf5_1_8. -h print the help page. - --nocheck Ignore errors in MANIFEST file. --private Make a private release with today's date in version information. This must be run at the top level of the source directory. @@ -100,11 +81,6 @@ EOF # Function name: tar2zip # Convert the release tarball to a Windows zipball. # -# Programmer: Albert Cheng -# Creation date: 2014-04-23 -# -# Modifications -# # Steps: # 1. untar the tarball in a temporary directory; # Note: do this in a temporary directory to avoid changing @@ -167,11 +143,6 @@ tar2zip() # Function name: tar2cmakezip # Convert the release tarball to a Windows zipball with files to run CMake build. # -# Programmer: Larry Knox -# Creation date: 2017-02-20 -# -# Modifications -# # Steps: # 1. untar the tarball in a temporary directory; # Note: do this in a temporary directory to avoid changing @@ -269,10 +240,6 @@ tar2cmakezip() # Function name: tar2cmaketgz # Convert the release tarball to a gzipped tar file with files to run CMake build. # -# Programmer: Larry Knox -# Creation date: 2017-02-20 -# -# Modifications # # Steps: # 1. untar the tarball in a temporary directory; @@ -347,11 +314,6 @@ tar2cmaketgz() # and HDF5options.cmake files for parallel or serial only builds where build # tests are run on compute nodes using batch scripts. # -# Programmer: Larry Knox -# Creation date: 2019-01-28 -# -# Modifications -# # Steps: # 1. untar the tarball in a temporary directory; # Note: do this in a temporary directory to avoid changing @@ -443,7 +405,6 @@ VERS=`perl bin/h5vers` VERS_OLD= test "$VERS" || exit 1 verbose=yes -check=yes release_date=`date +%F` today=`date +%Y%m%d` pmode='no' @@ -482,9 +443,6 @@ while [ -n "$1" ]; do DEST=$1 shift ;; - --nocheck) - check=no - ;; -h) USAGE exit 0 @@ -546,28 +504,10 @@ if [ ! -d $DEST ]; then exit 1 fi -# Check the validity of the MANIFEST file. -bin/chkmanifest || fail=yes -if [ "X$fail" = "Xyes" ]; then - if [ $check = yes ]; then - echo "" - echo "Note! If you are running bin/release in a development branch" - echo "later than v 1.8 the MANIFEST check is expected to fail when" - echo "autogen.sh has not been run successfully. Either run autogen.sh " - echo "with /usr/hdf/bin/AUTOTOOLS at the beginning of PATH or add the" - echo "--nocheck argument to the bin/release command." - exit 1 - else - echo "Continuing anyway..." - fi -fi - -# Create a manifest that contains only files for distribution. -MANIFEST=$tmpdir/H5_MANIFEST -grep '^\.' MANIFEST | grep -v _DO_NOT_DISTRIBUTE_ >$MANIFEST - -# Prepare the source tree for a release. +# Create a symlink to the source so files in the tarball have the prefix +# we want (gnu's --transform isn't portable) ln -s `pwd` $tmpdir/$HDF5_VERS || exit 1 + # Save a backup copy of Makefile if exists. test -f Makefile && mv Makefile $tmpdir/Makefile.x cp -p Makefile.dist Makefile @@ -582,18 +522,14 @@ for f in README.md release_docs/RELEASE.txt; do chmod 644 $f done -# trunk is different than branches. +# develop is different than branches. if [ "${DOCVERSION}" ]; then DOC_URL="$DOC_URL -b ${DOCVERSION}" fi # Create the tar file test "$verbose" && echo " Running tar..." 1>&2 -( \ - cd $tmpdir; \ - tar cf $HDF5_VERS.tar $HDF5_VERS/Makefile \ - `sed 's/^\.\//hdf5-'$VERS'\//' $MANIFEST` || exit 1 \ -) +(cd "$tmpdir" && exec tar -ch --exclude-vcs -f "$HDF5_VERS.tar" "./$HDF5_VERS" || exit 1 ) # Compress MD5file=$HDF5_VERS.md5 @@ -680,4 +616,6 @@ fi # Remove temporary things rm -rf $tmpdir +echo "DONE" + exit 0 diff --git a/bin/runtest b/bin/runtest deleted file mode 100755 index 5e05abb..0000000 --- a/bin/runtest +++ /dev/null @@ -1,966 +0,0 @@ -#! /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://www.hdfgroup.org/licenses. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# - -# run the hdf5/bin/snapshot -# Usage: -# runtest run the test for the local host -# runtest <hostname> run the test for <hostname> -# runtest -all run the test for all predefined hosts -# -# Assumptions in knowing where to find the right scripts to execute. -# 1. assume we are at the top level of the hdf5 source. So, bin/* are -# where the script files are. -# 2. after the cvs update is completed, we can go to the snapshot area -# hdf5 source tree and use the bin/* there. -# 3. Cannot use the snapshot area scripts from the beginning because -# for one, the current directory is renamed as previous right after -# a snapshot release; and for another, some scripts may be changed -# by the cvs update while it is being used. - -# local setup -DEBUGMODE="" -test -n "$DEBUGMODE" && echo "******** DEBUGMODE is $DEBUGMODE ************" -WHEREAMI='pwd' -CMD= - -# the name of this program -PROGNAME="bin/runtest $DEBUGMODE" - -# Setup -HOSTNAME=`hostname | cut -f1 -d.` # no domain part -TODAY=`date +%m%d%a` -WEEKDAY=`date +%a` -H5VER= # default to current CVS version -H5VERSION= # default to current CVS version -n_test=0 # Number of tests ran -n_pass=0 # Number of tests passed -n_fail=0 # Number of tests failed -n_skip=0 # Number of tests skipped - -# Default to do checkout (only once) and test, no release. -# Will run test only if there is significant differences from previous version. -# If srcdir is not used, don't launched multiple tests -SNAPSHOT="${DEBUGMODE:+echo }bin/snapshot" -SRCDIR="srcdir" -# Default standard Snaptest commands -SNAPCMD="$SRCDIR test clean" -# Default Standard snaptest command options -STANDARD_OPT="" -ENABLE_PARALLEL="--enable-parallel" -CONFIGNAME=$HOSTNAME # Name used in the SNAPTESTCFG file - -# test host default as local host. -TESTHOST="" - -################################# -# Function definitions -################################# - -# Print messages to stdout -# Use this to show output heading to stdout -PRINT() -{ - echo "$*" -} - -# Show seconds since midnight. -# This is used to calculate seconds elapsed -SecOfDay() -{ - set `date '+%H %M %S'` - t_sec=`expr $1 \* 3600 + $2 \* 60 + $3` - echo $t_sec -} - -# Calculated the elapsed time (in seconds) between the first -# and second time. If second time is smaller than the first, -# we assume the clock has passed midnight and calculate appropriately. -ElapsedTime() -{ - if [ $2 -lt $1 ]; then - t_sec=`expr 3600 \* 24 - $1 + $2` - else - t_sec=`expr $2 - $1` - fi - echo `expr $t_sec / 60`m `expr $t_sec % 60`s -} - -# Report errors -# $1--an error message to be printed -REPORT_ERR() -{ - ERRMSG=$1 - # print it with a banner shifted right a bit - PRINT " *************************************" - PRINT " `date`" - PRINT " $ERRMSG" - PRINT " *************************************" - # report it in the FAILED-LOG file too - PRINT "$ERRMSG" >> $FAILEDLOG -} - -# -# Report results of the last test done -REPORT_RESULT() -{ - if [ $retcode -eq 0 ]; then - if [ $skiptest = yes ]; then - n_skip=`expr $n_skip + 1` - PRINT "SKIPPED ${HOSTNAME}: $TEST_TYPE" | tee -a $SKIPPEDLOG - else - n_pass=`expr $n_pass + 1` - PRINT "PASSED ${HOSTNAME}: $TEST_TYPE" | tee -a $PASSEDLOG - fi - else - # test failed. - n_fail=`expr $n_fail + 1` - REPORT_ERR "****FAILED ${HOSTNAME}: $TEST_TYPE****" - fi -} - -# Print a blank line -PRINT_BLANK() -{ - PRINT -} - -# Print test trailer -PRINT_TEST_TRAILER() -{ - PRINT "*** finished $TEST_TYPE tests for $HOSTNAME ***" - date; EndTime=`SecOfDay` - PRINT Total time = `ElapsedTime $StartTime $EndTime` - PRINT_BLANK -} - -# Print trailer summary -PRINT_TRAILER() -{ - PRINT "*** finished tests in $HOSTNAME ***" - date; TotalEndTime=`SecOfDay` - PRINT "${HOSTNAME}: Ran $n_test($n_pass/$n_fail/$n_skip) $runtest_type, Grand total test time = " \ - "`ElapsedTime $TotalStartTime $TotalEndTime`" | tee -a $TIMELOG - PRINT_BLANK -} - -# Figure out which remote command to use to reach a host. -# Try ssh first, then rsh since fewer machines support rsh exec. -# $1--hostname to reach. -CHECK_RSH() -{ - # Figure out how to use ping command in this host. - # Some hosts use "ping host count", some use "ping -c count host". - # Test "ping -c 3 -w 5" since it has timeout feature. - # Test "ping -c ..." style before "ping host 3" because some machines - # that recognize -c treat 'ping localhost 3' as to ping host '3'. - if [ -z "$PING" ]; then - if ping -c 3 -w 5 localhost >/dev/null 2>&1; then - PING='ping -c 3 -w 5' - PINGCOUNT= - elif ping -c 3 localhost >/dev/null 2>&1; then - PING='ping -c 3' - PINGCOUNT= - elif ping localhost 3 >/dev/null 2>&1; then - PING=ping - PINGCOUNT=3 - else # don't know how to use ping. - PING=no_ping - PINGCOUNT= - fi - fi - # - host=$1 - # Try remote command with host if it responds to ping. - # Still try it if we don't know how to do ping. - if [ no_ping = "$PING" ] || $PING $host $PINGCOUNT >/dev/null 2>&1; then - if ssh $host -n hostname >/dev/null 2>&1; then - RSH=ssh - elif rsh $host -n hostname >/dev/null 2>&1; then - RSH=rsh - else - PRINT cannot remote command with $host - RSH="NoRemoteCommand" - fi - else - RSH="NotReachable" - fi -} - - -# Wait for a file for at most number of minutes -# $1--the file -# $2--number of minutes -# WAIT_STATUS set to: -# -1 if errors encountered -# 0 if file found within time limit -# 1 if file not found within time limit -WAITFOR() -{ - wait_file=$1 - nminutes=$2 - if [ -z "$wait_file" -o ! "$nminutes" -ge 0 ] - then - PRINT "errors in argument of WAITFOR(): wait_file($1) or nminutes($2)" - WAIT_STATUS=-1 - return - fi - while [ ! -f $wait_file ]; do - if [ $nminutes -gt 0 ]; then - PRINT "Wait For $wait_file to appear" - sleep 60 #sleep 1 minute - else - WAIT_STATUS=1 - return - fi - nminutes=`expr $nminutes - 1` - done - WAIT_STATUS=0 - return -} - - -# Wait till a file disappears for at most number of minutes. -# Useful to wait till a lock is removed by another process. -# $1--the file -# $2--number of minutes -# WAIT_STATUS set to: -# -1 if errors encountered -# 0 if file disappears within time limit -# 1 if file has not disappeared within time limit -WAITTILL() -{ - wait_file=$1 - nminutes=$2 - if [ -z "$wait_file" -o ! "$nminutes" -ge 0 ] - then - PRINT "errors in argument of WAITTILL(): wait_file($1) or nminutes($2)" - WAIT_STATUS=-1 - return - fi - while [ -f $wait_file ]; do - if [ $nminutes -gt 0 ]; then - PRINT "Wait till $wait_file has disappeared" - sleep 60 #sleep 1 minute - else - WAIT_STATUS=1 - return - fi - nminutes=`expr $nminutes - 1` - done - WAIT_STATUS=0 - return -} - - -# Run one snapshot test -# $*--Types of test being run -RUNSNAPTEST() -{ - SNAPCMD_OPT="$STANDARD_OPT" # snapshot test option - SRCDIRNAME=${HOSTNAME} - # restore CC, PATH in case they were changed in the last test. - CC="$CC_SAVED" - PATH=$PATH_SAVED - export PATH # DEC OSF1 needs to export PATH explicitly - TEST_TYPE=$* - retcode=0 - skiptest=no - date - PRINT "*** starting $TEST_TYPE tests in $HOSTNAME ***" - PRINT "Uname -a: `uname -a`" - - # Parse the test type and set options accordingly. - # See comments of SNAPTEST_CONFIG_PARSE(). - while [ $# -gt 0 ]; do - case $1 in - -n32) # want -n32 option - SRCDIRNAME=${SRCDIRNAME}-n32 - CC="cc -n32" - export CC - ;; - -64) # want -64 option - SRCDIRNAME=${SRCDIRNAME}-64 - CC="cc -64" - export CC - ;; - parallel) # want parallel test - SNAPCMD_OPT="$SNAPCMD_OPT $ENABLE_PARALLEL" - SRCDIRNAME=${SRCDIRNAME}-pp - ;; - standard) # standard test - ;; - --*) - # option for configure - SNAPCMD_OPT="$SNAPCMD_OPT $1" - ;; - op-configure) - # option for configure - SNAPCMD_OPT="$SNAPCMD_OPT $1 $2" - shift - ;; - op-snapshot) - # option for snapshot - shift - SNAPCMD_OPT="$SNAPCMD_OPT $1" - ;; - setenv) - # pass them along to snapshot set environment variable - shift - SNAPCMD_OPT="$SNAPCMD_OPT setenv $1 $2" - shift - ;; - setenvN) - # set environment variable with $1 values - # e.g., setenvN 3 x a b c is same as setenv x="a b c". - # pass them along to snapshot set environment variable - shift - envN=$1 - shift - envname=$1 - SNAPCMD_OPT="$SNAPCMD_OPT setenvN $envN $envname" - envalue= - while test $envN -gt 0; do - shift - envalue="$envalue $1" - envN=`expr $envN - 1` - done - SNAPCMD_OPT="$SNAPCMD_OPT $envalue" - ;; - skip) - # skip this test - skiptest=yes - ;; - srcdirname) - # Use this before using parallel and -n32 since this overrides - # the others. - shift - SRCDIRNAME=$1 - ;; - deploy) - # deploy the built binary. - shift - SNAPCMD_OPT="$SNAPCMD_OPT deploy $1" - ;; - deploydir) - # default directory for deployment. - shift - SNAPCMD_OPT="$SNAPCMD_OPT deploydir $1" - ;; - *) # unknown test - PRINT "$0: unknown type of test ($1)" - retcode=1 - ;; - esac - shift - done - - if [ $retcode -ne 0 -o $skiptest = yes ]; then - errcode=$retcode - return $retcode - fi - - # Track down the zlib software - ans=`$SNAPYARD/current/bin/locate_sw zlib` - if [ $? = 0 ]; then - Z_INC=`echo $ans | cut -f1 -d,` - Z_LIB=`echo $ans | cut -f2 -d,` - SNAPCMD_OPT="$SNAPCMD_OPT zlib $Z_INC,$Z_LIB" - else - # cannot locate zlib software. - # continue the test, maybe configure can find it. - : - fi - - if [ -n "${SRCDIRNAME}" ]; then - SNAPCMD_OPT="$SNAPCMD_OPT srcdirname ${SRCDIRNAME}" - fi - - # Setup log file name to save test output - THIS_MINUTE=`date +%H%M` - LOGFILE=${LOGBASENAME}/${SRCDIRNAME}_${TODAY}_${THIS_MINUTE} - PRINT "Running snapshot with output saved in" - PRINT " $LOGFILE" - (date; PRINT Hostname=$HOSTNAME) >> $LOGFILE - - ( - cd $SNAPYARD/current - $SNAPSHOT $SNAPCMD $SNAPCMD_OPT - ) >> $LOGFILE 2>&1 - retcode=$? - [ $retcode -ne 0 ] && errcode=$retcode - - date >> $LOGFILE - if [ $retcode -ne 0 ]; then - # Dump the first 10 lines and the last 30 lines of the LOGFILE. - ( ntail=30 - echo ========================= - echo "Dumping logfile of ${HOSTNAME}: $TEST_TYPE" - echo "Last $ntail lines of $LOGFILE" - echo ========================= - tail -$ntail $LOGFILE - echo ========================= - echo Dumping done - echo ========================= - echo "" - ) >> $FAILEDDETAIL - fi -} - -TIMELIMIT_PARSE() -{ - # Function returns timeparam for timekeeper via standard out - - # any debug statements should be 'echo "Debug string" >&2' or timekeeper - # will declare timeparam to be non-numeric and ignore it. - while read x y ; do - # Scan for entry for this weekday. - xd=`echo $x | cut -f1 -d/` - if [ "$xd" = ${WEEKDAY} ]; then - # strip away the weekday/ part. - timeparam=`echo $x | cut -f2 -d/` - break - fi - case "$x" in - '' | '#'*) - # blank or comment lines. Continue. - ;; - ???/*) - # Ignore any entry not of this weekday. - ;; - *) - timeparam="$x" - ;; - esac - done - echo $timeparam - return -} - -# configuration parsing. -# Taking configuration from input. -# This should be invoke with configure file as stdin. -# Syntax of the configure file: -# All lines started with the # are comment lines and are ignored. -# Blank lines are ignored too. -# Each config line starts with a "Scope" followed by test types. -# -# Scope can be: -# standard ... # what the standard test types are. -# <host>: <test> Do <test> for <host> -# all: <test> Do <test> for all hosts. -# <weekday>/... Use this scope if the <weekday> matches. -# <weekday> can be {Mon,Tue,Wed,Thu,Fri,Sat,Sun} -# If no <host>: input for a <host>, the standard test is used. -# -# Test types: -# standard tests defined in standard scope. -# -n32 -n32 mode. Apply to 64/32 bit OS such as IRIX64. -# parallel parallel mode. -# op-configure <option> configure option -# op-snapshot <option> snapshot option -# --* configure option -# setenv <name> <value> set environment variable <name> to <value> -# Pass along to snapshot -# setenvN <N> <name> <value> ... -# set environment variable with <N> values -# e.g., setenvN 3 x a b c is same as setenv x="a b c". -# Pass along to snapshot. -# skip skip this test -# srcdirname <name> use <name> as the build-directory. -# deploy <name> deploy the built binary at directory <name>. -# deploydir <name> use <name> as the default directory for deployment. -SNAPTEST_CONFIG_PARSE() -{ - while read x y ; do - # Scan for entry for this weekday. - xd=`echo $x | cut -f1 -d/` - if [ "$xd" = ${WEEKDAY} ]; then - # strip away the weekday/ part. - x=`echo $x | cut -f2 -d/` - fi - case "$x" in - '' | '#'*) - # blank or comment lines. Continue. - ;; - ???/*) - # Ignore any entry not of this weekday. - ;; - standard) - #standard configuration - STANDARD_OPT="$y" - ;; - all: | ${CONFIGNAME}:) - # types of test for all hosts or this host - if [ -n "$TEST_TYPES" ]; then - TEST_TYPES="$TEST_TYPES ; $y" - else - TEST_TYPES="$y" - fi - ;; - *:) # ignore types of test for other hosts - ;; - *) # unknown configuration option - PRINT $x $y - PRINT "***Unknown configuration option. Ignored.***" - ;; - esac - done -} - -# Snap Test configuration parsing. -# If TEST_TYPES is not set, set it to do the "standard" test. -SNAPTEST_CONFIG() -{ - TEST_TYPES= - STANDARD_OPT= - if [ -f $SNAPTESTCFG ]; then - SNAPTEST_CONFIG_PARSE < $SNAPTESTCFG - fi - TEST_TYPES=${TEST_TYPES:-'standard'} -} - - -# Show usage page -USAGE() -{ -cat <<EOF -Usage: runtest [-h] [-debug] [-r<version>] [-all] [-nocvs] [-nodiff] [<host> ...] - -h - print this help page - -debug - turn on debug mode - -r<version> - do runtest for <version> - -all - launch tests for all pre-defined testing hosts - -nocvs - do not do cvs commands - -nodiff - do not do diff commands - -setup - setup the directory structure for snapshot test - -configname <name> - use <name> as hostname in the parsing of the snaptest configure file - <host> - launch tests for <host> - --all and <host> are contradictory and whichever is specified last, is -the one to take effect. If neither are given, do the test for the -local host. -EOF -} - - -# Verify if directory ($1) exists. If not, create it. -CHECK_DIR() -{ - dir=$1 - if test ! -e $1; then - echo mkdir $1 - mkdir $1 - errcode=$? - elif test ! -d $1; then - echo $1 is not a directory - errcode=1 - fi -} - - -################################# -# Main -################################# -################################# -# Set up global variables -################################# -retcode=0 # error code of individula task -errcode=0 # error code of the whole test -skiptest=no # if test is skipped -CC_SAVED="$CC" # CC & PATH maybe changed within a test. -PATH_SAVED=$PATH # These save the original values. -timelimit=300 # default time limit (minutes) for the timekeeper - -################################# -# Parse options -################################# -while [ $# -gt 0 ]; do - case "$1" in - -h) # help--show usage - USAGE - exit 0 - ;; - -debug*) - # set debug mode - DEBUGMODE="$1" - SNAPSHOT="echo bin/snapshot" - PROGNAME="$PROGNAME $DEBUGMODE" - PRINT "******** DEBUGMODE is $DEBUGMODE ************" - ;; - -r*) - # version string - H5VER="$1" - ;; - -all) - # Test all hosts. - TESTHOST=-all - ;; - -nocvs) - # do not do cvs commands. - NOCVS=nocvs - ;; - -nodiff) - # do not do diff commands. - NODIFF=nodiff - ;; - -configname) - # use <name> as hostname in the parsing of the snaptest configure file. - shift - CONFIGNAME=$1 - ;; - -setup) - # setup the directory structure for snapshot test. - CMD=setup - ;; - -*) # Unknown option - PRINT "Unknown option ($1)" - USAGE - exit 1 - ;; - *) - TESTHOST=$* - break - ;; - esac - shift -done - -# setup H5VER if not set yet -if [ -z "$H5VER" -a -f bin/snapshot_version ] -then - . bin/snapshot_version -fi - -if [ -n "$H5VER" ] -then - H5VERSION=hdf5_`echo $H5VER | sed -e s/-r// -e s/\\\./_/g` - PROGNAME="$PROGNAME $H5VER" -else - H5VERSION=hdf5 -fi - -################################# -# Setup snapshot test directories -################################# -BASEDIR=${HOME}/snapshots-${H5VERSION} -# initial processing of setup option if requested -if test x-$CMD = x-setup; then - CHECK_DIR $BASEDIR - test $errcode -ne 0 && exit 1 -elif [ ! -d ${BASEDIR} ]; then - echo "BASEDIR ($BASEDIR) does not exist" - exit 1 -fi -# Show the real physical path rather than the symbolic path -SNAPYARD=`cd $BASEDIR && /bin/pwd` -# Log file basename -LOGDIR=${SNAPYARD}/log -LOGBASENAME=${LOGDIR} -PASSEDLOG=${LOGDIR}/PASSED_LOG_${TODAY} -FAILEDLOG=${LOGDIR}/FAILED_LOG_${TODAY} -FAILEDDETAIL=${LOGDIR}/FAILED_DETAIL_${TODAY} -SKIPPEDLOG=${LOGDIR}/SKIPPED_LOG_${TODAY} -TIMELOG=${LOGDIR}/TIME_LOG_${TODAY} -TIMEKEEPERLOG=${LOGDIR}/TIMEKEEPER_LOG_${TODAY} -CVSLOG=${LOGDIR}/CVS_LOG_${TODAY} -CVSLOG_LOCK=${LOGDIR}/CVS_LOG_LOCK_${TODAY} -DIFFLOG=${LOGDIR}/DIFF_LOG_${TODAY} -COPYRIGHT_ERR=${LOGDIR}/COPYRIGHT_ERR_${TODAY} -# Snap Test hosts and Configuration files -ALLHOSTSFILE=${SNAPYARD}/allhostfile -SNAPTESTCFG=${SNAPYARD}/snaptest.cfg -TIMELIMIT=${SNAPYARD}/timelimit -TMPFILE="${LOGDIR}/#runtest.${TODAY}.$$" - -# more processing of setup option if requested -if test x-$CMD = x-setup; then - CHECK_DIR $LOGDIR - test $errcode -ne 0 && exit 1 - CHECK_DIR $LOGDIR/OLD - test $errcode -ne 0 && exit 1 - CHECK_DIR $SNAPYARD/TestDir - test $errcode -ne 0 && exit 1 - # create empty test hosts or configure files if non-existing - for f in $ALLHOSTSFILE $SNAPTESTCFG; do - if test ! -f $f; then - echo Creating $f - touch $f - fi - done - # create or update the current source. - echo update current source - $SNAPSHOT checkout - # setup completed. Exit. - exit 0 -fi - -################################# -# Show some host status numbers -################################# -# df sometimes hangs due to file system problems. Invoke it as background -# process and give it 10 seconds to finish. If it hangs, just continue. -uptime -df & -sleep 10 - -################################# -# Setup test host(s) -################################# -if [ "$TESTHOST" = -all ]; then - if [ -f $ALLHOSTSFILE ]; then - TESTHOST=`sed -e '/^#/d;/^ *$/d' $ALLHOSTSFILE` - else - PRINT "could not access the all-hosts-file ($ALLHOSTSFILE)" - USAGE - exit 1 - fi -fi - - -################################# -# Setup to print a trailer summary when exiting not via -# the normal end of the script. -################################# -trap PRINT_TRAILER 0 - -# -TotalStartTime=`SecOfDay` - -# Process the configuration -SNAPTEST_CONFIG -PRINT STANDARD_OPT=$STANDARD_OPT -PRINT TEST_TYPES=$TEST_TYPES -PRINT_BLANK - -# Do a checkout if one has not been done today. -# Then check MANIFEST file and copyrights noitces. -if [ -z "$NOCVS" ]; then - PRINT "Running CVS checkout with output saved in" - PRINT " $CVSLOG" - # Set CVS lock first - touch $CVSLOG_LOCK - ($SNAPSHOT checkout ) >> $CVSLOG 2>&1 - # Save error code and remove the lock - errcode=$? - rm -f $CVSLOG_LOCK - if [ $errcode -ne 0 ]; then - # test failed. - REPORT_ERR "****FAILED ${HOSTNAME}: CVS checkout****" - exit $errcode - fi - # =================== - # Check MANIFEST file - # =================== - PRINT Checking MAINFEST file ... - (cd $SNAPYARD/current; bin/chkmanifest) > $TMPFILE 2>&1 - errcode=$? - if [ $errcode -eq 0 ]; then - # test passed. - cat $TMPFILE - else - # test failed. - REPORT_ERR "****FAILED ${HOSTNAME}: MANIFEST check****" - ( echo ========================= - echo "MANIFEST checking failed output" - echo ========================= - cat $TMPFILE - echo ========================= - echo "MANIFEST checking failed output done" - echo ========================= - echo "" - ) >> $FAILEDDETAIL - fi - rm $TMPFILE - PRINT_BLANK - # No copyright checking until what need copyright is decided. 2006/4/7. - if false; then - # ====================== - # Check Copyright notice - # ====================== - PRINT Checking Copyrights notices ... - if (cd $SNAPYARD/current; bin/chkcopyright) > $TMPFILE 2>&1 ; then - echo Passed. - else - # Save the output and report some of it. - # Do not report it as failed for runtest yet. - # Send a separate report mail via hardcoding. - # Need fixes/cleanup later. - echo "Failed. See detail in another report mail" - cp $TMPFILE $COPYRIGHT_ERR - nheadlines=300 - ntaillines=5 # Number of lines in report summary. - ( - echo ========================= - echo "Copyright checking failed. Showing first $nheadlines lines of output." - echo "Complete output is in file $COPYRIGHT_ERR" - echo ========================= - nreportlines=`wc -l < $COPYRIGHT_ERR` - if [ $nreportlines -le `expr $nheadlines + $ntaillines` ]; then - # Just print the whole file. - cat $COPYRIGHT_ERR - else - # Show the first $nheadlines plus report summary - head -$nheadlines $COPYRIGHT_ERR - echo ... - tail -$ntaillines $COPYRIGHT_ERR - fi - ) | Mail -s "${H5VERSION} Copyrights check Failed" hdf5lib - fi - rm $TMPFILE - PRINT_BLANK - fi -else - # make sure the cvs update, if done by another host, has completed. - # First wait for the presence of $CVSLOG which signals some host - # has started the cvs update. Then wait for the absence of $CVSLOG_LOCK - # which signals the host has completed the cvs update. - WAITFOR $CVSLOG 90 - if [ $WAIT_STATUS -ne 0 ]; then - errcode=$WAIT_STATUS - REPORT_ERR "****FAILED ${HOSTNAME}: Time expired waiting CVS update to start****" - exit $errcode - fi - WAITTILL $CVSLOG_LOCK 10 - if [ $WAIT_STATUS -ne 0 ]; then - errcode=$WAIT_STATUS - REPORT_ERR "****FAILED ${HOSTNAME}: Time expired waiting CVS update to finish****" - exit $errcode - fi -fi - -# run a snapshot diff to see if any significant differences between -# the current and previous versions -if [ -z "$NODIFF" ]; then - $SNAPSHOT diff >> $DIFFLOG 2>&1 - errcode=$? - # check the errcode only if NOT in DEBUG MODE - if [ -z "$DEBUGMODE" -a $errcode -eq 0 ]; then - # no need to run test - PRINT "NO TEST: no significant differences between current and previous versions" | - tee -a $PASSEDLOG - exit 0 - fi -fi - -# we can use the version of script in SNAPYARD/current now. -# Don't do the diff or cvs update any more. -PROGNAME="$SNAPYARD/current/$PROGNAME -nodiff -nocvs" - -# Decide to do test for the local host or for remote hosts -if [ -n "$TESTHOST" -a $HOSTNAME != "$TESTHOST" ]; then - date - PRINT "*** launching tests from $HOSTNAME ***" - PRINT_BLANK - TEST_TYPE="launching" - cd ${SNAPYARD}/log - # Fork off timekeeper if concurrent tests will be used. - if [ -n "$SRCDIR" ]; then - timelimit=`TIMELIMIT_PARSE < $TIMELIMIT` - ($SNAPYARD/current/bin/timekeeper $timelimit > $TIMEKEEPERLOG 2>&1 &) - PRINT " Fork off timekeeper $timelimit" - fi - runtest_type="hosts" - for h in $TESTHOST; do - # Must do CONFIGNAME before $h got changed by the second cut. - # cut returns the whole string if there is no / in the string - # at all. But that works okay for the CONFIGNAME too. - CONFIGNAME=`echo $h | cut -f2 -d/` - h=`echo $h | cut -f1 -d/` - n_test=`expr $n_test + 1` - TMP_OUTPUT="#${h}_${CONFIGNAME}.out" - (PRINT "==============" - PRINT "Testing $h" - PRINT "==============") > $TMP_OUTPUT - CHECK_RSH $h - # run the remote shell command with output to $TMP_OUTPUT - case "$RSH" in - rsh|ssh) - CMD="$RSH $h -n $PROGNAME -configname $CONFIGNAME" - PRINT $CMD - - # launch concurrent tests only if srcdir is used - if [ -n "$SRCDIR" ]; then - $CMD || REPORT_ERR "****FAILED ${h}: Abnormal exit from runtest****" && PRINT_BLANK & - echo $! > PID.${h}_${CONFIGNAME} - else - $CMD || REPORT_ERR "****FAILED ${h}: Abnormal exit from runtest****" && PRINT_BLANK - fi - ;; - NoRemoteCommand) - PRINT $h does not accept Remote Command "(`date`)" - ;; - NotReachable) - PRINT $h is not reachable "(`date`)" - ;; - *) - PRINT "CHECK_RSH for $h returned unknown result ($RSH)" - ;; - esac >> $TMP_OUTPUT 2>&1 - done - # wait for all launched tests to finish, then cat them back out. - wait - # Pause a moment in case the timekeeper is terminating processes. - wait 30 - for h in $TESTHOST; do - CONFIGNAME=`echo $h | cut -f2 -d/` - h=`echo $h | cut -f1 -d/` - TMP_OUTPUT="#${h}_${CONFIGNAME}.out" - cat $TMP_OUTPUT - # Verify test script did complete by checking the last lines - (tail -5 $TMP_OUTPUT | grep -s 'Grand total' > /dev/null 2>&1) || - (REPORT_ERR "****FAILED ${h}: snaptest did not complete****" && - PRINT_BLANK) - rm -f $TMP_OUTPUT PID.${h}_${CONFIGNAME} - done - exit 0 -fi - -# run the test(s) -# Note that first field is cut without -s but all subsequent cut -# must use -s. If -s is not used at all, a $TEST_TYPES that has -# no ';' (only 1 test), will pass through intact in all cut. That -# results in infinite looping. -# If -s is used with the first field, it will suppress completely -# a $TYPE_TYPES that has no ';' (only 1 tst ). That results in no -# test at all. -# Note that n_test must start as 1. -# -n_test=1 -runtest_type="tests" -TEST="`echo $TEST_TYPES | cut -f$n_test -d';'`" -while [ -n "$TEST" ]; do - StartTime=`SecOfDay` - RUNSNAPTEST $TEST - REPORT_RESULT - PRINT_TEST_TRAILER - - n_test=`expr $n_test + 1` - TEST="`echo $TEST_TYPES | cut -f$n_test -s -d';'`" -done -# dec n_test to show the actual number of tests ran. -n_test=`expr $n_test - 1` - -PRINT_TRAILER - -# disable trailer summary printing since all trailers have been -# printed and we are exiting normally. -trap 0 -exit $errcode diff --git a/bin/snapshot b/bin/snapshot deleted file mode 100755 index 7fcf3ab..0000000 --- a/bin/snapshot +++ /dev/null @@ -1,837 +0,0 @@ -#!/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://www.hdfgroup.org/licenses. -# 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 <<EOF -Usage: $PROGNAME [all] [checkout] [ftp <URL> [diff] [test] [srcdir] [release] [help] - [clean] [distclean] [echo] [deploy <dir>] [deploydir <dir>] - [zlib <zlib_path>] [releasedir <dir>] [srcdirname <dir>] [check-vfd] - [check-passthrough-vol] - [exec <command>] [module-load <module-list>] [op-configure <option>] - [--<option>] - all: Run all commands (checkout, test & release) - [Default is all] - checkout: Run source checkout - diff: Run diff on current and previous versions. Exit 0 if - no significant differences are found. Otherwise, non-zero. - deploy: deploy binary to directory <dir> - deploydir: use <dir> as the default directory for deployment - test: Run test - release: Run release - clean: Run make clean - distclean:Run make distclean - echo: Turn on echo mode (set -x) - setenv <name> <value>: - Set environment variable <name> to <value>. - setenvN <N> <name> <value> ...: - Set environment variable with <N> values. - E.g., setenvN 3 x a b c is same as setenv x="a b c". - 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 chosen. - 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 - echo: Turn on shell echo - zlib <zlib_path>: - Use <zlib_path> as the ZLIB locations - [Default is $ZLIB_default] - releasedir <dir>: - Use <dir> as the release directory - [Default is $ReleaseDir_default] - check-vfd: - Run make check-vfd instead of just make check. - check-passthrough-vol: - Run make check-passthrough-vol instead of just make check. - NOTE: Will only succeed with passthrough VOL connectors - that use the native VOL connector as the terminal - connector. - exttest <testscript>; - Run testscript; - exec <command>: - Run <command>; - module-load <module-list>: - Load modules in comma-separated <module-list>; - op-configure <option>: - Pass <option> to the configure command - E.g., "snapshot op-configure --enable-parallel" - configures for parallel mode - --<option>: - Pass --<option> to the configure command - E.g., "snapshot --enable-parallel" - configures for parallel mode -EOF - exit $errcode -} - -# 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 -SNAPSHOTNAME= -HDFREPOS= -DOCVERSION="" -MODULELIST="" - -if [ -f bin/snapshot_params ]; then - . bin/snapshot_params - echo "Added snapshot_params." -fi -if [ -z "$SWVER" -a -f bin/snapshot_version ] -then - . bin/snapshot_version - echo "Added snapshot_version." -fi -if [ -n ${HDFREPOS} -a -f bin/snapshot-${HDFREPOS}-overrides ]; then - . bin/snapshot-${HDFREPOS}-overrides - echo "Added snapshot-${HDFREPOS}-overrides." -fi - -echo "=====================================" -echo "$PROGNAME $*" -echo "=====================================" -TIMESTAMP MAIN -uname -a - -# setup exit banner message -trap EXIT_BANNER 0 1 2 9 15 - -# Dump environment variables before option parsing -echo ===Dumping environment variables before option parsing === -printenv | sort -echo ===Done Dumping environment variables before option parsing === - -# snapshots release directory. Default relative to $BASEDIR. -ReleaseDir_default=release_dir - -# 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? (md5 does checksum). Doc was apparently -# added as a compression method to create a separate tarfile containing the -# documentation files for v 1.8 and above. -if [ "${SWVERSION}" = "hdf5_1_6" ]; then - METHODS="gzip bzip2 md5" -else - METHODS="gzip bzip2 doc" -fi - -# Use User's MAKE if set. Else use generic make. -MAKE=${MAKE:-make} - -# Default check action. -CHECKVAL=check - -# -# Command options -cmd="all" -test_opt="" -errcode=0 -AUTOGEN="" -EXTTEST="" -EXEC_CMD_ARG="" -while [ $# -gt 0 ] ; do - case "$1" in - all) - cmd="all" - ;; - checkout-autogen) - cmdcheckout="checkout" - AUTOGEN="autogen" - cmd="" - ;; - checkout) - cmdcheckout="checkout" - cmd="" - ;; - ftp) - echo "Setting ftp flags in snapshot script" - cmdcheckout="checkout" - cmdftp="ftp" - cmd="" - shift - if [ $# -lt 1 ]; then - echo "URL missing" - errcode=1 - cmd="help" - break - fi - ftp_url="$1" - echo "ftp_url is $ftp_url" - ;; - diff) - cmddiff="diff" - cmd="" - ;; - deploy) - # deploy the built binary. - shift - if [ $# -lt 1 ]; then - echo "deploy <dir> missing" - errcode=1 - cmd="help" - break - fi - cmddeploy="deploy" - DEPLOYDIRNAME="$1" - ;; - deploydir) - # default directory for deployment. - shift - if [ $# -lt 1 ]; then - echo "deploydir <dir> missing" - errcode=1 - cmd="help" - break - fi - deploydir="$1" - ;; - test) - cmdtest="test" - cmd="" - ;; - setenv) - # set environment variable - shift - eval $1="$2" - export $1 - shift - ;; - setenvN) - # set environment variable with $1 values - # e.g., setenvN 3 x a b c is same as setenv x="a b c". - # a kludge now--the extra single quotes are needed - # else eval complains. - shift - envN=$1 - shift - envname=$1 - envalue= - while test $envN -gt 0; do - shift - envalue="$envalue $1" - envN=`expr $envN - 1` - done - eval $envname="'$envalue'" - export $envname - ;; - srcdir) - #use srcdir option for test - srcdir="yes" - ;; - srcdirname) - shift - if [ $# -lt 1 ]; then - echo "srcdirname <dir> missing" - errcode=1 - cmd="help" - break - fi - SRCDIRNAME="$1" - ;; - release) - cmdrel="release" - cmd="" - ;; - autogen-release) - cmdrel="autogen-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" - ;; - releasedir) - shift - if [ $# -lt 1 ]; then - echo "Release directory name missing" - errcode=1 - cmd="help" - break - fi - ReleaseDir="$1" - ;; - exttest) - shift - if [ $# -lt 1 ]; then - echo "exttest script name missing" - errcode=1 - cmd="help" - break - fi - cmd="" - EXTTEST="$1" - ;; - exec) - shift - if [ $# -lt 1 ]; then - echo "exec command name missing" - errcode=1 - cmd="help" - break - fi - cmd="" - EXEC_CMD_ARG="$@" - # exit the parsing while loop since all arguments have been consumed. - break - ;; - check-vfd) - CHECKVAL=check-vfd - ;; - check-passthrough-vol) - CHECKVAL=check-passthrough-vol - ;; - module-load) - shift - if [ $# -lt 1 ]; then - echo "missing module list to load" - errcode=1 - cmd="help" - break - fi - MODULELIST="$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 "Unknown option $1" - errcode=1 - cmd="help" - break - ;; - esac - shift -done - -if [ -n "$MODULELIST" ]; then - . ~/.bashrc - module use /opt/pkgs/modules/all - # load module command will take a space separated list of modules. - # If we have a comma separated list, convert ',' to ' '. - MODULELIST="$( echo -e "$MODULELIST" | tr ',' ' ' )" - module load $MODULELIST -fi - -# Dump environment variables after option parsing -echo ===Dumping environment variables after option parsing === -printenv | sort -echo ===Done Dumping environment variables after option parsing === - -if [ "$cmd" = help ]; then - DISPLAYUSAGE -fi - -# Setup the proper configure option (--with-zlib) to use zlib library -# provide ZLIB is non-empty. -ZLIB=${ZLIB:+"--with-zlib="$ZLIB} -# Adding --prefix as a configure option will put the path to the deploy -# directory in the initial libhdf5*.la files -if [ -n "$DEPLOYDIRNAME" ]; then - OP_CONFIGURE="$OP_CONFIGURE --prefix=${deploydir}/${DEPLOYDIRNAME}" -fi -CONFIGURE="configure $OP_CONFIGURE" -# echo "Configure command is $CONFIGURE" - -# Execute the requests -snapshot=yes - -BASEDIR=${HOME}/snapshots-${SNAPSHOTNAME} -if [ ! -d ${BASEDIR} ]; then - echo "BASEDIR ($BASEDIR) does not exist" - exit 1 -fi - -CURRENT=${BASEDIR}/current -PREVIOUS=${BASEDIR}/previous -ReleaseDir=${ReleaseDir:=${BASEDIR}/${ReleaseDir_default}} -HOSTNAME=`hostname | cut -f1 -d.` # no domain part - -# Try finding a version of diff that supports the -I option too. -DIFF=diff -for d in `echo $PATH | sed -e 's/:/ /g'` ; do - test -x $d/diff && $d/diff -I XYZ /dev/null /dev/null > /dev/null 2>&1 && - DIFF=$d/diff && break -done - -#============================= -# Run source checkout -#============================= -if [ "$cmd" = "all" -o -n "$cmdcheckout" ]; then - TIMESTAMP "checkout" - # ${BASEDIR}/bin is now updated from git by EveningMaint or DailyMaint - # to avoid updating the scripts in ${BASEDIR}/bin while they are running. - - if [ -z "$AUTOGEN" ]; then - # If there is a Makefile in ${CURRENT}, the last test done in it - # has not been distclean'ed. They would interfere with other - # --srcdir build since make considers the files in ${CURRENT} - # take precedence over files in its own build-directory. Run - # a "make distclean" to clean them all out. This is not really - # part of the "checkout" functions but this is the most convenient - # spot to do the distclean. We will also continue the checkout process - # regardless of the return code of distclean. - ( cd ${CURRENT}; test -f Makefile && ${MAKE} distclean) - fi - # echo "cmdftp is $cmdftp; ftp_url is $ftp_url" - if [ -n "$cmdftp" ]; then - echo "Get the NetCDF4 source from their ftp server." - echo "Command executed is: 2>&1 wget -N $ftp_url" - cd ${BASEDIR}; - WGET_OUTPUT="`2>&1 wget -N $ftp_url`" - errcode=$? - if [[ $errcode -ne 0 ]]; then - exit $errcode - fi - - if [ $? -ne 0 ];then - echo $0: "$WGET_OUTPUT" Exiting. - exit 1 - fi - - # echo "Wget output was $WGET_OUTPUT" - - if echo "$WGET_OUTPUT" | fgrep 'not retrieving' &> /dev/null - then - echo "Snapshot unchanged" - else - echo "New snapshot downloaded" - EXTRACT - fi - else - SOURCE_CHECKOUT - fi -fi # Do source checkout - - -#============================= -# Run Test the HDF5 library -#============================= -if [ "$cmd" = "all" -o -n "$cmdtest" -o -n "$cmddiff" ]; then - TIMESTAMP "Run Tests" - # setup if srcdir is used. - if [ -z "$srcdir" ]; then - TESTDIR=${CURRENT} - else - #create TESTDIR if not exist yet - case "$SRCDIRNAME" in - "") - SRCDIRNAME=$HOSTNAME - ;; - -*) - SRCDIRNAME="$HOSTNAME$SRCDIRNAME" - ;; - esac - TESTDIR=${BASEDIR}/TestDir/${SRCDIRNAME} - test -d ${TESTDIR} || mkdir ${TESTDIR} - # set TESTDIR to use the direct path to the local test directory - # rather than the path through ${BASEDIR}. - cd ${TESTDIR} - TESTDIR=`pwd -P` - cd ${CURRENT} - fi - # Make sure current version exists and is clean - if [ -d ${TESTDIR} ]; then - DISTCLEAN - else - errcode=$? - snapshot=no - exit $errcode - fi - - # Compare it with the previous version. Compare only files listed in - # the MANIFEST plus the MANIFEST itself. - if [ -d ${PREVIOUS} ]; then - if [ -z "${AUTOGEN}" ]; then - CURRENTSRC=${CURRENT} - else - CURRENTSRC=${BASEDIR}/current_src - fi - if (${DIFF} -c ${PREVIOUS}/MANIFEST ${CURRENTSRC}/MANIFEST); then - snapshot=no - for src in `grep '^\.' ${CURRENTSRC}/MANIFEST|expand|cut -f1 -d' '`; do - if ${DIFF} -I H5_VERS_RELEASE -I " released on " \ - -I " currently under development" \ - ${PREVIOUS}/$src ${CURRENTSRC}/$src - then - : #continue - else - snapshot=yes - break - fi - done - fi - fi - - # if diff is chosen, exit 0 if no significant differences are found. - # otherwise, exit 1. This includes cases of other failures. - if [ -n "$cmddiff" ]; then - if [ $snapshot = no ]; then - exit 0 - else - exit 1 - fi - fi - - #============================= - # Execute command if defined - #============================= - #echo BEFORE EXEC command - #echo EXEC_CMD_ARG=${EXEC_CMD_ARG} - - if [ -n "$EXEC_CMD_ARG" ]; then - TIMESTAMP ${EXEC_CMD_ARG} - TESTDIR=${BASEDIR}/TestDir/${SRCDIRNAME} - test -d ${TESTDIR} || mkdir ${TESTDIR} - if cd ${TESTDIR}; then - # clean up the directory before executing the command - # Do we need to clean first? - # rm -rf * - # - # If EXEC_CMD_ARG starts with a '/', it has an absolute path, else it is - # relative to the BASEDIR. - case "$EXEC_CMD_ARG" in - /*) - ${EXEC_CMD_ARG} - ;; - *) - ${BASEDIR}/${EXEC_CMD_ARG} - ;; - esac - errcode=$? - else - echo "${TESTDIR} not accessible" - errcode=1 - fi - # exit snapshot since nothing else to do, for now. - exit $errcode - fi - - # Build, run tests and install procedures - if [ "$snapshot" = "yes" ] && [ "$NOMAKE" != "yes" ]; then - FAIL_SECTION="" - if [ -f ${TESTDIR}/failsection ]; then - rm ${TESTDIR}/failsection - fi - if (cd ${TESTDIR} && \ - TIMESTAMP "configure" && echo "configure" > ${TESTDIR}/failsection && \ - RUNCONFIGURE && \ - sleep 2 && \ - TIMESTAMP "make" && echo "make" > ${TESTDIR}/failsection && \ - ${MAKE} && DISKUSAGE \ - TIMESTAMP ${CHECKVAL} && echo "make check" > ${TESTDIR}/failsection && \ - ${MAKE} ${CHECKVAL} && DISKUSAGE \ - TIMESTAMP "install" && echo "make install" > ${TESTDIR}/failsection && \ - ${MAKE} install && DISKUSAGE \ - TIMESTAMP "check-install" && echo "make check-install" > ${TESTDIR}/failsection && \ - CHECKINSTALL && DISKUSAGE \ - TIMESTAMP "uninstall" && echo "make uninstall" > ${TESTDIR}/failsection && \ - ${MAKE} uninstall && DISKUSAGE); then - : - else - errcode=$? - FAIL_SECTION=`cat ${TESTDIR}/failsection` - echo "Failed running ${FAIL_SECTION}" - snapshot=no - exit $errcode - fi - elif [ $CPSRC ]; then - cp -pr ${CURRENT}/* ${TESTDIR} - else - cmdclean="" - fi -fi # Test the HDF5 library - -# Run external test if configured - -#============================= -#============================= -#if [ -d "$CURRENT" ]; then -if [ "$EXTTEST" != "" ]; then - TIMESTAMP ${EXTTEST} - TESTDIR=${BASEDIR}/TestDir/${SRCDIRNAME} - test -d ${TESTDIR} || mkdir ${TESTDIR} - cd ${TESTDIR} - sleep 1 - TIMESTAMP $pwd - ls - ${BASEDIR}/${EXTTEST} - errcode=$? - exit $errcode -fi - -#============================= -# Run deployment if requested. -#============================= -if [ -n "$DEPLOYDIRNAME" ]; then - # The daily tests deploy to .../hdf5/... or .../hdf4/... except on cobalt where the - # deploy directory is in .../HDF5/... lc will take care of this. If hdf4 or hdf5 - # either upper or lower case isn't in the path, RELEASE.txt won't be found unless - # it is in $CURRENT. - POS4=`perl -e "print index(lc(\"${deploydir}/${DEPLOYDIRNAME}\"), 'hdf4')"` - POS5=`perl -e "print index(lc(\"${deploydir}/${DEPLOYDIRNAME}\"), 'hdf5')"` - if [ "${POS4}" -ge "0" ]; then - RELEASE_TXT_LOC="release_notes" - elif [ "${POS5}" -ge "0" ]; then - RELEASE_TXT_LOC="release_docs" - else - RELEASE_TXT_LOC="" - fi - - if [ "$snapshot" = "yes" ]; then - TIMESTAMP "deploy" - if (cd ${TESTDIR} && - ${BASEDIR}/bin/deploy ${deploydir}/${DEPLOYDIRNAME} && \ - TIMESTAMP "clean" && \ - ${MAKE} clean && \ - TIMESTAMP "check-install prefix=${deploydir}/${DEPLOYDIRNAME}" && \ - CHECKINSTALL prefix=${deploydir}/${DEPLOYDIRNAME}); then - cd ${CURRENT} - cp ${RELEASE_TXT_LOC}/RELEASE.txt ${deploydir}/${DEPLOYDIRNAME} - cp COPYING ${deploydir}/${DEPLOYDIRNAME} - #: #continue - else - errcode=$? - exit $errcode - fi - fi -fi # Deploy - - -#============================= -# Run Release snapshot, update version, and commit to source repository -#============================= -if [ "$cmd" = "all" -o -n "$cmdrel" ]; then - if [ "$snapshot" = "yes" ]; then - TIMESTAMP "release" - DISTCLEAN - ( - # Turn on exit on error in the sub-shell so that it does not - # commit source if errors encounter here. - set -e - if [ "$cmdrel" = "autogen-release" ]; then - cd ${BASEDIR}/current_src - else - cd ${CURRENT} - fi - if [ "$HDFREPOS" = "hdf4" ]; then - RELEASE_VERSION="`perl bin/h4vers -v`" - echo "Making snapshot release ($RELEASE_VERSION) to ${ReleaseDir}..." - bin/release -d $ReleaseDir $METHODS - perl bin/h4vers -i - elif [ "$HDFREPOS" = "hdf5" ]; then - RELEASE_VERSION="`perl bin/h5vers -v`" - echo "Making snapshot release ($RELEASE_VERSION) to ${ReleaseDir}..." - if [ "${DOCVERSION}" ]; then - bin/release -d $ReleaseDir --docver ${DOCVERSION} $METHODS - else - bin/release -d $ReleaseDir $METHODS - fi - perl bin/h5vers -i - else - echo "need real release steps. For now, only move current version to previous" - fi - COMMITSNAPSHOT - ) - errcode=$? - fi - - # Replace the previous version with the current version. - # Should check if the errcode of the release process but there - # are other failures after release was done (e.g. h5vers or git failures) - # that should allow the replacement to occur. - rm -rf ${PREVIOUS} - mv ${CURRENT} ${PREVIOUS} -fi #Release snapshot - - -#============================= -# Clean the test area. Default is no clean. -#============================= -if [ -n "$cmdclean" ] && [ "$NOMAKE" != "yes" ]; then - TIMESTAMP "clean" - # 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 - # clean it - if (cd ${TESTDIR} && ${MAKE} $cmdclean ) then - : - else - errcode=$? - snapshot=no - exit $errcode - fi -fi # Clean the Test directory - -exit $errcode diff --git a/bin/snapshot_version b/bin/snapshot_version deleted file mode 100644 index da2e190..0000000 --- a/bin/snapshot_version +++ /dev/null @@ -1,19 +0,0 @@ -# -# 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://www.hdfgroup.org/licenses. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# - -# default version for snapshot test -# H5VERSION matches with a source version symbolic name. Will test use the -# latest revision of that branch. If set to "hdf5", it uses the main -# version. -# H5VER tells runtest which version to run -H5VERSION=hdf5 diff --git a/bin/timekeeper b/bin/timekeeper deleted file mode 100755 index 03bc8d5..0000000 --- a/bin/timekeeper +++ /dev/null @@ -1,129 +0,0 @@ -#!/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://www.hdfgroup.org/licenses. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -## -# As a time keeper of the remote daily test process launched by runtest. -# It sleeps for a certain time and then wakes up to hangup those processes -# that are still around, assuming they have run too long. -# -# Programmer: Albert Cheng -# Created Date: 2004/12/23 - -# variable initialization -waitminutes=300 # default to 5 hours == 300 minutes -debugtimelimit= -debugflag= # no debug - -# Function definitions -# -# PRINTMSG -# Print a one line message left justified in a field of 70 characters -# without newline. More output for this line later. -# -PRINTMSG() { - SPACES=" " - echo "$* $SPACES" | cut -c1-70 | tr -d '\012' -} - - -USAGE() -{ - echo "Usage: %0 [-h] [-debug] [<time-limit>]" - echo " Run timekeeper with <time-limit> minutes, default is $waitminutes." - echo " If <time-limit> is in the form of HH:MM, it means wait till then." - echo " -h print this help page" - echo " -debug run debug mode" -} - - -ParseOption() -{ - if [ $# -gt 0 -a "$1" = -h ]; then - shift - USAGE - exit 0 - fi - if [ $# -gt 0 -a "$1" = -debug ]; then - shift - debugflag=yes - waitminutes=1 # use shorter time for debug - fi - if [ $# -gt 0 ]; then - targettime=$1 - shift - - # find out it is minutes to wait or HH:MM to wake up - case $targettime in - *:*) # HH:MM - currenttime=`date +%H:%M` - currenthour=`echo $currenttime | cut -f1 -d:` - currentminute=`echo $currenttime | cut -f2 -d:` - targethour=`echo $targettime | cut -f1 -d:` - targetminute=`echo $targettime | cut -f2 -d:` - waitminutes=`expr \( $targethour - $currenthour \) \* 60 + $targetminute - $currentminute` - if test $waitminutes -le 0; then - # target time is in tomorrow, add 1 day of minutes - waitminutes=`expr 24 \* 60 + $waitminutes` - fi - ;; - *) - waitminutes=$targettime - ;; - esac - fi -} - - -# Main body -echo "Timekeeper started at `date`" -ParseOption $* -waitperiod=`expr $waitminutes \* 60` # convert to seconds - -if [ -z "$debugflag" ]; then - # normal time keeping mode - # sleep first - echo Timekeeper sleeping for $waitperiod seconds - sleep $waitperiod - # Look for any processes still around - echo "Timekeeper woke up at `date`, looking for processes to terminate..." - for x in PID.* ; do - if [ -f $x ]; then - pid=`cat $x` - # check if process is still around - if test X$pid \!= X && ps -p $pid > /dev/null; then - echo "terminating process $x ($pid)" - kill -HUP $pid - echo "Remote shell command ended. But some processes might still be" - echo "running in the remote machine. Login there to verify." - fi - fi - done -else - # Debug mode. Launch two rsh process, one ends before, the other after - # waitperiod. Must launch timekeeper from a subshell, else the debug - # will wait for it too. - myhostname=`hostname` - ( $0 $waitminutes &) - debugtimelimit=`expr $waitperiod - 10` - echo rsh $myhostname sleep $debugtimelimit - rsh $myhostname sleep $debugtimelimit & - echo $! > PID.before - debugtimelimit=`expr $waitperiod + 10` - echo rsh $myhostname sleep $debugtimelimit - rsh $myhostname sleep $debugtimelimit & - echo $! > PID.after - - wait - rm PID.before PID.after -fi - -echo "Timekeeper ended at `date`" |