From: Karen Etheridge Date: Fri, 4 Jul 2014 01:26:56 +0000 (-0700) Subject: fix bump-version to use the right filename(s), handle decimal versions X-Git-Tag: v1.005005~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2Fstrictures.git;a=commitdiff_plain;h=ef585b66ab190c84af17c510a7e9246794f10f6d fix bump-version to use the right filename(s), handle decimal versions --- diff --git a/maint/bump-version b/maint/bump-version index 26de88b..56616e7 100755 --- a/maint/bump-version +++ b/maint/bump-version @@ -8,6 +8,7 @@ use autodie; chomp(my $LATEST = qx(grep '^[0-9]' Changes | head -1 | awk '{print \$1}')); my @parts = split /\./, $LATEST; +push @parts, 0, 0; my $OLD_DECIMAL = sprintf('%i.%03i%03i', @parts); @@ -23,14 +24,16 @@ $new_parts[$bump_this]++; my $NEW_DECIMAL = sprintf('%i.%03i%03i', @new_parts); -warn "Bumping $OLD_DECIMAL -> $NEW_DECIMAL\n"; +my @PM_FILES = ( 'lib/strictures.pm' ); -my $PM_FILE = 'lib/Module/Metadata.pm'; +foreach my $filename (@PM_FILES) { + warn "Bumping $OLD_DECIMAL -> $NEW_DECIMAL in $filename\n"; -my $file = do { local (@ARGV, $/) = ($PM_FILE); <> }; + my $file = do { local (@ARGV, $/) = ($filename); <> }; -$file =~ s/(?<=\$VERSION = ')${\quotemeta $OLD_DECIMAL}/${NEW_DECIMAL}/; + $file =~ s/(?<=\$VERSION = ')${\quotemeta $OLD_DECIMAL}/${NEW_DECIMAL}/; -open my $out, '>', $PM_FILE; + open my $out, '>', $filename; -print $out $file; + print $out $file; +}