Repository: lucy-clownfish
Updated Branches:
  refs/heads/master efc37a364 -> 0c5c166ee


Export major version from Perl bindings

Fixes CLOWNFISH-70.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/997e246b
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/997e246b
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/997e246b

Branch: refs/heads/master
Commit: 997e246b582b068615b1fbdcfad61aa9f6a13ae9
Parents: efc37a3
Author: Nick Wellnhofer <wellnho...@aevum.de>
Authored: Thu Feb 11 12:58:49 2016 +0100
Committer: Nick Wellnhofer <wellnho...@aevum.de>
Committed: Thu Feb 11 13:01:49 2016 +0100

----------------------------------------------------------------------
 compiler/perl/lib/Clownfish/CFC.pm |  1 +
 devel/bin/update_version           | 12 ++++++++++--
 runtime/perl/lib/Clownfish.pm      |  1 +
 3 files changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/997e246b/compiler/perl/lib/Clownfish/CFC.pm
----------------------------------------------------------------------
diff --git a/compiler/perl/lib/Clownfish/CFC.pm 
b/compiler/perl/lib/Clownfish/CFC.pm
index 0344bcb..39ce119 100644
--- a/compiler/perl/lib/Clownfish/CFC.pm
+++ b/compiler/perl/lib/Clownfish/CFC.pm
@@ -19,6 +19,7 @@ use warnings;
 package Clownfish::CFC;
 our $VERSION = '0.004000';
 $VERSION = eval $VERSION;
+our $MAJOR_VERSION = 0.004000;
 
 END {
     Clownfish::CFC::Model::Class->_clear_registry();

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/997e246b/devel/bin/update_version
----------------------------------------------------------------------
diff --git a/devel/bin/update_version b/devel/bin/update_version
index 6df810d..932fa42 100755
--- a/devel/bin/update_version
+++ b/devel/bin/update_version
@@ -28,13 +28,13 @@ my $version = shift(@ARGV) or die $usage;
 # standardize version strings
 my ( $x, $y, $z, $dev );
 if ( $version =~ m/^(\d+)\.(\d+)\.(\d+)$/ ) {
-    ( $x, $y, $z ) = ( $1, $2, $3 );
+    ( $x, $y, $z, $dev ) = ( $1, $2, $3, 0 );
 }
 elsif ( $version =~ m/^(\d+)\.(\d+)\.(\d+)_(\d+)$/ ) {
     ( $x, $y, $z, $dev ) = ( $1, $2, $3, $4 );
 }
 elsif ( $version =~ m/^(\d+)\.(\d\d\d)(\d\d\d)$/ ) {
-    ( $x, $y, $z ) = ( int($1), int($2), int($3) );
+    ( $x, $y, $z, $dev ) = ( int($1), int($2), int($3), 0 );
 }
 elsif ( $version =~ m/^(\d+)\.(\d\d\d)(\d\d\d)_(\d\d\d)$/ ) {
     ( $x, $y, $z, $dev ) = ( int($1), int($2), int($3), int($4) );
@@ -70,6 +70,10 @@ $buf =~ s/(our \$VERSION\ +=\ +)'.+?'/$1'$x_yyyzzz_version'/g
     or die "no match";
 $buf =~ s/XSLoader::load\( 'Clownfish::CFC', '(.+?)'/XSLoader::load\( 
'Clownfish::CFC', '$x_y_z_d_version'/
     or die "no match";
+if ( $z == 0 && $dev == 0 ) {
+    $buf =~ s/(our \$MAJOR_VERSION\ +=\ +)[\d._]+/$1$x_yyyzzz_version/g
+        or die "no match";
+}
 write_file( 'compiler/perl/lib/Clownfish/CFC.pm', $buf );
 
 # Update Clownfish.pm.
@@ -80,6 +84,10 @@ $buf =~ s/(bootstrap Clownfish ')(.+?)'/$1$x_y_z_d_version'/
     or die "no match";
 $buf =~ s/^\d+\.\d+\.\d+(_\d+)?\b$/$x_y_z_d_version/m
     or die "no match";
+if ( $z == 0 && $dev == 0 ) {
+    $buf =~ s/(our \$MAJOR_VERSION\ +=\ +)[\d._]+/$1$x_yyyzzz_version/g
+        or die "no match";
+}
 write_file( 'runtime/perl/lib/Clownfish.pm', $buf );
 
 # Update Clownfish.pod.

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/997e246b/runtime/perl/lib/Clownfish.pm
----------------------------------------------------------------------
diff --git a/runtime/perl/lib/Clownfish.pm b/runtime/perl/lib/Clownfish.pm
index 840bcbd..1a6f7cd 100644
--- a/runtime/perl/lib/Clownfish.pm
+++ b/runtime/perl/lib/Clownfish.pm
@@ -22,6 +22,7 @@ use 5.008003;
 
 our $VERSION = '0.004000';
 $VERSION = eval $VERSION;
+our $MAJOR_VERSION = 0.004000;
 
 use Exporter 'import';
 BEGIN {

Reply via email to