Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ivan Kruglov
committed
Feb 22, 2017
1 parent
34fe416
commit fd58556
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
fixver-sp.pl | ||
|
||
# Avoid archives of this distribution | ||
\bSereal-Path-[\d\.\_]+ | ||
\bSereal-Path-\.c$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
use strict; | ||
use warnings; | ||
use Getopt::Long; | ||
|
||
my @files= qw( | ||
Iterator/lib/Sereal/Path/Iterator.pm | ||
Tie/lib/Sereal/Path/Tie.pm | ||
lib/Sereal/Path.pm | ||
lib/Sereal/Path/Constants.pm | ||
); | ||
|
||
my $to= shift @ARGV; | ||
|
||
die "usage: MAJOR.MINOR_(DEV) REASON" if !$to; | ||
my $reason= join " ", @ARGV; | ||
die "usage: $0 VERSION REASON" if !$reason; | ||
|
||
my ($major,$minor,$dev)= split/[_.]/, $to; | ||
|
||
$to= $dev ? sprintf "%d.%03d_%03d", $major, $minor, $dev | ||
: sprintf "%d.%03d", $major, $minor | ||
; | ||
|
||
my %special= ( | ||
'Sereal/lib/Sereal.pm' => $to | ||
); | ||
|
||
foreach my $file (@files) { | ||
open my $in, "<", $file | ||
or die "Failed to open for read '$file': $!"; | ||
unlink $file; | ||
open my $out, ">", $file | ||
or die "Failed to open for write '$file': $!"; | ||
while (<$in>) { | ||
s/\$VERSION\s*=\s*'[^']+'/\$VERSION = '$to'/g; | ||
print $out $_; | ||
} | ||
} | ||
|
||
print <<"EOF_TEXT"; | ||
git clean -fdx && perl Makefile.PL && make && make manifest && make disttest && make dist && | ||
git commit -a -m'Release Sereal::Path v$to - $reason' && | ||
git tag Sereal-Path-$to -m'Release Sereal::Path version $to ($reason)' && | ||
git push && git push --tags | ||
cpan-upload -verbose Sereal-Path-$to.tar.gz | ||
EOF_TEXT | ||
|