summaryrefslogtreecommitdiffstats
path: root/bin/h5vers
diff options
context:
space:
mode:
Diffstat (limited to 'bin/h5vers')
-rwxr-xr-xbin/h5vers25
1 files changed, 24 insertions, 1 deletions
diff --git a/bin/h5vers b/bin/h5vers
index 6d30ffd..dac587d 100755
--- a/bin/h5vers
+++ b/bin/h5vers
@@ -36,6 +36,11 @@ require 5.003;
#
# If a file is specified then that file is used instead of
# ./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
+# something like: This is hdf5-1.2.3 currently under development.
##############################################################################
sub getvers {
@@ -108,13 +113,17 @@ while ($_ = shift) {
}
die "mutually exclusive options given\n" if $set && $inc;
-# Determine file to use
+# Determine file to use as H5public.h and README. The README file is
+# always in the directory above H5public.h
unless ($file) {
for (@files) {
($file=$_,last) if -f $_;
}
}
die "unable to read file: $file\n" unless -r $file;
+$README = $file;
+$README =~ s/[^\/]*$/..\/README/;
+die "unable to read file: $README\n" unless -r $file;
# Get the current version number.
open FILE, $file or die "unable to open $file: $!\n";
@@ -148,6 +157,8 @@ if ($set) {
} elsif ($inc) {
die "unknown increment field: $inc\n";
} else {
+ # Nothing to do but print result
+ $README = "";
@newver = @curver;
}
@@ -169,6 +180,18 @@ if ($newver[0]!=$curver[0] ||
close FILE;
}
+# Update the README file
+if ($README) {
+ open FILE, $README or die "$README: $!\n";
+ @contents = <FILE>;
+ close FILE;
+ $contents[0] = sprintf("This is hdf5-%d.%d.%d currently under development\n",
+ @newver);
+ open FILE, ">$README" or die "$README: $!\n";
+ print FILE @contents;
+ close FILE;
+}
+
# Print the new version number
if ($verbose) {
printf "version %d.%d release %d\n", @newver;