From: Karen Etheridge Date: Sat, 4 Oct 2014 20:11:06 +0000 (-0700) Subject: also update version in Makefile.PL (e.g. in provides metadata) X-Git-Tag: v0.002000~10 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a4c19845891906cd4d3c728f6069f0080dd18344;p=p5sagit%2FDistar.git also update version in Makefile.PL (e.g. in provides metadata) --- diff --git a/helpers/bump-version b/helpers/bump-version index e237bbb..4787271 100755 --- a/helpers/bump-version +++ b/helpers/bump-version @@ -79,6 +79,31 @@ find({ }, }, 'lib'); +MAKEFILE_PL: { + my $file = 'Makefile.PL'; + open my $fh, '<', $file + or die "can't open $file: $!"; + my $content = do { local $/; <$fh> }; + close $fh; + + $content =~ s{ + ( version \s* => \s* ) + (['"]?) v?([0-9]+(?:[._][0-9]+)*) \2 + ( \s*, ) + (?: + (\s*\#\s*) + v?[.0-9]+ + )? + }{ + die "unable to bump version number in $file from $old_version, found $3\n" + if $3 ne $old_version; + $1 . "'" . $new_decimal . "'" . $4 . ($5 ? $5 . $new_vstring : '') + }xe + or last MAKEFILE_PL; + + $files{$file} = $content; +} + for my $file (sort keys %files) { warn " updating $file\n"; open my $fh, '>', $file