This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update Encode to CPAN version 2.42
[perl5.git] / Porting / bump-perl-version
old mode 100755 (executable)
new mode 100644 (file)
index 4d4df83..679aa28
@@ -118,14 +118,14 @@ my @maps =  (
     ],
     [
        qr{^(api_subversion(?:=|\s+)'?) (\d+) ('?)  (?!\.)}x,
-       sub { $2, "${1}0$3" },
-       0,
+       sub { $2, ($newy % 2) ? "$1$newz$3" : "${1}0$3" },
+       ($oldy % 2) ? $oldz : 0,
        qr/config/,
     ],
     [
        qr{^(api_versionstring(?:=|\s+)'?) ([\d\.]+) ('?) (?!\.)}x,
-       sub { $2, "$1$newx.$newy.0$3" },
-       "$oldx.$oldy.0",
+       sub { $2, ($newy % 2) ? "$1$newx.$newy.$newz$3": "$1$newx.$newy.0$3" },
+       ($oldy % 2) ? "$oldx.$oldy.$oldz" : "$oldx.$oldy.0",
        qr/config/,
     ],
     [
@@ -142,12 +142,12 @@ my @maps =  (
     [
        qr{\b (PERL_SUBVERSION(?:=|\s+)'?) (\d+) ('?)  (?!\.)}x,
        sub { $2, "$1$newz$3"},
-       $oldz,
+       ($oldy % 2) ? $oldz : 0,
     ],
     [
        qr{\b (PERL_API_SUBVERSION(?:=|\s+)'?) (\d+) ('?)  (?!\.)}x,
-       sub { $2, "${1}0$3"},
-       0,
+       sub { $2, ($newy % 2) ? "$1$newz$3" : "${1}0$3" },
+       $oldz,
     ],
     # these two formats are in README.vms
     [
@@ -162,18 +162,26 @@ my @maps =  (
     ],
     # 5.8.9
     [
-       qr{\b $oldx\.$oldy\.$oldz \b}x,
+       qr{ $oldx\.$oldy\.$oldz \b}x,
        sub {"", "$newx.$newy.$newz"},
        undef,
     ],
 
     # 5.008009
     [
-       qr{\b $old_decimal \b}x,
+       qr{ $old_decimal \b}x,
        sub {"", sprintf "%d.%03d%03d", $newx, $newy, $newz },
        undef,
     ],
 
+    # perl511, perl511.dll, perl511.lib, perl511s.lib, libperl511.a
+    [
+       qr{\b ((?:lib)?) perl (\d\d\d) (s?) \b }x,
+       sub {$2, "$1perl$newx$newy$3" },
+       "$oldx$oldy",
+       qr/makedef|win32|hints/,      # makedef.pl, README.win32, win32/*, hints/*
+    ],
+
 );
 
 
@@ -182,10 +190,13 @@ my @maps =  (
 my %SKIP_FILES = map { ($_ => 1) } qw(
     Changes
     MANIFEST
+    Porting/epigraphs.pod
     Porting/how_to_write_a_perldelta.pod
-    Porting/mergelog
-    Porting/mergelog-tool
+    Porting/release_managers_guide.pod
+    Porting/release_schedule.pod
+    Porting/bump-perl-version
     pod.lst
+    pp_ctl.c
 );
 my @SKIP_DIRS = qw(
     ext
@@ -289,6 +300,7 @@ sub do_update {
     my %contents;
     for my $file (sort keys %changes) {
        open my $fh, '<', $file or die "open '$file': $!\n";
+       binmode $fh;
        $contents{$file} = [ <$fh> ];
        chomp @{$contents{$file}};
        close $fh or die "close: '$file': $!\n";
@@ -319,6 +331,7 @@ sub do_update {
     for my $file (sort keys %contents) {
        my $nfile = "$file-new";
        open my $fh, '>', $nfile or die "create '$nfile' failed: $!\n";
+       binmode $fh;
        print $fh $_, "\n" for @{$contents{$file}};
        close $fh or die "failed to close $nfile; aborting: $!\n";