Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: Marpa-R2-2.009…
Fetching contributors…

Cannot retrieve contributors at this time

72 lines (63 sloc) 2.107 kb
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings FATAL => 'all';
use autodie;
use English qw( -no_match_vars );
use IPC::Cmd;
chomp( my $LATEST =
qx(grep '^[0-9]' r2/Changes | head -1 | awk '{print \$1}') );
warn "Bumping -> $LATEST\n";
my ( $major, $minor, $micro ) = ( $LATEST =~ m/\A (\d+) [.] (\d\d\d) [_]? (\d\d\d) /xms );
if ( not defined $micro ) {
die "bump_version Cannot handle new version number: $LATEST";
}
$major += 0;
$micro += 0;
$minor += 0;
my @versioned_files = split /\n/xms, <<'END_OF_LIST';
r2/html/lib/Marpa/R2/HTML/Callback.pm
r2/html/lib/Marpa/R2/HTML.pm
r2/lib/Marpa/R2/Grammar.pm
r2/lib/Marpa/R2/Internal.pm
r2/lib/Marpa/R2/Recognizer.pm
r2/lib/Marpa/R2/Value.pm
r2/lib/Marpa/R2.pm
END_OF_LIST
for my $versioned_file (@versioned_files) {
say STDERR $versioned_file;
my $file = do { local ( @ARGV, $/ ) = ($versioned_file); <> };
$file =~ s/(\$VERSION \s+ = \s+ ['] ) \d+ [.] \d\d\d [_]? \d\d\d /$1${LATEST}/xms;
open my $out, '>', $versioned_file;
print $out $file;
} ## end for my $versioned_file (@versioned_files)
for my $configure_ac_file (
qw(
r2/libmarpa/dev/dist/configure.ac
r2/libmarpa/dev/doc_dist/configure.ac
)
)
{
say STDERR $configure_ac_file;
my $file = do { local ( @ARGV, $/ ) = ($configure_ac_file); <> };
$file =~ s{
( m4_define [(] [\[] marpa_major_version [\]] [,] \s* [\[] ) \d+ ( [\]] )
}{$1${major}$2}xms;
$file =~ s{
( m4_define [(] [\[] marpa_minor_version [\]] [,] \s* [\[] ) \d+ ( [\]] )
}{$1${minor}$2}xms;
$file =~ s{
( m4_define [(] [\[] marpa_micro_version [\]] [,] \s* [\[] ) \d+ ( [\]] )
}{$1${micro}$2}xms;
open my $out, '>', $configure_ac_file;
print $out $file;
} ## end for my $configure_ac_file ( qw( r2/libmarpa/dev/dist/configure.ac...))
chdir 'r2';
die qq{"perl Build.PL" failed: $!}
if not IPC::Cmd::run(
command => [ $EXECUTABLE_NAME, 'Build.PL' ],
verbose => 1
);
die qq{"./Build distmeta" failed: $!}
if
not IPC::Cmd::run( command => [ './Build', 'distmeta' ], verbose => 1 );
Jump to Line
Something went wrong with that request. Please try again.