Require specific Clownfish version in Build.PL Auto-update the required Clownfish version only for new major releases. For minor relases, the exact required Clownfish and CFC versions must be updated manually, if necessary.
Fixes LUCY-287. Project: http://git-wip-us.apache.org/repos/asf/lucy/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/846598e8 Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/846598e8 Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/846598e8 Branch: refs/heads/master Commit: 846598e812b9060b76dcf7a18346b9291197da99 Parents: 5573fdb Author: Nick Wellnhofer <[email protected]> Authored: Sat Feb 6 16:15:40 2016 +0100 Committer: Nick Wellnhofer <[email protected]> Committed: Sat Feb 6 16:28:16 2016 +0100 ---------------------------------------------------------------------- devel/bin/update_version | 22 ++++++++++++++++------ perl/Build.PL | 4 ++-- 2 files changed, 18 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy/blob/846598e8/devel/bin/update_version ---------------------------------------------------------------------- diff --git a/devel/bin/update_version b/devel/bin/update_version index 8fd3768..31978ef 100755 --- a/devel/bin/update_version +++ b/devel/bin/update_version @@ -30,13 +30,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) ); @@ -86,6 +86,12 @@ write_file( 'perl/lib/Lucy.pod', $buf ); $buf = read_file('perl/Build.PL'); $buf =~ s/(dist_version\ +=>\ +)'.+?'/$1'$x_y_z_d_version'/ or die "no match"; +if ( $z == 0 && $dev == 0 ) { + $buf =~ s/(Clownfish::CFC::Perl::Build'\s*=>\s*)(.*?),/$1$x_yyyzzz_version,/g + or die "no match"; + $buf =~ s/(Clownfish'\s*=>\s*)(.*?),/$1$x_yyyzzz_version,/g + or die "no match"; +} write_file( 'perl/Build.PL', $buf ); # Update ruby/apache_lucy.gemspec @@ -104,16 +110,20 @@ write_file( 'ruby/lib/apache_lucy.rb', $buf ); $buf = read_file('core/Lucy.cfp'); $buf =~ s/("version":\s+)"v\d+\.\d+\.\d+"/$1"v$x_y_z_version"/ or die "no match"; -$buf =~ s/("Clownfish":\s+)"v\d+\.\d+\.\d+"/$1"v$x_y_z_version"/ - or die "no match"; +if ( $z == 0 && $dev == 0 ) { + $buf =~ s/("Clownfish":\s+)"v\d+\.\d+\.\d+"/$1"v$x_y_z_version"/ + or die "no match"; +} write_file( 'core/Lucy.cfp', $buf ); # Update TestLucy.cfp $buf = read_file('core/TestLucy.cfp'); $buf =~ s/("version":\s+)"v\d+\.\d+\.\d+"/$1"v$x_y_z_version"/ or die "no match"; -$buf =~ s/("Clownfish":\s+)"v\d+\.\d+\.\d+"/$1"v$x_y_z_version"/ - or die "no match"; +if ( $z == 0 && $dev == 0 ) { + $buf =~ s/("Clownfish":\s+)"v\d+\.\d+\.\d+"/$1"v$x_y_z_version"/ + or die "no match"; +} $buf =~ s/("Lucy":\s+)"v\d+\.\d+\.\d+"/$1"v$x_y_z_version"/ or die "no match"; write_file( 'core/TestLucy.cfp', $buf ); http://git-wip-us.apache.org/repos/asf/lucy/blob/846598e8/perl/Build.PL ---------------------------------------------------------------------- diff --git a/perl/Build.PL b/perl/Build.PL index 79f6a31..8e42328 100644 --- a/perl/Build.PL +++ b/perl/Build.PL @@ -42,11 +42,11 @@ my $builder = Lucy::Build->new( dist_version => '0.4.0', requires => { 'perl' => '5.8.3', - 'Clownfish' => undef, + 'Clownfish' => 0.004000, }, configure_requires => { 'Module::Build' => 0.280801, - 'Clownfish::CFC::Perl::Build' => undef, + 'Clownfish::CFC::Perl::Build' => 0.004000, }, build_requires => { 'Module::Build' => 0.280801,
