diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-06-18 16:39:25 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-06-18 17:10:26 -0500 |
commit | 9807c17b8e7ba89aa1d1f0a298b7ab5620cc3104 (patch) | |
tree | 2471e43da599c5ae7f265b41da53661d2b1d8abc | |
parent | 83d3dd1de856357daa35501d203988dd67793714 (diff) | |
download | perl-9807c17b8e7ba89aa1d1f0a298b7ab5620cc3104.tar.gz |
teach sync-with-cpan how to update Maintainers.pl
-rwxr-xr-x | Porting/sync-with-cpan | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/Porting/sync-with-cpan b/Porting/sync-with-cpan index e3bbc68d03..e6f59b15e5 100755 --- a/Porting/sync-with-cpan +++ b/Porting/sync-with-cpan @@ -430,10 +430,48 @@ print "\n"; say "Failed tests: @failed" if @failed; -print "Now you ought to run a make; make test ...\n"; +say "Attempting to update Maintainers.pl"; +chdir '..'; + +open my $Maintainers_pl, '<', 'Porting/Maintainers.pl'; +open my $new_Maintainers_pl, '>', 'Maintainers.pl'; + +my $found; +my $in_mod_section; +while (<$Maintainers_pl>) { + if (!$found) { + if ($in_mod_section) { + if (/DISTRIBUTION/) { + if (s/\Q$old_version/$version/) { + $found = 1; + } + } + + if (/^ }/) { + $in_mod_section = 0; + } + } + + if (/\Q$cpan_mod/) { + $in_mod_section = 1; + } + } + + print $new_Maintainers_pl $_; +} + +if ($found) { + unlink 'Porting/Maintainers.pl'; + rename 'Maintainers.pl' => 'Porting/Maintainers.pl'; + system chmod => 'a+x', 'Porting/Maintainers.pl'; +} +else { + say "Could not update Porting/Maintainers.pl."; + say "Make sure you update this by hand before committing."; +} -say "Do not forget to update Porting/Maintainers.pl before committing"; say "$o_module is now version $new_version"; +say "Now you ought to run a make; make test ..."; __END__ |