diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2001-05-10 23:42:31 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2001-05-10 23:42:31 (GMT) |
commit | 94e3e4b98cd03fdcb90bb76edb62ecdad7542e79 (patch) | |
tree | 59968bebbddf6cd7a44e91ca7508aa0382289770 /bin | |
parent | 187b151e0a23493d3be2578926093570f1d2559e (diff) | |
download | hdf5-94e3e4b98cd03fdcb90bb76edb62ecdad7542e79.zip hdf5-94e3e4b98cd03fdcb90bb76edb62ecdad7542e79.tar.gz hdf5-94e3e4b98cd03fdcb90bb76edb62ecdad7542e79.tar.bz2 |
[svn-r3909] Purpose:
feature
Description:
-i option update the RELEASE.txt file too.
Platforms tested:
eirene
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/h5vers | 31 |
1 files changed, 27 insertions, 4 deletions
@@ -56,8 +56,8 @@ use strict; # ./H5public.h or ./src/H5public.h. # # If the version number is changed (either `-s' or `-i' was used on -# the command line) then the first line of the README file one -# directory above the H5public.h file is also modified so it looks +# the command line) then the first line of the README and RELEASE.txt files +# one directory above the H5public.h file is also modified so it looks # something like: This is hdf5-1.2.3-pre1 currently under development. ############################################################################## @@ -78,6 +78,9 @@ sub setvers { $_[0] =~ s/^(\#\s*define\s+H5_VERS_MINOR\s+)\d+/$1$vers[1]/m; $_[0] =~ s/^(\#\s*define\s+H5_VERS_RELEASE\s+)\d+/$1$vers[2]/m; $_[0] =~ s/^(\#\s*define\s+H5_VERS_SUBRELEASE\s+\")[^\"]*/$1$vers[3]/m; + $_[0] =~ s/^(\#\s*define\s+H5_VERS_INFO\s+\")[^\"]*/ + sprintf("%shdf5 version: %d.%d.%d%s%s", $1, @vers[0,1,2], + $vers[3]?"-":"", $vers[3])/me; } sub usage { @@ -133,8 +136,8 @@ while ($_ = shift) { } die "mutually exclusive options given\n" if $set && $inc; -# Determine file to use as H5public.h and README. The README file is -# always in the directory above H5public.h +# Determine file to use as H5public.h, README and RELEASE.txt. +# The README and RELEASE.txt files are always in the directory above H5public.h unless ($file) { for (@files) { ($file=$_,last) if -f $_; @@ -142,9 +145,14 @@ unless ($file) { } die "unable to find source files\n" unless defined $file; die "unable to read file: $file\n" unless -r $file; +# README my $README = $file; $README =~ s/[^\/]*$/..\/README/; die "unable to read file: $README\n" unless -r $file; +# RELEASE.txt +my $RELEASE = $file; +$RELEASE =~ s/[^\/]*$/..\/RELEASE.txt/; +die "unable to read file: $RELEASE\n" unless -r $file; # Get the current version number. open FILE, $file or die "unable to open $file: $!\n"; @@ -190,6 +198,7 @@ if ($set) { } else { # Nothing to do but print result $README = ""; + $RELEASE = ""; @newver = @curver; } @@ -226,6 +235,20 @@ if ($README) { close FILE; } +# Update the RELEASE.txt file +if ($RELEASE) { + open FILE, $RELEASE or die "$RELEASE: $!\n"; + my @contents = <FILE>; + close FILE; + $contents[0] = sprintf("HDF5 version %d.%d.%d%s %s", + @newver[0,1,2], + $newver[3] eq "" ? "" : "-".$newver[3], + "currently under development\n"); + open FILE, ">$RELEASE" or die "$RELEASE: $!\n"; + print FILE @contents; + close FILE; +} + # Print the new version number if ($verbose) { printf("version %d.%d release %d%s\n", @newver[0,1,2], |