This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Move the tests that blow away %ENV to the end of t/op/magic.t
[perl5.git] / Porting / bump-perl-version
old mode 100755 (executable)
new mode 100644 (file)
index c460ad4..b5752fb
@@ -71,7 +71,7 @@ EOF
 my %opts;
 getopts('csu', \%opts) or usage;
 if ($opts{u}) {
-    @ARGV == 0 or usage('no version version numbers should be speciied');
+    @ARGV == 0 or usage('no version version numbers should be specified');
     # fake to stop warnings when calculating $oldx etc
     @ARGV = qw(99.99.99 99.99.99);
 }
@@ -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
     [
@@ -174,6 +174,14 @@ my @maps =  (
        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,12 +190,11 @@ my @maps =  (
 my %SKIP_FILES = map { ($_ => 1) } qw(
     Changes
     MANIFEST
+    Porting/epigraphs.pod
     Porting/how_to_write_a_perldelta.pod
     Porting/release_managers_guide.pod
-       Porting/release_schedule.pod
+    Porting/release_schedule.pod
     Porting/bump-perl-version
-    Porting/mergelog
-    Porting/mergelog-tool
     pod.lst
     pp_ctl.c
 );
@@ -209,7 +216,7 @@ elsif ($opts{u}) {
     do_update();
 }
 else {
-    usage('one of -c, -s or -u must be specifcied');
+    usage('one of -c, -s or -u must be specified');
 }
 exit 0;
 
@@ -272,7 +279,7 @@ sub do_update {
        elsif (/^\s+(\d+): -(.*)/) {
            my $old;
            ($line, $old) = ($1,$2);
-           die "$.: old line without preceeding filename\n"
+           die "$.: old line without preceding filename\n"
                            unless defined $file;
            die "Dup line number: $line\n" if exists $changes{$file}{$line};
            $changes{$file}{$line}[0] = $old;
@@ -293,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";
@@ -323,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";