Skip to content
Commits on Source (5)
# 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.
## ------------------ ##
## User Preferences. ##
## ------------------ ##
begin-language: "Autoconf"
args: --no-cache
end-language: "Autoconf"
# 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.
# Initialization files for the Copyright Checker, chkcopyright.
# Each line is a keyword for action and the rest are values.
# Keywords:
# '#' Comments
# skip Files to be skipped
# prune Directories to be skipped. Notice this prunes all directories
# with the same name. E.g.,
# "prune test" skips test, fortran/test, c++/test, ...
# Skip COPYING since it is the detail Copyright notice.
skip COPYING
# Sort of strange to have a copyright notice in README
skip README
# Non-UI copyrighted files in top-level
skip aclocal.m4
# Non-UI copyrighted files in bin.
skip config.guess
skip config.sub
skip depcomp
skip install-sh
skip ltmain.sh
skip missing
skip mkinstalldirs
# Generated files in top-level
skip configure
# Generated files in src.
skip H5config.h.in
# Generated files in fortran/src.
skip H5match_types.c
skip H5test_kind.f90
# Ignore this expected output file in windows/examples.
skip testExamples_exp_output.txt
# Skip all testfiles/* since if we insert a copyright notice in the expected
# data files, we would have to spend extra effort to filter them out.
prune testfiles
The daily tests run copies of some of the scripts in this directory from another repository, notably snapshot and runtest. The copies in this directory should work, but are not used in daily tests, though they should be tested occasionally.
#!/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.
#
# 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.
#
# 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.
# Function definitions
#
# Print Usage page
USAGE()
{
cat << EOF
Usage: $0 -d <dir> [--docver BRANCHNAME] [-h] [--nocheck] [--private] <methods> ...
-d DIR The name of the directory where the releas(es) 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.
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.
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.
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.
Examples:
$ bin/release -d /tmp
/tmp/hdf5-1.8.13-RELEASE.txt
/tmp/hdf5-1.8.13.md5
/tmp/hdf5-1.8.13.tar
$ bin/release -d /tmp gzip
/tmp/hdf5-1.8.13-RELEASE.txt
/tmp/hdf5-1.8.13.md5
/tmp/hdf5-1.8.13.tar.gz
$ bin/release -d /tmp tar gzip zip
/tmp/hdf5-1.8.13-RELEASE.txt
/tmp/hdf5-1.8.13.md5
/tmp/hdf5-1.8.13.tar
/tmp/hdf5-1.8.13.tar.gz
/tmp/hdf5-1.8.13.tar.zip
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 temporay directory;
# Note: do this in a temporary directory to avoid changing
# the original source directory which maybe around.
# 2. convert all its text files to DOS (LF-CR) style;
# 3. form a zip file which is usable by Windows users.
#
# Parameters:
# $1 version
# $2 release tarball
# $3 output zipball file name
#
# Returns 0 if successful; 1 otherwise
#
tar2zip()
{
if [ $# -ne 3 ]; then
echo "usage: tar2zip <tarfilename> <zipfilename>"
return 1
fi
ztmpdir=/tmp/tmpdir$$
mkdir -p $ztmpdir
version=$1
tarfile=$2
zipfile=$3
# step 1: untar tarball in ztmpdir
(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
fi
# step 2: convert text files
# There maybe a simpler way to do this.
# options used in unix2dos:
# -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
# step 3: make zipball
# -9 maximum compression
# -y Store symbolic links as such in the zip archive
# -r recursive
# -q quiet
(cd $ztmpdir; zip -9 -y -r -q $version.zip $version)
mv $ztmpdir/$version.zip $zipfile
# cleanup
rm -rf $ztmpdir
}
# 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
fi
# Defaults
DEST=releases
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
DOC_URL=https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5doc.git
CPPLUS_RM_NAME=cpplus_RM
# Restore previous Version information
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=
fi
}
# Command-line arguments
while [ -n "$1" ]; do
arg=$1
shift
case "$arg" in
-d)
DEST=$1
shift
;;
--nocheck)
check=no
;;
-h)
USAGE
exit 0
;;
--private)
pmode=yes
;;
--revision)
revmode=yes
;;
--docver)
DOCVERSION=$1
shift
;;
-*)
echo "Unknown switch: $arg" 1>&2
USAGE
exit 1
;;
*)
methods="$methods $arg"
;;
esac
done
# Default method is tar
if [ "X$methods" = "X" ]; then
methods="tar"
fi
# Create the temporay work directory.
if mkdir $tmpdir; then
echo "temporary work directory for release. "\
"Can be deleted after release completes." > $tmpdir/README
else
echo "Failed to mkdir tmpdir($tmpdir)"
exit 1
fi
# setup restoration in case of abort.
trap RESTORE_VERSION 0
if [ X$pmode = Xyes ]; then
VERS_OLD=$VERS
# Copy old version of config/lt_vers.am, since it's hard to
# "undo" changes to it.
cp config/lt_vers.am $tmpdir
# Set version information to m.n.r-of$today.
# (h5vers does not correctly handle just m.n.r-$today.)
VERS=`echo $VERS | sed -e s/-.*//`-of$today
echo Private release of $VERS
bin/h5vers -s $VERS
fi
if [ X$revmode = Xyes ]; then
VERS_OLD=$VERS
echo "Save old version $VERS_OLD for restoration later."
# Copy old version of config/lt_vers.am, since it's hard to
# "undo" changes to it.
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.
# (h5vers does not correctly handle just m.n.r-$today.)
VERS=`echo $VERS | sed -e s/-.*//`-$revision
echo Private release of $VERS
bin/h5vers -s $VERS
HDF5_VERS=hdf5-$branch-$revision
# use a generic directory name for revision releases
HDF5_IN_VERS=hdfsrc
else
# Store hdf5-$VERS ("hdf5-1.7.51", e.g.) to a variable to avoid typos
HDF5_VERS=hdf5-$VERS
# directory name matches tar file name for non-revision releases
HDF5_IN_VERS=$HDF5_VERS
fi
test "$verbose" && echo "Releasing $HDF5_VERS to $DEST" 1>&2
if [ ! -d $DEST ]; then
echo " Destination directory $DEST does not exist" 1>&2
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
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
# Update README.txt and release_docs/RELEASE.txt with release information in
# line 1.
for f in README.txt release_docs/RELEASE.txt; do
echo "HDF5 version $VERS released on $release_date" >$f.x
sed -e 1d $f >>$f.x
mv $f.x $f
# Make sure new files are of the right access mode
chmod 644 $f
done
# trunk 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 \
)
# 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)
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
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
;;
esac
done
# Copy the RELEASE.txt to the release area.
cp release_docs/RELEASE.txt $DEST/$HDF5_VERS-RELEASE.txt
# Remove distributed Makefile and restore previous Makefile if existed.
rm -f Makefile
test -f $tmpdir/Makefile.x && mv $tmpdir/Makefile.x Makefile
# Restore OLD version information, then no need for trap.
if [ X$pmode = Xyes ] || [ X$revmode = Xyes ]; then
echo "Restore the original version $VERS_OLD"
RESTORE_VERSION
trap 0
fi
# Remove temporary things
rm -rf $tmpdir
exit 0
#!/usr/bin/perl -w
#
# 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.
#
require 5.003;
# Purpose: insures that API functions aren't called internally.
# Usage: checkapi H5*.c
my $filename = "";
my $lastname = "";
if(<>) {
while (<>) {
if($ARGV =~ /\//) {
($filename) = ($ARGV =~ /^.*\/([A-Za-z0-9_]*)\.c$/);
} else {
($filename) = ($ARGV =~ /([A-Za-z0-9_]*)\.c$/);
}
if($filename =~ /H5FDmulti|H5FDstdio/) {
if($filename ne $lastname) {
print "$ARGV is exempt from checking\n";
$lastname = $filename;
}
} else {
# Get rid of comments by removing the inside part.
s|/\*.*?\*/||g;
if ($in_comment) {
if (/\*\//) {
s|.*?\*/||;
$in_comment = 0;
} else {
$_="\n";
}
} elsif (m|/\*|) {
s|/\*.*||;
$in_comment = 1;
}
# Remove character strings
s/\\.//g; # remove escaped characters
s/\".*?\"//g; # remove string constants
# Disregard the following hits
next if /^H5/;
next if /^\#/;
next if /FUNC_ENTER(_NOINIT)*/;
next unless /(H5[A-Z]{1,2}[a-z]\w*)/;
print "$ARGV:$.: $1\n";
}
} continue {
close ARGV if eof; # reset line number
}
}
#!/usr/bin/perl -w
require 5.003;
#
# 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.
#
# Robb Matzke, matzke@llnl.gov
# 30 Aug 1997
#
# Purpose: Given the names of C source files this script will print the
# file name, line number, and function name of any function that
# doesn't begin with the letter `h' or `H' as stipulated by the
# HDF5 programming style guide.
#
# Emacs users can run this script as the compile command and
# use `next-error' (usually bound to M-`) to find each name
# violation.
if(<>) {
if($ARGV =~ /\//) {
($filename) = ($ARGV =~ /^.*\/([A-Za-z0-9_]*)\.c$/);
} else {
($filename) = ($ARGV =~ /([A-Za-z0-9_]*)\.c$/);
}
if($filename =~ /H5FDmulti|H5FDstdio/) {
print "$ARGV is exempt from using Standard library macro wrappers\n";
} else {
while (<>) {
# Get rid of comments by removing the inside part.
s|/\*.*?\*/||g;
if ($in_comment) {
if (/\*\//) {
s|.*?\*/||;
$in_comment = 0;
} else {
$_="\n";
}
} elsif (m|/\*|) {
s|/\*.*||;
$in_comment = 1;
}
# Get rid of string constants if they begin and end on this line.
s/([\'\"])([^\1]|\\\1)*?\1/$1$1/g;
# Get rid of preprocessor directives
s/^\#.*//;
# Skip callbacks invoked as methods in a struct
next if $_ =~ /\b(\)?->|\.)\(?([a-z_A-Z]\w*)\s*\(/;
# Now find all function calls on this line which don't start with 'H'
while (($name)=/\b([a-z_A-GI-Z]\w*)\s*\(/) {
$_ = $';
# Ignore C statements that look sort of like function
# calls.
next if $name =~ /^(if|for|offsetof|return|sizeof|switch|while|void)$/;
# Ignore things that get misdetected because of the simplified
# parsing that takes place here.
next if $name =~ /^(int|herr_t|_term_interface)$/;
# 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)?(_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)$/;
next if $name =~ /^(ABS|ADDR_OVERFLOW|ALL_MEMBERS|BOUND|CONSTR|DETECT_[I|F|M]|DOWN)$/;
next if $name =~ /^(MIN3?|MAX3?|NELMTS|POWER_OF_TWO|REGION_OVERFLOW)$/;
next if $name =~ /^(UNIQUE_MEMBERS)$/;
next if $name =~ /^addr_defined$/;
# These functions/macros are exempt.
next if $name =~ /^(main|[fs]?printf|va_(start|arg|end))$/;
# These are Windows system calls. Ignore them.
next if $name =~ /^(_get_osfhandle|GetFileInformationByHandle|SetFilePointer|GetLastError|SetEndOfFile)$/;
next if $name =~ /^(FindNextFile|FindClose|_tzset|Wgettimeofday|GetSystemTimeAsFileTime|Wgetlogin|GetUserName)$/;
# These are MPI function calls. Ignore them.
next if $name =~ /^(MPI_|MPE_)/;
# These are POSIX threads function calls. Ignore them.
next if $name =~ /^pthread_/;
# These are Windows threads function calls. Ignore them.
next if $name =~ /^(_beginthread|(Initialize|Enter|Leave)CriticalSection|TlsAlloc)$/;
# These are zlib & szlib function calls. Ignore them.
next if $name =~ /^(inflate|SZ_)/;
next if $name =~ /^compress2$/;
print "$ARGV:$.: $name\n";
}
} continue {
close ARGV if eof; # reset line number
}
}
}
#!/bin/sh
##
## 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.
##
# Check that all the configure files are properly generated.
#
# Programmer: Albert Cheng
# Created Date: 2004/12/07
#
# Configure: should be generated by autoconf version 2.69.
# autoconf: should be of version 2.69.
# variable initialization
nerrors=0
AUTOCONFVERSION=2.69
AUTOCONFVERSIONLEAD='Generated by GNU Autoconf'
CONFIGUREFILES="configure"
# 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'
}
# print result passed.
PASSED() {
echo " PASSED"
}
# print result failed.
FAILED() {
echo "*FAILED*"
}
# Main body
# Check configure files
# The autoconf version should be among the first 5 lines.
echo "Check autoconf version. Should be version $AUTOCONFVERSION"
for xf in $CONFIGUREFILES; do
PRINTMSG $xf
if [ ! -f $xf ]; then
FAILED
echo File not found
nerrors=`expr $nerrors + 1`
continue
fi
autoconf_version=`head -5 $xf | grep "$AUTOCONFVERSIONLEAD"`
echo $autoconf_version | grep "$AUTOCONFVERSIONLEAD $AUTOCONFVERSION" > /dev/null 2>&1
if [ $? -eq 0 ]; then
PASSED
else
FAILED
echo "Expected: $AUTOCONFVERSIONLEAD $AUTOCONFVERSION"
echo "Got: $autoconf_version"
nerrors=`expr $nerrors + 1`
fi
done
# Summary
echo $0 found $nerrors errors
if [ $nerrors != 0 ]; then
exit 1
fi
exit 0
This diff is collapsed.
# Top-level distributed Makefile -*- makefile -*-
#!/usr/bin/perl
#
# Copyright by The HDF Group.
# Copyright by the Board of Trustees of the University of Illinois.
# All rights reserved.
......@@ -10,26 +10,29 @@
# 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 Makefile is a stub (copied from Makefile.dist) which will run
# configure and then invoke the same target in the new Makefile created
# by configure.
# Uncomment this variable if your make(1) doesn't set it automatically.
#
#MAKE=make
SHELL=/bin/sh
all lib progs check test _test install uninstall dep depend: _config
$(MAKE) $@
clean mostlyclean distclean maintainer-clean TAGS: _config
$(MAKE) $@
_config:
sh configure
.PHONY: all lib progs test install uninstall dep depend clean mostlyclean \
distclean maintainer-clean _config
require 5.003;
# Looks for lines emitted by H5O_open() and H5O_close() and tries to
# determine which objects were not properly closed.
while (<>) {
next unless /^([<>])(0x[\da-f]+|\d+)$/;
my ($op, $addr) = ($1, $2);
if ($op eq ">") {
# Open object
$obj{$addr} += 1;
} else {
# Close object
die unless $obj{$addr}>0;
$obj{$addr} -= 1;
delete $obj{$addr} unless $obj{$addr};
}
}
for (sort keys %obj) {
printf "%3d %s\n", $obj{$_}, $_;
}
exit 0;
#!/usr/local/bin/perl -w
require 5.003;
use Text::Tabs;
# NOTE: THE FORMAT OF HRETURN_ERROR AND HGOTO_ERROR MACROS HAS
# CHANGED. THIS SCRIPT NO LONGER WORKS! --rpm
# 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.
#
# Robb Matzke, matzke@llnl.gov
# 30 Aug 1997
#
# Purpose: This script will read standard input which should be a
# function prologue followed by a C function and will emit
# on standard output the same source code with the function
# prologue containing documentation for the various errors
# that occur in the function.
#
# Errors are raised by calling HGOTO_ERROR() or
# HRETURN_ERROR(). The reason for the error message is a
# comment which appears immediately after the error macro
# call and is contained entirely on one line:
#
# HRETURN_ERROR (...); /*entry not found*/
#
# If such a comment doesn't exist, then the previous comment
# is used, subject to the constraint that raising an error
# clears the previous comment.
#
# /* Entry not found */
# HGOTO_ERROR (...);
#
# Emacs users can use this script interactively with the
# c-mark-function and shell-command-on-region functions which
# are normally bound to M-C-h and M-|.
# Split STDIN into the prolog and the function body. Preserve leading
# white space.
$_ = join "", <STDIN>;
my ($head, $prolog, $body) = (/^(\s*)(\/\*(.*?)\*\/)?(.*)/s)[0,2,3];
$prolog = "" unless $prolog;
# Find each error and the comment that goes with it.
for ($_=$body,$comment=""; /\/\*|H(RETURN|GOTO)_ERROR/s;) {
$_ = $&.$';
if (/^H(RETURN|GOTO)_ERROR\s*\(\s*H5E_(\w+)\s*,\s*H5E_(\w+)\s*,/s) {
($major, $minor, $_) = ($2, $3, $');
$comment=$1 if /^.*?\)\s*;\s*\/\*\s*(.*?)\s*\*\//;
$comment =~ s/^\s*\*+\s*/ /mg; # leading asterisks.
$comment =~ s/^\s+//s; # leading white space.
$comment =~ s/\s+$//s; # trailing white space.
$comment =~ s/(\w)$/$1./s; # punctuation.
$comment ||= "***NO COMMENT***";
$errors{"$major\000$minor\000\u$comment"} = 1;
$comment = "";
} else {
($comment) = /^\/\*\s*(.*?)\s*\*\//s;
$_ = $';
}
}
# Format an error so it isn't too wide.
sub fmt_error ($) {
local ($_) = @_;
my ($prefix,$space,$err) = /^((.*?)([A-Z_0-9]+\s+[A-Z_0-9]+\s+))/;
$_ = $';
tr/\n / /s;
my $w = 70 - length expand $prefix;
s/(.{$w}\S+)\s+(\S)/$1."\n".$space.' 'x(length $err).$2/eg;
return $prefix . $_."\n";
}
# Sort the errors by major, then minor, then comment. Duplicate
# triplets have already been removed.
sub by_triplet {
my ($a_maj, $a_min, $a_com) = split /\000/, $a;
my ($b_maj, $b_min, $b_com) = split /\000/, $b;
$a_maj cmp $b_maj || $a_min cmp $b_min || $a_com cmp $b_com;
}
@errors = map {sprintf "%-9s %-13s %s\n", split /\000/}
sort by_triplet keys %errors;
# Add the list of errors to the prologue depending on the type of
# prolog.
if (($front, $back) = $prolog=~/^(.*?Errors:\s*?(?=\n)).*?\n\s*\*\s*\n(.*)/s) {
#| * Errors: |#
#| * __list_of_error_messages__ (zero or more lines) |#
#| * |#
print $head, "/*", $front, "\n";
map {print fmt_error " *\t\t".$_} @errors;
print " *\n", $back, "*/", $body;
} elsif (($front,$back) = $prolog =~
/(.*?\n\s*ERRORS:?\s*?(?=\n)).*?\n\s*\n(.*)/s) {
#| ERRORS |#
#| __list_of_error_messages__ (zero or more lines) |#
#| |#
print $head, "/*", $front, "\n";
map {print fmt_error " ".$_} @errors;
print "\n", $back, "*/", $body;
} elsif ($prolog eq "") {
# No prolog present.
print $head;
print " \n/*", "-"x73, "\n * Function:\t\n *\n * Purpose:\t\n *\n";
print " * Errors:\n";
map {print fmt_error " *\t\t".$_} @errors;
print " *\n * Return:\tSuccess:\t\n *\n *\t\tFailure:\t\n *\n";
print " * Programmer:\t\n *\n * Modifications:\n *\n *", '-'x73, "\n";
print " */\n", $body;
} else {
# Prolog format not recognized.
print $head, "/*", $prolog, "*/\n\n";
print "/*\n * Errors returned by this function...\n";
map {print fmt_error " *\t".$_} @errors;
print " */\n", $body;
}
#! /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.
# A script to generate coverage files for HDF5 using gcov.
# Configures, builds, and runs tests in-place; the output files will be placed
# in a directory called gcov_logs.
# Must be invoked from the root hdf5 directory.
# This script has been tested on kagiso.
CFLAGS="$CFLAGS -ftest-coverage -fprofile-arcs"
export CFLAGS
LDFLAGS="$LDFLAGS -lgcov"
export LDFLAGS
CC=gcc
export CC
./configure
make
make check
mkdir gcov_logs
cd src
for j in *.h *.c
do
ln -s ../$j .libs/$j
done
cd .libs
for j in *.gcda
do
gcov -b $j >> gcov.log 2>&1
done
for j in *.gcov
do
mv $j ../../gcov_logs
done
mv gcov.log ../../gcov_logs
for j in *.c *.h
do
rm $j
done
cd ../..
#! /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.
#
## Remove paths to libraries used to build HDF5 when packaging HDF5
## binaries.
## For help page, use "h5rmflags -help"
# Constants definitions
EXIT_SUCCESS=0
EXIT_FAILURE=1
# Function definitions
# show help page
usage() {
# A wonderfully informative "usage" message.
echo "usage: $prog_name [OPTIONS]"
echo " OPTIONS:"
echo " -help|help This help message"
echo " -echo Show all the shell commands executed"
echo " -force No prompt, just do it"
echo " -prefix=DIR New directory to find HDF5 lib/ and include/"
echo " subdirectories [default: current directory]"
echo " -tool=TOOL Tool to update. TOOL must be in the current"
echo " directory and writable. [default: $h5tools]"
echo " -show Show the commands without executing them"
echo " "
exit $EXIT_FAILURE
}
# display variable values
dump_vars(){
echo "====Showing all variable values====="
echo prefix=$prefix
echo h5tools=$h5tools
echo "====End Showing====="
}
# show actions to be taken
show_action()
{
echo "Update the following tools because they are now installed at a new directory"
for t in $foundtools; do
echo "${t}:"
echo " current setting=`sed -e '/^prefix=/s/prefix=//p' -e d $t`"
echo " new setting="\""$prefix"\"
done
}
# Report Error message
ERROR()
{
echo "***ERROR***"
echo "$1"
}
# Main
#
# Initialization
h5tools="h5cc h5pcc h5fc h5pfc h5c++" # possible hdf5 tools
foundtools= # tools found and will be modified
fmode= # force mode, default is off
prefix=`(cd ..;pwd)`
# Parse options
for arg in $@ ; do
case "$arg" in
-prefix=*)
prefix="`expr "$arg" : '-prefix=\(.*\)'`"
;;
-echo)
set -x
;;
-show)
SHOW="echo"
;;
-tool=*)
h5tools="`expr "$arg" : '-tool=\(.*\)'`"
;;
-help|help)
usage
;;
-force)
fmode=yes
;;
*)
ERROR "Unknown Option($arg)"
usage
exit $EXIT_FAILURE
;;
esac
done
# Sanity checks
#if [ ! -d $prefix ]; then
# ERROR "prefix($prefix) is not an existing directory"
# exit $EXIT_FAILURE
#fi
for x in $h5tools; do
if [ -f $x ]; then
foundtools="$foundtools $x"
if [ ! -w $x ]; then
ERROR "h5tool($x) is not writable"
exit $EXIT_FAILURE
fi
fi
done
if [ -z "$foundtools" ]; then
ERROR "found no tools to modify"
exit $EXIT_FAILURE
fi
# Show actions to be taken and get consent
show_action
# Update them
if [ "$SHOW" = "echo" ]; then
echo "===Update commands are:===="
# cat $CMDFILE
echo "===End Update commands====="
fi
for t in $foundtools; do
echo Update $t ...
# COMMAND="ed - $t"
# if [ "$SHOW" = "echo" ]; then
# echo $COMMAND
# else
# $COMMAND < $CMDFILE
ed - $t << end
g/^H5BLD_CPPFLAGS/s/-I\/.*include //g
g/^H5BLD_LDFLAGS/s/-L\/.*lib //g
g/^H5BLD_LDFLAGS/s/-L\/.*lib64 //g
.
w
end
# fi
done
# Cleanup
#rm -f $CMDFILE
exit $EXIT_SUCCESS
# Some possible future features to add
# CCBASE - Name of the alternative C compiler
# CLINKERBASE - Name of the alternative linker
# LDFLAGS - Path to different libraries your application will link with
# (this path should include the path to the zlib library)
# LIBS - Libraries your application will link with
#!/usr/bin/perl
# makeTarFiles.pl
# 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.
#
#
#
use warnings;
use strict;
use Cwd;
use File::Basename;
my %destsubdir = ('emu' => 'sunos-5.11-sparc-32-sunc512',
'emu64' => 'sunos-5.11-sparc-64-sunc512',
'ostrich' => 'linux-el6-ppc64-gcc447',
'ostrichxl' => 'linux-el6-ppc64-xl13.1',
'platypus' => 'linux-centos6-x86_64-gcc447',
'platypus32' => 'linux-centos6-x86_64-32-gcc447',
'moohan' => 'linux-centos7-x86_64-gcc485',
'moohan32' => 'linux-centos7-x86_64-32-gcc485',
'kite' => 'osx-10.8-x86_64-clang5.1',
'quail' => 'osx-10.9-x86_64-clang6.0',
'osx1010test' => 'osx-10.10-x86_64-clang6.0');
my %szipdir = ('emu' => '/mnt/hdf/packages/szip/shared/encoder/SunOS-5.10',
'emu-static' => '/mnt/hdf/packages/szip/static/encoder/SunOS-5.10',
'emu64' => '/mnt/hdf/packages/szip-PIC/shared/encoder/SunOS-5.11-64',
'emu64-static' => '/mnt/hdf/packages/szip-PIC/shared/encoder/SunOS-5.11-64',
'kite' => '/mnt/hdf/packages/szip/shared/encoder/MacOS-10.8',
'kite-static' => '/mnt/hdf/packages/szip-PIC/static/encoder/MacOS-10.8',
'ostrich32' => '/mnt/hdf/packages/szip/shared/encoder/Linux2.6-ppc64-gcc',
'ostrich32-static' => '/mnt/hdf/packages/szip/static/encoder/Linux2.6-ibmppc64-gcc-32',
'ostrich' => '/mnt/hdf/packages/szip/shared/encoder/Linux2.6-ppc64-gcc-64',
'ostrich-static' => '/mnt/hdf/packages/szip/static/encoder/Linux2.6-ibmppc64-gcc',
'ostrichxl' => '/mnt/hdf/packages/szip/shared/encoder/Linux2.6-ppc64-gcc-64',
'ostrichxl-static' => '/mnt/hdf/packages/szip/static/encoder/Linux2.6-ibmppc64-gcc',
'osx1010test' => '/mnt/hdf/packages/szip/shared/encoder/MacOS-10.8',
'osx1010test-static' => '/mnt/hdf/packages/szip-PIC/static/encoder/MacOS-10.8',
'moohan' => '/mnt/hdf/packages/szip/shared/encoder/Linux2.6-x86_64-gcc',
'moohan-static' => '/mnt/hdf/packages/szip/static/encoder/Linux2.6-x86_64-gcc',
'moohan32' => '/mnt/hdf/packages/szip/shared/encoder/Linux2.6-x86_64-gcc-m32',
'moohan32-static' => '/mnt/hdf/packages/szip-PIC/static/encoder/Linux2.6-x86_64-gcc-m32',
'platypus32' => '/mnt/hdf/packages/szip/shared/encoder/Linux2.6-x86_64-gcc-m32',
'platypus32-static' => '/mnt/hdf/packages/szip-PIC/static/encoder/Linux2.6-x86_64-gcc-m32',
'platypus' => '/mnt/hdf/packages/szip/shared/encoder/Linux2.6-x86_64-gcc',
'platypus-static' => '/mnt/hdf/packages/szip/static/encoder/Linux2.6-x86_64-gcc',
'quail' => '/mnt/hdf/packages/szip/shared/encoder/MacOS-10.8',
'quail-static' => '/mnt/hdf/packages/szip-PIC/static/encoder/MacOS-10.8');
my %zlibdir = ('emu' => '/mnt/hdf/packages/zlib-125/shared/SunOS-5.10',
'emu-static' => '/mnt/hdf/packages/zlib-125/static/SunOS-5.10',
'emu64' => '/mnt/hdf/packages/zlib-123-PIC/SunOS-5.11-64',
'emu64-static' => '/mnt/hdf/packages/zlib-123-PIC/SunOS-5.11-64',
'kite' => ' /mnt/hdf/packages/zlib-125/shared/mac-intel-x86_64',
'kite-static' => ' /mnt/hdf/packages/zlib-125/static/mac-intel-x86_64',
'ostrich32' => '/mnt/hdf/packages/zlib-125/PIC/Linux2.6-ppc64-gcc',
'ostrich32-static' => '/mnt/hdf/packages/zlib-125/PIC/Linux2.6-ppc64-gcc',
'ostrich' => '/mnt/hdf/packages/zlib-125/PIC/Linux2.6-ppc64-gcc-64',
'ostrich-static' => '/mnt/hdf/packages/zlib-125/PIC/Linux2.6-ppc64-gcc-64',
'ostrichxl' => '/mnt/hdf/packages/zlib-125/PIC/Linux2.6-ppc64-gcc-64',
'ostrichxl-static' => '/mnt/hdf/packages/zlib-125/PIC/Linux2.6-ppc64-gcc-64',
'osx1010test' => ' /mnt/hdf/packages/zlib-125/shared/mac-intel-x86_64',
'osx1010test-static' => ' /mnt/hdf/packages/zlib-125/static/mac-intel-x86_64',
'moohan' => '/mnt/hdf/packages/zlib-125/shared/Linux2.6-x86_64-gcc',
'moohan-static' => '/mnt/hdf/packages/zlib-125/static/Linux2.6-x86_64-gcc',
'moohan32' => '/mnt/hdf/packages/zlib-128/Linux2.6-x86_64-gcc-m32',
'moohan32-static' => '/mnt/hdf/packages/zlib-128/Linux2.6-x86_64-gcc-m32',
'platypus32' => '/mnt/hdf/packages/zlib-128/Linux2.6-x86_64-gcc-m32',
'platypus32-static' => '/mnt/hdf/packages/zlib-128/Linux2.6-x86_64-gcc-m32',
'platypus' => '/mnt/hdf/packages/zlib-125/shared/Linux2.6-x86_64-gcc',
'platypus-static' => '/mnt/hdf/packages/zlib-125/static/Linux2.6-x86_64-gcc',
'quail' => ' /mnt/hdf/packages/zlib-125/shared/mac-intel-x86_64',
'quail-static' => ' /mnt/hdf/packages/zlib-125/static/mac-intel-x86_64');
my $indirectory = ".";
$indirectory = shift;
my $outdirectory = ".";
$outdirectory = shift;
my $key = ".";
#$key = shift;
my $scriptdirname = dirname(__FILE__);
unless (-d $outdirectory) {
print "$outdirectory not found. Create it or choose another one and try again.\n";
exit 1;
}
print "Subdirectories of $indirectory will be tarred and stored in $outdirectory.\n";
my $tarfilename;
my $tardirname;
my $output;
my $cmd;
# I'm currently copying system zlibs for at least solaris and FreeBSD machines. Since this script runs on jam it may require scp to get the libs.
#For future reference
# command for getting szlib files and links for shared binaries:
# tar cvf - -C <szipDir>/lib . | tar xvf - -C <libdir> .
# libz.so.1.2.3 and the static files should just be copied because they're in directories
# with other files. Then create the libz.so.1 and libz.so symbolic links.
sub addzandszlibs {
my $dir = shift;
my $indirectory = shift;
my $currentdir = getcwd();
if (-d "$indirectory/$dir" ) {
my $szdir = $szipdir{$dir};
my $zldir = $zlibdir{$dir};
if ($dir =~ /static/ || $dir =~ /ostrich/) {
$cmd = "cp $szdir/lib/libsz.a $indirectory/$dir/lib";
$output = `$cmd`;
print $output;
$cmd = "cp $zldir/lib/libz.a $indirectory/$dir/lib";
$output = `$cmd`;
print $output;
} elsif ($dir eq "freedom" || $dir eq "loyalty") {
$cmd = "cp $szdir/lib/libsz.so.2 $indirectory/$dir/lib";
$output = `$cmd`;
print $output;
$cmd = "cp $zldir/lib/libz.so.5 $indirectory/$dir/lib";
$output = `$cmd`;
print $output;
chdir "$indirectory/$dir/lib" or die "Couldn't change directory to $indirectory/$dir/lib, $!";
$cmd = "ln -s libsz.so.2 libsz.so";
$output = `$cmd`;
print $output;
$cmd = "ln -s libz.so.5 libz.so";
$output = `$cmd`;
print $output;
chdir $currentdir or die "Couldn't change directory back to $currentdir, $!";
} elsif ($dir eq "quail" || $dir eq "kite" || $dir eq "osx1010test") {
#we've been using the static libraries for the macs - built with -fPIC
# $cmd = "cp $szdir/lib/libsz.a $indirectory/$dir/lib";
# $output = `$cmd`;
# print $output;
# $cmd = "cp $zldir/lib/libz.a $indirectory/$dir/lib";
# $output = `$cmd`;
# print $output;
$cmd = "cp $szdir/lib/libsz.2.0.0.dylib $indirectory/$dir/lib";
$output = `$cmd`;
print $output;
$cmd = "cp $zldir/lib/libz.1.2.5.dylib $indirectory/$dir/lib";
$output = `$cmd`;
print $output;
chdir "$indirectory/$dir/lib" or die "Couldn't change directory to $indirectory/$dir/lib, $!";
$cmd = "ln -s libsz.2.0.0.dylib libsz.2.dylib";
$output = `$cmd`;
print $output;
$cmd = "ln -s libsz.2.0.0.dylib libsz.dylib";
$output = `$cmd`;
print $output;
$cmd = "ln -s libz.1.2.5.dylib libz.1.dylib";
$output = `$cmd`;
print $output;
$cmd = "ln -s libz.1.2.5.dylib libz.dylib";
$output = `$cmd`;
print $output;
chdir $currentdir or die "Couldn't change directory back to $currentdir, $!";
} elsif ($dir eq "emu64") {
$cmd = "cp $szdir/lib/libsz.so.2.0.0 $indirectory/$dir/lib";
$output = `$cmd`;
print $output;
$cmd = "cp $zldir/lib/libz.a $indirectory/$dir/lib";
$output = `$cmd`;
print $output;
chdir "$indirectory/$dir/lib" or die "Couldn't change directory to $indirectory/$dir/lib, $!";
$cmd = "ln -s libsz.so.2.0.0 libsz.so.2";
$output = `$cmd`;
print $output;
$cmd = "ln -s libsz.so.2.0.0 libsz.so";
$output = `$cmd`;
print $output;
chdir $currentdir or die "Couldn't change directory back to $currentdir, $!";
} elsif ($dir eq "platypus32" || $dir eq "moohan32") {
$cmd = "cp $szdir/lib/libsz.so.2.0.0 $indirectory/$dir/lib";
$output = `$cmd`;
print $output;
# $cmd = "cp $zldir/lib/libz.a $indirectory/$dir/lib";
# $output = `$cmd`;
# print $output;
chdir "$indirectory/$dir/lib" or die "Couldn't change directory to $indirectory/$dir/lib, $!";
$cmd = "ln -s libsz.so.2.0.0 libsz.so.2";
$output = `$cmd`;
print $output;
$cmd = "ln -s libsz.so.2.0.0 libsz.so";
$output = `$cmd`;
print $output;
# $cmd = "ln -s libz.so.1.2.8 libz.so.1";
# $output = `$cmd`;
# print $output;
# $cmd = "ln -s libz.so.1.2.8 libz.so";
# $output = `$cmd`;
# print $output;
chdir $currentdir or die "Couldn't change directory back to $currentdir, $!";
} else {
$cmd = "cp $szdir/lib/libsz.so.2.0.0 $indirectory/$dir/lib";
$output = `$cmd`;
print $output;
$cmd = "cp $zldir/lib/libz.so.1.2.5 $indirectory/$dir/lib";
$output = `$cmd`;
print $output;
chdir "$indirectory/$dir/lib" or die "Couldn't change directory to $indirectory/$dir/lib, $!";
$cmd = "ln -s libsz.so.2.0.0 libsz.so.2";
$output = `$cmd`;
print $output;
$cmd = "ln -s libsz.so.2.0.0 libsz.so";
$output = `$cmd`;
print $output;
$cmd = "ln -s libz.so.1.2.5 libz.so.1";
$output = `$cmd`;
print $output;
$cmd = "ln -s libz.so.1.2.5 libz.so";
$output = `$cmd`;
print $output;
chdir $currentdir or die "Couldn't change directory back to $currentdir, $!";
}
}
}
sub makeTarFile {
my $directoryname = shift;
my $origdirname = shift;
my $tarfilename = shift;
my $tardirname = shift;
$cmd = "mv $indirectory/$origdirname $indirectory/$tardirname";
$output = `$cmd`;
print $output;
if (-d $indirectory."/".$tardirname."/doc/hdf5/examples") {
$cmd = "mv $indirectory/$tardirname/doc/hdf5/examples $indirectory/$tardirname/examples";
$output = `$cmd`;
print $output;
$cmd = "rm -rf $indirectory/$tardirname/doc";
$output = `$cmd`;
print $output;
}
$cmd = "tar zcvf $outdirectory/$directoryname/$tarfilename -C $indirectory $tardirname";
print "Need to run $cmd.\n";
$output = `$cmd`;
sleep 10;
print "Create $tarfilename: $output\n";
$cmd = "mv $indirectory/$tardirname $indirectory/$origdirname";
$output = `$cmd`;
print $output;
}
foreach $key (keys %destsubdir) {
print "Process ".$key."\n\n";
#skip unless there's a directory by the name of $key or $key-static
next unless -d $indirectory.'/'.$key || -d $indirectory.'/'.$key."-static";
my $version;
# This assumes a static directory. Probably the others should be checked if this
# doesn't exist.
$cmd = "grep \"HDF5 Version\" $indirectory/$key/lib/libhdf5.settings";
$_ = `$cmd`;
print $_, "\n";
s/HDF5 Version://;
s/^\s+//;
chomp;
$version = $_;
#my $directoryname = substr $destsubdir{$key}, 0, rindex($destsubdir{$key}, '-');
my $directoryname = $destsubdir{$key};
mkdir $outdirectory."/".$directoryname, 0755 unless -d $outdirectory."/".$directoryname;
my $staticdir = $key."-static";
print $indirectory."/$key tarfile will be put in " . $outdirectory."/".$directoryname."\n";
if (-e $outdirectory."/".$destsubdir{$key}."/README") {
print $outdirectory."/".$destsubdir{$key}."/README" . " has already been created.\n";
}
else {
print "Make the Outer README file: ";
$cmd = "perl ./makeOuterREADME.pl $indirectory/$key $outdirectory $directoryname";
print $cmd, "\n";
my $output = `$cmd`;
print $output;
}
my $file = "";
my @dirnames = "";
opendir(DIR, $indirectory) or die "can't open .: $!";
while (defined($file = readdir(DIR))) {
next unless ($file eq $key || $file eq "$key-static") && -d $indirectory."/".$file;
push @dirnames, $file;
}
foreach my $dir (@dirnames) {
next if $dir eq "";
print "Make the Inner README files.\n";
$cmd = "perl ./makeInternalREADME.pl $indirectory/$dir";
print $cmd, "\n";
$output = `$cmd`;
print $output;
print "Add the zlib and szip files for $dir.\n";
&addzandszlibs($dir, $indirectory);
my $currentdir = getcwd();
print "Remove all lib*.la files from $dir/lib*.\n";
$cmd = "rm $indirectory/$dir/lib*/lib*.la";
print $cmd, "\n";
$output = `$cmd`;
print $output;
chdir "$indirectory/$dir/bin" or die "Couldn't change directory to $indirectory/$dir/bin, $!";
$cmd = "$scriptdirname/h5rmflags -force";
$output = `$cmd`;
print $output;
chdir $currentdir or die "Couldn't change directory back to $currentdir, $!";
print "Tar up the files into the output directory.\n";
if (-d $indirectory."/".$dir) {
if ($dir =~ /static/) {
$tarfilename = "hdf5-$version-$destsubdir{$key}-static.tar.gz";
$tardirname = "hdf5-$version-$destsubdir{$key}-static";
} else {
$tarfilename = "hdf5-$version-$destsubdir{$key}-shared.tar.gz";
$tardirname = "hdf5-$version-$destsubdir{$key}-shared";
}
&makeTarFile($directoryname, $dir, $tarfilename, $tardirname);
}
}
# If this copy is done after h5rmflags is run on all the directories the compile scripts
# in the utilities directory will already have the paths removed.
if (-d $indirectory."/".$staticdir) {
$cmd = "cp -prv $indirectory/$staticdir/bin $outdirectory/$directoryname/utilities";
$output = `$cmd`;
print $output;
}
}
#!/usr/bin/perl
# makeInternalREADME.pl
#
# Copyright by The HDF Group.
# All rights reserved.
#
# This file is part of HDF4. The full HDF4 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the files COPYING and Copyright.html. COPYING can be found at the root
# of the source code distribution tree; Copyright.html can be found at the
# root level of an installed copy of the electronic HDF4 document set and
# is linked from the top-level documents page. It can also be found at
# http://hdfgroup.org/HDF4/doc/Copyright.html. If you do not have
# access to either file, you may request a copy from help@hdfgroup.org.
#
use warnings;
use strict;
my $section2="For information on compilers and settings used to build these HDF5
libraries, please refer to:
./lib/libhdf5.settings
The contents of this directory are:
COPYING - Copyright notice
README - This file
RELEASE.txt - Detailed information regarding this release
bin/ - Directory containing HDF5 pre-compiled utilities
include/ - Directory containing HDF5 include files
lib/ - Directory containing HDF5 libraries and settings
share/ - Directory containing example code in C, C++, and
Fortran using HDF5 and HDF5 HL library APIs. The
shell scripts provided with these examples will
compile and run them, and will also test the
h5cc, h5c++, and h5fc compile scripts found
in the installed bin directory.
These binaries were built with the ZLIB and SZIP (version 2.1, Encoder
ENABLED) external libraries which are included in the lib directory for
convenience.
We also provide the ZLIB and SZIP source code on our ftp server at:
ftp://ftp.hdfgroup.org/lib-external/
The official ZLIB and SZIP pages are at:
ZLIB: http://www.zlib.net/
SZIP: http://hdfgroup.org/doc_resource/SZIP/
";
my $section3 = "If using the shared libraries, you must add the HDF5 library path
to the LD_LIBRARY_PATH variable.
";
my $section4 = "We provide scripts for compiling applications with the HDF5 libraries:
bin/h5cc - for C
bin/h5fc - for F90 (if Fortran 90 library is included with the binaries)
bin/h5c++ - for C++ (if C++ library is included with the binaries)
After you have installed the binaries to their final destination, you can use
these scripts (h5cc, h5fc, h5c++) to compile. However, you must first run
./h5redeploy in the bin directory to change site specific paths in the scripts.
You may also need to change other variables in the scripts, depending
on how things are set up on your system. Here are some of the variables
to check:
prefix - Path to the HDF5 top level installation directory
CCBASE - Name of the C compiler
CLINKERBASE - Name of the linker
LIBS - Libraries your application will link with
For further details refer to the INSTALL files in
ftp://ftp.hdfgroup.org/HDF5/current/src/unpacked/release_docs/
or in the ./release_docs/ directory of the HDF5 source code, which can be found
on the HDF Group ftp server at ftp://ftp.hdfgroup.org/HDF5/current/src/.
Please send questions, comments, and suggestions to the appropriate
contact address from http://www.hdfgroup.org/about/contact.html
";
my $indirectory = ".";
$indirectory = shift;
my $linktype = "shared";
if ($indirectory =~ /static/) {
$linktype = "static";
}
my $modestring="";
if ($indirectory =~ /32/) {
$modestring = "in 32 bit mode ";
}
my $version;
my $outfile = "$indirectory/README";
open OUTFILE, ">$outfile" or die "$!Couldn't open $outfile - check permissions for $indirectory\n";
my $hostname;
my $cmd = "grep \"HDF5 Version\" $indirectory/lib/libhdf5.settings";
$_ = `$cmd`;
#print OUTFILE $_, "\n";
s/HDF5 Version://;
s/^\s+//;
chomp;
$version = $_;
#print OUTFILE $_, "\n";
my $versionstring= "This directory contains the $linktype binary distribution of HDF5-".$version;
$cmd = "grep \"Uname information:\" $indirectory/lib/libhdf5.settings";
$_ = `$cmd`;
s/Uname information://;
s/^\s+//;
#print OUTFILE $_;
chomp;
#s/(^\w+)(\s)(\S+)/$1/;
#s/(^.*)(-)(.*)(200[7-8])(.*)(\s)(\S+)/$1 $5/;
#my $platformstring = "\nthat was compiled on:" . $_ . " ";
my $platformstring = "";
my $hostnamestring = $_;
my @hostnamestring = split / /, $hostnamestring;
#print OUTFILE "Size of hostnamestring is ", scalar @hostnamestring, "\n";
#print OUTFILE $hostnamestring[0] . "\t" . $hostnamestring[2]."\t".$hostnamestring[19]."\n";
$hostname = $hostnamestring[1];
#my $size = scalar @hostnamestring;
if ($hostname =~ /loyalty/) {
$platformstring = "\nthat was compiled " . $modestring . "on: " . $hostnamestring[0]." " . $hostnamestring[2]." " . $hostnamestring[-1] . " ";
}
elsif ($hostname =~ /freedom/) {
$platformstring = "\nthat was compiled " . $modestring . "on: " . $hostnamestring[0]." " . $hostnamestring[2]." " . $hostnamestring[-1] . " ";
} elsif ($hostname =~ /emu/) {
$platformstring = "\nthat was compiled " . $modestring . "on: " . $hostnamestring[0]." " . $hostnamestring[2] . " " . $hostnamestring[-2] . " ";
} elsif ($hostname =~ /fred/) {
$platformstring = "\nthat was compiled " . $modestring . "on: " . $hostnamestring[0]." " . $hostnamestring[2] . " " . $hostnamestring[-1] . " ";
} else {
$_ = $hostnamestring[2];
my $pos = index $_, '-';
my $os = substr $_, 0, $pos;
$platformstring = "\nthat was compiled " . $modestring . "on: " . $hostnamestring[0] . " " . $os . " " . $hostnamestring[-2] . " ";
}
my $mappingstring = "";
#no mappingstring for 1.6. Put it back for 1.8.
#$cmd = "grep \"Default API Mapping:\" $indirectory/lib/libhdf5.settings";
#$_ = `$cmd`;
#s/Default API Mapping://;
#s/^\s+//;
#chomp;
#if (/v\d+/) {
# s/v//;
# s/(\d)(\d)/$1\.$2/g;
# $mappingstring = "using the default\nAPI mapping for VERSION ".$_.".";
#
#}
print OUTFILE $versionstring;
print OUTFILE $platformstring."\n\n";
#print OUTFILE $mappingstring;
#if ($hostname eq "loyalty.hdfgroup.uiuc.edu" || $hostname eq "freedom.hdfgroup.uiuc.edu") {
# print OUTFILE " It includes the C APIs,\nbuilt using the following ";
# print OUTFILE "compilers:\n\n";
#}
#else {
if ($linktype eq "shared" && !($hostname =~ /32/)) {
print OUTFILE "\n\nIt includes the C, C++, F90 and Java APIs, built using the following\n";
} else {
print OUTFILE "\n\nIt includes the C, C++, and F90 APIs, built using the following\n";
}
print OUTFILE "compilers:\n\n";
#}
# Only the gcc compiler version is in libhdf5.settings, so for now I looked
# up the versions and hardcoded them here. We will put them in libhdf5.settings
# for the next release.
if ($indirectory =~ /gnu484/) {
print OUTFILE "\tgcc, g++, and gfortran 4.8.4\n\n";
} elsif ($hostname =~ /jam/ || $hostname =~ /koala/) {
print OUTFILE "\tgcc, g++, and gfortran 4.1.2\n\n";
} elsif ($hostname =~ /platypus/) {
print OUTFILE "\tgcc, g++, and gfortran 4.4.7\n\n";
if ($linktype eq "shared" && !($hostname =~ /32/)) {
print OUTFILE "\tjava 1.8.0_51\n\n";
}
} elsif ($hostname =~ /moohan/) {
print OUTFILE "\tgcc, g++, and gfortran 4.8.5\n\n";
if ($linktype eq "shared" && !($hostname =~ /32/)) {
print OUTFILE "\tjava 1.8.0_51\n\n";
}
} elsif ($hostname =~ /emu/) {
print OUTFILE "\tSun C and C++ 5.12, Sun Fortran 95 8.6\n\n";
} elsif ($hostname =~ /loyalty/ || $hostname =~ /freedom/) {
print OUTFILE "\tgcc, g++, and gfortran 4.6.1\n\n";
} elsif ($hostname =~ /duck/) {
print OUTFILE "\tApple clang/clang++ 3.0 from Xcode 4.6.1 and gfortran 4.8.2\n\n";
} elsif ($hostname =~ /kite/) {
print OUTFILE "\tApple clang/clang++ 5.1 from Xcode 5.0.2 and gfortran 4.8.2\n\n";
} elsif ($hostname =~ /quail/) {
print OUTFILE "\tgcc, g++ 5.1 from Xcode 5.1 and gfortran 4.8.2\n\n";
} elsif ($hostname =~ /osx1010test/) {
print OUTFILE "\tgcc, g++ 5.1 from Xcode 5.1 and gfortran 4.8.2\n\n";
}
print OUTFILE $section2;
print OUTFILE $section3;
print OUTFILE $section4;
#!/usr/bin/perl
# makeOuterREADME.pl
# Copyright by The HDF Group.
# All rights reserved.
#
# This file is part of HDF4. The full HDF4 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the files COPYING and Copyright.html. COPYING can be found at the root
# of the source code distribution tree; Copyright.html can be found at the
# root level of an installed copy of the electronic HDF4 document set and
# is linked from the top-level documents page. It can also be found at
# http://hdfgroup.org/HDF4/doc/Copyright.html. If you do not have
# access to either file, you may request a copy from help@hdfgroup.org.
#
use warnings;
use strict;
my $indirectory = ".";
$indirectory = shift;
my $outdirectory = ".";
$outdirectory = shift;
my $outsubdir = shift;
my $version;
my $outfile = "$outdirectory/$outsubdir/README";
open OUTFILE, ">$outfile";
my $hostname="";
my $cmd = "grep \"HDF5 Version\" $indirectory-static/lib/libhdf5.settings";
$_ = `$cmd`;
print OUTFILE $_, "\n";
s/HDF5 Version://;
s/^\s+//;
chomp;
$version = $_;
#print OUTFILE $_, "\n";
my $versionstring= "This directory contains the precompiled HDF5 $version binary distribution\n(include files, libraries, utilities) for";
$cmd = "grep \"Uname information:\" $indirectory-static/lib/libhdf5.settings";
$_ = `$cmd`;
s/Uname information://;
s/^\s+//;
chomp;
print "String to work with is $_\n";
my $platformstring = "";
my $hostnamestring = $_;
my @hostnamestring = split / /, $hostnamestring;
$platformstring = "$hostnamestring[0] ";
if ($indirectory =~ /jam/ || $indirectory =~ /koala/) {
$hostnamestring = $hostnamestring[2];
my $pos = index $hostnamestring, "-";
if ($pos > 0) {
$platformstring .= substr $hostnamestring, 0, $pos;
} else {
$platformstring .= $hostnamestring[2];
}
$platformstring .= " ".$hostnamestring[-3];
} elsif ($indirectory =~ /linew/) {
$platformstring .= "$hostnamestring[2] $hostnamestring[-2]";
} else {
$platformstring .= "$hostnamestring[2] $hostnamestring[-1]";
}
print OUTFILE $versionstring." ".$platformstring.":\n\n";
my $line1;
my $line3;
my $line5;
my $compilerstring="";
my $compilerstring1="";
my $compilerstring2="";
print $indirectory, "\n";
if ($indirectory =~ /ostrich/) {
# $line1 = " hdf5-$version-$outsubdir-16API.tar.gz - Includes C, C++, F90 APIs (using\n";
$line3 = " hdf5-$version-$outsubdir-static.tar.gz - Includes C, C++, F90 APIs (using";
$line5 = " hdf5-$version-$outsubdir-shared.tar.gz - Includes C, C++, F90 APIs (using";
$compilerstring = " gcc, g++, and gfortran 4.4.7)";
}
elsif ($indirectory =~ /platypus/) {
# $line1 = " hdf5-$version-$outsubdir-16API.tar.gz - Includes C, C++, F90 APIs (using\n";
$line3 = " hdf5-$version-$outsubdir-static.tar.gz - Includes C, C++, F90 APIs (using";
$compilerstring1 = " gcc, g++, and gfortran 4.4.7)\n";
if ($indirectory =~ /32/) {
$line5 = " hdf5-$version-$outsubdir-shared.tar.gz - Includes C, C++, F90 and Java APIs (using";
$compilerstring2 = " gcc, g++, and gfortran 4.4.7)\n";
} else {
$line5 = " hdf5-$version-$outsubdir-shared.tar.gz - Includes C, C++, F90 and Java APIs (using";
$compilerstring2 = " gcc, g++, and gfortran 4.4.7 and java 1.8.0_51)\n";
}
}
elsif ($indirectory =~ /moohan/) {
# $line1 = " hdf5-$version-$outsubdir-16API.tar.gz - Includes C, C++, F90 APIs (using\n";
$line3 = " hdf5-$version-$outsubdir-static.tar.gz - Includes C, C++, F90 APIs (using";
$compilerstring1 = " gcc, g++, and gfortran 4.8.5)\n";
if ($indirectory =~ /32/) {
$line5 = " hdf5-$version-$outsubdir-shared.tar.gz - Includes C, C++, F90 and Java APIs (using";
$compilerstring2 = " gcc, g++, and gfortran 4.4.7)\n";
} else {
$line5 = " hdf5-$version-$outsubdir-shared.tar.gz - Includes C, C++, F90 and Java APIs (using";
$compilerstring2 = " gcc, g++, and gfortran 4.8.5 and java 1.8.0_51)\n";
}
}
elsif ($indirectory =~ /emu/) {
# $line1 = " hdf5-$version-$outsubdir-16API.tar.gz - Includes C, C++, F90 APIs (using\n";
$line3 = " hdf5-$version-$outsubdir-static.tar.gz - Includes C, C++, F90 APIs (using";
$line5 = " hdf5-$version-$outsubdir-shared.tar.gz - Includes C, C++, F90 APIs (using";
$compilerstring = " Sun C and C++ 5.12, Sun Fortran 95 8.6)\n";
}
elsif ($indirectory =~ /kite/) {
$line3 = " hfd5-$version-$outsubdir-static.tar.gz - Includes C, C++, F90 APIs (using";
$line5 = " hfd5-$version-$outsubdir-shared.tar.gz - Includes C, C++, F90 APIs (using";
$compilerstring = " Apple clang/clang++ 5.1 from Xcode 5.0.2,
gfortran 4.8.2)\n";
}
elsif ($indirectory =~ /quail/) {
$line3 = " hfd5-$version-$outsubdir-static.tar.gz - Includes C, C++, F90 APIs (using";
$line5 = " hfd5-$version-$outsubdir-shared.tar.gz - Includes C, C++, F90 APIs (using";
$compilerstring = " Apple clang/clang++ 6.0 from Xcode 5.1,
gfortran 4.9.2)\n";
}
elsif ($indirectory =~ /osx1010test/) {
$line3 = " hdf5-$version-$outsubdir-static.tar.gz - Includes C, C++, F90 APIs (using";
$line5 = " hdf5-$version-$outsubdir-shared.tar.gz - Includes C, C++, F90 APIs (using";
$compilerstring = " Apple clang/clang++ 6.1 from Xcode 6.1,
gfortran 4.9.2)\n";
}
elsif ($indirectory =~ /osx1011test/) {
$line3 = " hdf5-$version-$outsubdir-static.tar.gz - Includes C, C++, F90 APIs (using";
$line5 = " hdf5-$version-$outsubdir-shared.tar.gz - Includes C, C++, F90 APIs (using";
$compilerstring = " Apple clang/clang++ 7.0.2 from Xcode 7.0,
gfortran 5.2.0)\n";
}
print OUTFILE $line3;
print OUTFILE $compilerstring1."\n";
if ($line5 ne "") {
print OUTFILE $line5;
print OUTFILE $compilerstring2."\n";
}
#elsif ($indirectory =~ /-16API/) {
# print OUTFILE $line1;
# print OUTFILE $compilerstring;
# print OUTFILE " USES THE VERSION 1.6 DEFAULT API\n";
# print OUTFILE " MAPPING.\n\n";
#}
print OUTFILE " utilities/ - Directory containing the compiled HDF5 utilities.\n";
print OUTFILE " These utilities are STATICALLY linked and will run as is.\n\n";
#print OUTFILE " The tools can be downloaded separately, or ALL in one\n";
#print OUTFILE " compressed file (5-$version-$outsubdir-static-util.tar.gz).\n\n";
print OUTFILE "\n";
print OUTFILE "To obtain the HDF5 distribution, 'unzip' and 'untar' the distribution\n";
print OUTFILE "file:\n\n";
print OUTFILE " gzip -cd <gz file from above> | tar xvf -\n";
#$cmd = "grep \"Configured by:\" $indirectory/$key-static/lib/libhdf5.settings";
#$_ = `$cmd`;
#s/Configured by://;
#s/^\s+//;
#print OUTFILE $_;
#chomp;
#my $hostnamestring = $_;
#s/(^\w+)(\s)(\S+)/$1/;
#s/(^.*)(-)(.*)(200[7-8])(.*)(\s)(\S+)/$1 $5/;
#my $platformstring = $_ . ":\n\n";
#my @hostnamestring = split /@/, $hostnamestring;
#print "Size of hostnamestring is ", scalar @hostnamestring, "\n";
#print $hostnamestring[0] . "\t" . $hostnamestring[2]."\t".$hostnamestring[19]."\n";
#my $platformstring = $hostnamestring[1].":\n\n";
#$hostnamestring = $hostnamestring[1];
#my $pos = index $hostnamestring, ".";
#if ($pos > 0) {
# @hostnamestring = split /\./, $hostnamestring;
# $platformstring = $hostnamestring[0].":\n\n";
#}
This diff is collapsed.
#
# 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.
#
# 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
#!/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.
#
# Switch AM_MAINTAINER_MODE value in configure.ac
# Usage: See USAGE()
# Programmer: Dana Robinson
# Creation date: January 2016
USAGE()
{
cat <<EOF
switch_maint_mode reverses the status of AM_MAINTAINER_MODE in
configure.ac from enable to disable or vice-versa. When enabled,
this feature forces the autotools to run when the input files are
older than the output files. This is the default for development
branches. When disabled, the autotools will NOT be re-run regardless
of their timestamps or any modifications. This is the default for
tarballs and release branches since it avoids having end-users
requiring the autotools.
Command Syntax
==============
switch_maint_mode [-help] [-enable|disable] <path-to-configure.ac>
EOF
}
MODE="notset"
CONFIG_AC_PATH=
# Display help/usage if any options were passed in
while [ $# -gt 0 ]; do
case "$1" in
-enable)
MODE="enable"
;;
-disable)
MODE="disable"
;;
-help)
USAGE
exit 0
;;
*)
CONFIG_AC_PATH="$1"
;;
esac
shift
done
# Did we get a file path?
if test -z $CONFIG_AC_PATH ; then
USAGE
exit 1
fi
# Did we get a mode?
if test -z $MODE ; then
USAGE
exit 1
fi
# Run perl over configure.ac
if test "X-$MODE" = "X-enable" ; then
perl -pi -e 's/^(AM_MAINTAINER_MODE\(\[)([a-z]+)(\]\))/$1enable$3/g' $CONFIG_AC_PATH
fi
if test "X-$MODE" = "X-disable" ; then
perl -pi -e 's/^(AM_MAINTAINER_MODE\(\[)([a-z]+)(\]\))/$1disable$3/g' $CONFIG_AC_PATH
fi
#!/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.
##
# 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`"
hdf5 (1.10.1+docs-1~exp3) UNRELEASED; urgency=medium
hdf5 (1.10.1+repack-1~exp1) experimental; urgency=medium
* Fix broken debian/watch due to upstrem web site major change; the
uscan download mode is now set to git
* Disable dh_auto_test on ppc64el (HDFFV-10309)
* This upstream release fixes openmpi flavor on arm64 (closes: #855810)
* Priority: replace 'extra' with 'optional'
-- Gilles Filippini <pini@debian.org> Mon, 23 Oct 2017 20:01:47 +0200
-- Gilles Filippini <pini@debian.org> Sun, 14 Jan 2018 16:54:08 +0100
hdf5 (1.10.1+docs-1~exp2) experimental; urgency=medium
......