diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2001-05-10 22:15:50 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2001-05-10 22:15:50 (GMT) |
commit | 37832b192e4a352b2255ba80f3fa2c8a721b8e1f (patch) | |
tree | 97c2bf640565f4ae7bc7bd96cb1a2f26ca44467b /bin/h5vers | |
parent | ce7c9f7b08114a3bd1e557f71b82eef27b223f96 (diff) | |
download | hdf5-37832b192e4a352b2255ba80f3fa2c8a721b8e1f.zip hdf5-37832b192e4a352b2255ba80f3fa2c8a721b8e1f.tar.gz hdf5-37832b192e4a352b2255ba80f3fa2c8a721b8e1f.tar.bz2 |
[svn-r3907] Purpose:
feature
Description:
-i option update the RELEASE.txt file too.
Platforms tested:
eirene
Diffstat (limited to 'bin/h5vers')
-rwxr-xr-x | bin/h5vers | 28 |
1 files changed, 24 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. ############################################################################## @@ -136,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 $_; @@ -145,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"; @@ -193,6 +198,7 @@ if ($set) { } else { # Nothing to do but print result $README = ""; + $RELEASE = ""; @newver = @curver; } @@ -229,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], |