summaryrefslogtreecommitdiffstats
path: root/bin/h5vers
diff options
context:
space:
mode:
authorlrknox <lrknox>2017-02-21 21:18:17 (GMT)
committerlrknox <lrknox>2017-02-21 21:18:17 (GMT)
commit6924e1f9f8c8b3bf3e44871d3319c6a3337cb093 (patch)
tree605ba72d791160561ae6e680d5430e29956bbb1a /bin/h5vers
parent7238751d5ab91b8856f520dc612fa3f1c512f54c (diff)
downloadhdf5-6924e1f9f8c8b3bf3e44871d3319c6a3337cb093.zip
hdf5-6924e1f9f8c8b3bf3e44871d3319c6a3337cb093.tar.gz
hdf5-6924e1f9f8c8b3bf3e44871d3319c6a3337cb093.tar.bz2
h5vers:
Added code to update version strings in config/cmake/scripts/HDF5config.cmake. release: Added options to create CMake tar.gz and zip files containing the HDF5 source and scripts to build and test HDF5 with cmake and ctest by running a single command. These were previously assembled manually. Added a call to h5vers to set the version being released where it occurs in files. In particular, the sub-release version string "currently under development" was not being removed from cpp_doc_config or HDF5config.cmake.
Diffstat (limited to 'bin/h5vers')
-rwxr-xr-xbin/h5vers48
1 files changed, 39 insertions, 9 deletions
diff --git a/bin/h5vers b/bin/h5vers
index 9babf97..6ecf446 100755
--- a/bin/h5vers
+++ b/bin/h5vers
@@ -127,7 +127,7 @@ EOF
exit 1;
}
-# Parse arguments
+
my ($verbose, $set, $inc, $file, $rc);
my (@files) = ("H5public.h", "src/H5public.h", "../src/H5public.h");
while ($_ = shift) {
@@ -160,9 +160,10 @@ die "mutually exclusive options given\n" if $set && $inc;
# Determine file to use as H5public.h, README.txt,
# release_docs/RELEASE.txt, configure.ac, windows/src/H5pubconf.h
-# and config/lt_vers.am.
+# config/lt_vers.am and config/cmake/scripts/HDF5config.cmake.
# The README.txt, release_docs/RELEASE.txt, configure.ac,
-# windows/src/H5pubconf.h, and config/lt_vers.am
+# windows/src/H5pubconf.h, config/lt_vers.am and
+# config/cmake/scripts/HDF5config.cmake
# files are always in the directory above H5public.h
unless ($file) {
for (@files) {
@@ -175,6 +176,10 @@ die "unable to read file: $file\n" unless -r $file;
my $LT_VERS = $file;
$LT_VERS =~ s/[^\/]*$/..\/config\/lt_vers.am/;
die "unable to read file: $LT_VERS\n" unless -r $file;
+# config/cmake/scripts/HDF5config.cmake
+my $HDF5CONFIGCMAKE = $file;
+$HDF5CONFIGCMAKE =~ s/[^\/]*$/..\/config\/cmake\/scripts\/HDF5config.cmake/;
+die "unable to read file: $HDF5CONFIGCMAKE\n" unless -r $file;
# README.txt
my $README = $file;
$README =~ s/[^\/]*$/..\/README.txt/;
@@ -239,7 +244,8 @@ if ($set) {
$RELEASE = "";
$CONFIGURE = "";
$CPP_DOC_CONFIG = "";
- $LT_VERS = "";
+ $LT_VERS = "";
+ $HDF5CONFIGCMAKE = "";
@newver = @curver;
}
@@ -321,20 +327,43 @@ if ($RELEASE) {
# Update the c++/src/cpp_doc_config file
if ($CPP_DOC_CONFIG) {
my $data = read_file($CPP_DOC_CONFIG);
- my $version_string = sprintf("\"%d.%d.%d%s %s\"",
+ my $sub_rel_ver_str = (
+ $newver[3] eq ""
+ ? sprintf("%s", "")
+ : sprintf("%s", "-".$newver[3].", currently under development")
+ );
+ my $version_string = sprintf("\"%d.%d.%d%s%s\"",
@newver[0,1,2],
- $newver[3] eq "" ? "" : "-".$newver[3],
- "currently under development");
-
+ $sub_rel_ver_str);
$data =~ s/PROJECT_NUMBER\s*=.*/PROJECT_NUMBER = $version_string/;
write_file($CPP_DOC_CONFIG, $data);
}
+# Update the config/cmake/scripts/HDF5config.cmake file
+if ($HDF5CONFIGCMAKE) {
+ my $data = read_file($HDF5CONFIGCMAKE);
+# my $sub_rel_ver_str = "";
+ my $sub_rel_ver_str = (
+ $newver[3] eq ""
+ ? sprintf("\"%s\"", "")
+ : sprintf("\"%s\"", "-".$newver[3].", currently under development")
+ );
+ my $version_string = sprintf("\"%d.%d.%d\"", @newver[0,1,2]);
+
+ $data =~ s/set\(CTEST_SOURCE_VERSION .*\)/set\(CTEST_SOURCE_VERSION $version_string\)/;
+ $data =~ s/set\(CTEST_SOURCE_VERSEXT .*\)/set\(CTEST_SOURCE_VERSEXT $sub_rel_ver_str\)/;
+
+ write_file($HDF5CONFIGCMAKE, $data);
+}
+
+
+
# helper function to read the file for updating c++/src/cpp_doc_config file.
# The version string in that file is not at the top, so the string replacement
# is not for the first line, and reading/writing the entire file as one string
# facilitates the substring replacement.
+#Presumably these will also work for resetting the version in HDF5config.cmake.
sub read_file {
my ($filename) = @_;
@@ -346,7 +375,8 @@ sub read_file {
return $all;
}
-# helper function to write the file for updating c++/src/cpp_doc_config file.
+# helper function to write the file for updating c++/src/cpp_doc_config
+# and config/cmake/scripts/HDF5config.cmake files.
sub write_file {
my ($filename, $content) = @_;