diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2015-10-09 20:05:25 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2015-10-09 20:05:25 (GMT) |
commit | 62f73dfa865207f7b0336b08578cb273be3ce691 (patch) | |
tree | 104963d624448b0036fac38bcbbaae9bcd2c495a /bin/h5vers | |
parent | 129c8840ae740afeab1013727614a76990c828ff (diff) | |
download | hdf5-62f73dfa865207f7b0336b08578cb273be3ce691.zip hdf5-62f73dfa865207f7b0336b08578cb273be3ce691.tar.gz hdf5-62f73dfa865207f7b0336b08578cb273be3ce691.tar.bz2 |
[svn-r28016] Undo r28009 changes.
Tested: jam.
Diffstat (limited to 'bin/h5vers')
-rwxr-xr-x | bin/h5vers | 60 |
1 files changed, 20 insertions, 40 deletions
@@ -105,13 +105,6 @@ sub setvers { $vers[3]?"-":"", $vers[3])/me; } -sub setltvers { - my ($contents, @vers) = @_; - $_[0] =~ s/^(\#\s*define\s+LT_VERS_INTERFACE\s+)\d+/$1$vers[0]/m; - $_[0] =~ s/^(\#\s*define\s+LT_VERS_REVISION\s+)\d+/$1$vers[1]/m; - $_[0] =~ s/^(\#\s*define\s+LT_VERS_AGE\s+)\d+/$1$vers[2]/m; -} - sub usage { my ($prog) = $0 =~ /([^\/]+)$/; print STDERR <<EOF; @@ -246,7 +239,7 @@ if ($set) { $RELEASE = ""; $CONFIGURE = ""; $CPP_DOC_CONFIG = ""; -# $LT_VERS = ""; + $LT_VERS = ""; @newver = @curver; } @@ -263,45 +256,35 @@ if ($newver[0]*1000000 + $newver[1]*1000 + $newver[2] > $version_increased="true"; } -my @newltver; -# Update the libtool shared library version in src/H5public.h -if ($LT_VERS) { - open FILE, $LT_VERS or die "$LT_VERS: $!\n"; - my ($contentsy) = join "", <FILE>; - close FILE; - - local($_) = $contentsy; - - # Don't increment LT_VERS_REVISION, but instead copy LT_VERS_* values - # to H5public.h. - # my ($lt_revision) = /^LT_VERS_REVISION\s*=\s*(\d+)/m; - # my $new_lt_revision = $lt_revision+1; - # ($contentsy) =~ s/^(LT_VERS_REVISION\s*=\s*)\d+/$1$new_lt_revision/m; - - # open FILE, ">$LT_VERS" or die "$LT_VERS: $!\n"; - # print FILE $contentsy; - # close FILE; - - my ($lt_interface) = /^LT_VERS_INTERFACE\s*=\s*(\d+)/m; - my ($lt_revision) = /^LT_VERS_REVISION\s*=\s*(\d+)/m; - my ($lt_age) = /^LT_VERS_AGE\s*=\s*(\d+)/m; - - @newltver = ($lt_interface, $lt_revision, $lt_age); - -} - # Update the version number if it changed. if ($newver[0]!=$curver[0] || $newver[1]!=$curver[1] || $newver[2]!=$curver[2] || $newver[3]ne$curver[3]) { setvers $contents, @newver or die "unable to set version\n"; -} - setltvers $contents, @newltver or die "unable to set lt version\n"; rename $file, "$file~" or die "unable to save backup file\n"; open FILE, ">$file" or die "unable to open $file but backup saved!\n"; print FILE $contents; close FILE; +} + +# Update the libtool shared library version in src/Makefile.am if +# the version number has increased. +if ($LT_VERS && $version_increased) { + open FILE, $LT_VERS or die "$LT_VERS: $!\n"; + my ($contentsy) = join "", <FILE>; + close FILE; + + local($_) = $contentsy; + + my ($lt_revision) = /^LT_VERS_REVISION\s*=\s*(\d+)/m; + my $new_lt_revision = $lt_revision+1; + ($contentsy) =~ s/^(LT_VERS_REVISION\s*=\s*)\d+/$1$new_lt_revision/m; + + open FILE, ">$LT_VERS" or die "$LT_VERS: $!\n"; + print FILE $contentsy; + close FILE; +} # Update the README.txt file if ($README) { @@ -453,9 +436,6 @@ if ($verbose) { $newver[3] eq "" ? "" : "-".$newver[3]); } -# print shared lib version in the format of interface.revision.age -printf("Shared lib version %d.%d.%d\n", @newltver[0,1,2]); - exit 0; # Because the first line of this file looks like a Bourne shell script, we |