hdf5/bin/release
HDF Admin cd5ca85fb7 [svn-r11082] Purpose:
upgrade.

Description:
Release used to copy the updated release_docs/HISTORY.txt and
release_docs/RELEASE.txt to the doc/html/ADGuide.  The doc/ is
removed from the source tree.  So, remove the command that
does the copying.

Note that once the separated doc/ location is known, release needs
to copy the two files into them and committed them via sub-version
commands.

Platforms tested:
No test because it is a trivial change and it is not easy to change
without triggering the full release process.

Misc. update:
2005-07-18 17:14:53 -05:00

228 lines
5.3 KiB
Bash
Executable File

#!/bin/sh
# Make a release of hdf5. The command-line switches are:
#
# -d DIR The name of the directory where the releas(es) should be
# placed. By default, the directory is ./releases
#
# --nocheck Ignore errors in MANIFEST file.
#
# 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.
# compress -- use compress and append `.Z' to the output name.
# gzip -- use gzip with `-9' and append `.gz' to the output name.
# bzip2 -- use bzip2 with `-9' and append `.bz2' to the output name.
#
# Examples:
#
# $ release
# releases/hdf5-1.0.38.tar
#
# $ release gzip
# releases/hdf5-1.0.38.tar.gz
#
# $ release -d /tmp tar compress gzip bzip2
# /tmp/hdf5-1.0.38.tar
# /tmp/hdf5-1.0.38.tar.Z
# /tmp/hdf5-1.0.38.tar.gz
# /tmp/hdf5-1.0.38.tar.bz2
#
# 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.
# Function definitions
#
# Print Usage page
USAGE()
{
cat << EOF
Usage: $0 [--nocheck] [-d <dir>] [-h] <methods> ...
-d DIR The name of the directory where the releas(es) should be
placed. By default, the directory is ./releases
--nocheck Ignore errors in MANIFEST file.
--private Make a private release with today's date in version information.
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.
compress -- use compress and append ".Z" to the output name.
gzip -- use gzip with "-9" and append ".gz" to the output name.
bzip2 -- use bzip2 with "-9" and append ".bz2" to the output name.
Examples:
$ release
releases/hdf5-1.0.38.tar
$ release gzip
releases/hdf5-1.0.38.tar.gz
$ release -d /tmp tar compress gzip bzip2
/tmp/hdf5-1.0.38.tar
/tmp/hdf5-1.0.38.tar.Z
/tmp/hdf5-1.0.38.tar.gz
/tmp/hdf5-1.0.38.tar.bz2
EOF
}
# Defaults
DEST=releases
VERS=`perl bin/h5vers`
VERS_OLD=
test "$VERS" || exit 1
verbose=yes
check=yes
today=`date +%Y%m%d`
pmode='no'
# Restore previous Version information
RESTORE_VERSION()
{
if [ X-${VERS_OLD} != X- ]; then
echo restoring version information back to $VERS_OLD
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
;;
-*)
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
# setup restoration in case of abort.
trap RESTORE_VERSION 0
if [ X$pmode = Xyes ]; then
VERS_OLD=$VERS
# 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
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=/tmp/H5_MANIFEST.$$
grep '^\.' MANIFEST | grep -v _DO_NOT_DISTRIBUTE_ >$MANIFEST
# Prepare the source tree for a release.
test -h ../hdf5-$VERS && rm ../hdf5-$VERS
ln -s `pwd` ../hdf5-$VERS || exit 1
mv Makefile ../Makefile.x 2>/dev/null #might fail
cp -p Makefile.dist Makefile
# Update README.txt and release_docs/RELEASE.txt with release information.
for f in README.txt release_docs/RELEASE.txt; do
echo "HDF5 version $VERS released on `date`" >$f.x
tail +2l $f >>$f.x
mv $f.x $f
# Make sure new files are of the right access mode
chmod 644 $f
done
# Create the tar file
test "$verbose" && echo " Running tar..." 1>&2
( \
cd ..; \
tar cf x.tar hdf5-$VERS/Makefile \
`sed 's/^\.\//hdf5-'$VERS'\//' $MANIFEST` || exit 1 \
)
# Compress
for comp in $methods; do
case $comp in
tar)
cp -p ../x.tar $DEST/hdf5-$VERS.tar;;
compress)
test "$verbose" && echo " Running compress..." 1>&2
compress -c <../x.tar >$DEST/hdf5-$VERS.tar.Z;;
gzip)
test "$verbose" && echo " Running gzip..." 1>&2
gzip -9 <../x.tar >$DEST/hdf5-$VERS.tar.gz;;
bzip2)
test "$verbose" && echo " Running bzip2..." 1>&2
bzip2 -9 <../x.tar >$DEST/hdf5-$VERS.tar.bz2;;
esac
done
# Copy the RELEASE.txt to the release area.
cp release_docs/RELEASE.txt $DEST/hdf5-$VERS-RELEASE.txt
# Remove temporary things
test -f ../Makefile.x && mv ../Makefile.x Makefile
rm -f $MANIFEST
rm -f ../hdf5-$VERS
rm -f ../x.tar
# Restore OLD version information, then no need for trap.
if [ X$pmode = Xyes ]; then
RESTORE_VERSION
trap 0
fi
exit 0