From 5761b90f63b5f3d69e914cfbe7a4619cce9bfc4b Mon Sep 17 00:00:00 2001 From: Robb Matzke Date: Thu, 29 Jan 1998 11:31:24 -0500 Subject: [svn-r196] Changes since 19980128 ---------------------- ./MANIFEST Added new files. ./bin/Makefile.dist [NEW] This file becomes the default top-level Makefile which invokes configure with no arguments and then re-runs make. It's for those people that don't read the INSTALL file. ./bin/release [NEW] Build HDF release tarballs. Arguments are a list of tarball types and are: tar, compress, gzip, or bzip2. The default is gzip. If the only argument is `all' then all types of tarballs are created. The results are put in the `releases' directory. Make sure you keep MANIFEST up to date. This program requires perl-5.003 or better. ./src/H5AC.c Fixed a printf format. --- MANIFEST | 2 + Makefile.dist | 24 ++++++++++ bin/release | 142 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/H5AC.c | 5 ++- 4 files changed, 171 insertions(+), 2 deletions(-) create mode 100644 Makefile.dist create mode 100755 bin/release diff --git a/MANIFEST b/MANIFEST index 0960f34..fbf9552 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2,6 +2,7 @@ ./configure ./INSTALL ./INSTALL_MAINT +./Makefile.dist ./Makefile.in ./MANIFEST ./bin/checkposix @@ -9,6 +10,7 @@ ./bin/config.sub ./bin/errors ./bin/install-sh +./bin/release ./config/commence.in ./config/conclude.in ./config/depend.in diff --git a/Makefile.dist b/Makefile.dist new file mode 100644 index 0000000..e2145ee --- /dev/null +++ b/Makefile.dist @@ -0,0 +1,24 @@ +# Top-level distributed Makefile -*- makefile -*- + +# 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 test install uninstall dep depend clean mostlyclean: config + $(MAKE) $@ + +distclean maintainer-clean TAGS: config + $(MAKE) $@ + +config: + sh configure + +.PHONY: all lib progs test install uninstall dep depend clean mostlyclean \ + distclean maintainer-clean config diff --git a/bin/release b/bin/release new file mode 100755 index 0000000..6b96fa0 --- /dev/null +++ b/bin/release @@ -0,0 +1,142 @@ +#! /usr/local/bin/perl -w +require 5.003; + +# Builds a release. Arguments are zero or more of the words. +# +# tar -- build a tar file *.tar +# compress -- build a compressed tar file *.tar.Z +# gzip -- build a compressed tar file *.tar.gz +# bzip2 -- build a compressed tar file *.tar.bz2 +# +# If no arguments are given then `gzip' is assumed. If the only argument +# is the word `all' then all forms are used. + +$releases = "./releases"; # Directory for release tarballs + +############################################################################## +# Read version info, return an array (MAJOR,MINOR,RELEASE,PATCHLEVEL) or +# a string "MAJOR.MINOR.RELEASE PATCHLEVEL" +# +sub getver () { + my @ver; + + open SRC, "./src/H5private.h" or die "cannot read HDF5 version"; + while () { + $ver[0] = $1 if /define\s+HDF5_MAJOR_VERSION\s+(\d+)/; + $ver[1] = $1 if /define\s+HDF5_MINOR_VERSION\s+(\d+)/; + $ver[2] = $1 if /define\s+HDF5_RELEASE_VERSION\s+(\d+)/; + $ver[3] = $1 if /define\s+HDF5_PATCH_VERSION\s+(\d+)/; + } + close SRC; + wantarray ? @ver : "$ver[0].$ver[1].$ver[2]".chr(ord('a')+$ver[3]); +} + +############################################################################## +# Set version information. Input is a string or an array. +# +sub setver ($;$$$) { + my @ver = @_; + local $_; + + if ($ver[0]=~/\D/) { + @ver = $ver[0] =~ /^(\d+)\.(\d+)\.(\d+)([a-z])$/ or return ""; + $ver[3] = ord($ver[3])-ord('a'); + } + + $_ = `cat ./src/H5private.h`; + s/(define\s+HDF5_MAJOR_VERSION\s+)(\d+)/$1$ver[0]/; + s/(define\s+HDF5_MINOR_VERSION\s+)(\d+)/$1$ver[1]/; + s/(define\s+HDF5_RELEASE_VERSION\s+)(\d+)/$1$ver[2]/; + s/(define\s+HDF5_PATCH_VERSION\s+)(\d+)/$1$ver[3]/; + open SRC, "> ./src/H5private.h" or return ""; + print SRC $_; + close SRC; + + return 1; +} + +############################################################################## +# Build a release +# +sub release (@) { + my @types = @_; + my ($ver, $status); + local $_; + + # Make sure the version number is correct. + print "Building an HDF release...\n"; + print "HDF version to release [", ($ver=getver), "] "; + return "" unless defined ($_=); + chomp; + (setver ($ver=$_) or die "cannot set version") if /\S/; + + # Clean the source tree, showing only errors. + print "Cleaning source tree...\n"; + $status = system "make distclean >/dev/null"; + die "cannot make distclean" if $status >> 8; + + # Move default top-level makefile into place. + $status = system "cp Makefile.dist Makefile"; + die "cannot install default Makefile" if $status >> 8; + + # Make sure release directory exists and create a name. + (mkdir $releases, 0777 or die "cannot create $releases") + unless -d $releases; + die "no manifest" unless -r "MANIFEST"; + my $name = "$releases/hdf-$ver"; + + # Build the releases + @types = ("gzip") unless @types; + @types = qw/tar gzip compress bzip2/ if 1==@types && "all" eq $types[0]; + my $filelist = 'Makefile `cat MANIFEST`'; + for (@types) { + print "Compressing with $_...\n"; + + /^tar$/ && do { + $status = system "tar cf $name.tar $filelist"; + next; + }; + + /^gzip$/ && do { + $status = system "tar cf - $filelist |gzip -9 >$name.tar.gz"; + next; + }; + + /^compress$/ && do { + $status = system "tar cf - $filelist |compress -c >$name.tar.Z"; + next; + }; + + /^bzip2$/ && do { + $status = system "tar cf - $filelist |bzip2 -9 >$name.tar.bz2"; + next; + }; + } continue { + print STDERR "$_ failed\n" if $status >> 8; + } + + # Update version info + print <); + chomp; + (setver ($ver=$_) or die "cannot set version") if /\S/; + + if (-d "CVS") { + print <diagnostics[i].nhits, cache->diagnostics[i].nmisses, ascii, cache->diagnostics[i].ninits, - cache->diagnostics[i].nflushes - cache->diagnostics[i].ninits); + ((long)(cache->diagnostics[i].nflushes) - + (long)(cache->diagnostics[i].ninits))); } FUNC_LEAVE(SUCCEED); -- cgit v0.12