summaryrefslogtreecommitdiffstats
path: root/bin/versinc
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-04-23 21:52:09 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-04-23 21:52:09 (GMT)
commit6034a988cde841c002a9e467a6acd26cce895b8c (patch)
tree651741fa0166192d2e413f2b2f52c84897ef7306 /bin/versinc
parent1c1679b2d43a14170ee6759f578a2ecad4ab56c1 (diff)
downloadhdf5-6034a988cde841c002a9e467a6acd26cce895b8c.zip
hdf5-6034a988cde841c002a9e467a6acd26cce895b8c.tar.gz
hdf5-6034a988cde841c002a9e467a6acd26cce895b8c.tar.bz2
[svn-r357] ./MANIFEST
./bin/versinc Forgot to add this to cvs last time.
Diffstat (limited to 'bin/versinc')
-rw-r--r--bin/versinc28
1 files changed, 28 insertions, 0 deletions
diff --git a/bin/versinc b/bin/versinc
new file mode 100644
index 0000000..f60fc7f
--- /dev/null
+++ b/bin/versinc
@@ -0,0 +1,28 @@
+#! /usr/local/bin/perl -w
+require 5.003;
+
+$hdr = "./src/H5public.h";
+$bak = "./src/H5public.h~";
+$tmp = "./src/H5public.$$";
+
+# Open files
+open OLD, $hdr or die "cannot read $hdr";
+open NEW, ">$tmp" or die "cannot write to $tmp";
+
+while (<OLD>) {
+ if (/^(\#\s*define\s+H5_VERS_RELEASE\s+)(\d+)(.*)/) {
+ print NEW $1, $2+1, $3, "\n";
+ } elsif (/^(\#\s*define\s+H5_VERS_PATCH\s+)(\d+)(.*)/) {
+ print NEW $1, "0", $3, "\n";
+ } else {
+ print NEW;
+ }
+}
+close OLD;
+close NEW;
+
+# Create a backup
+rename $hdr, $bak or warn "cannot create backup version";
+rename $tmp, $hdr or die "cannot update version number";
+
+exit 0;