In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/8d9a83214024695752d0961cb59df65d4124ef98?hp=abec7027d3cfd4d003895131f8b4ec25ca774a18>
- Log ----------------------------------------------------------------- commit 8d9a83214024695752d0961cb59df65d4124ef98 Merge: abec7027d3 08ee4cf2ab Author: Aaron Crane <a...@cpan.org> Date: Fri Dec 30 18:48:36 2016 +0000 [MERGE] Further improvements to Porting/sync-with-cpan With these changes, all the recent module imports could have been handled automatically; and applying it to a tricky case that hasn't yet been imported does now at least yield better advice on how to proceed. commit 08ee4cf2ab8d97f255f088278a5130bbb4974b64 Author: Aaron Crane <a...@cpan.org> Date: Fri Dec 30 18:27:14 2016 +0000 Porting/sync-with-cpan: another preflight check M Porting/sync-with-cpan commit 60f5272c9b4d5d2eaa43f87c74b6da989c3068ca Author: Aaron Crane <a...@cpan.org> Date: Fri Dec 30 18:00:45 2016 +0000 Revert "Porting/sync-with-cpan: apply --jobs=N when running module tests" This reverts commit 06998c55f9d56cbee761af0d6dc5ec06fcee3c62. It turns out that some CPAN modules' test suites fail when run in parallel. For example, DB_File has three test files, all of which create database files of the same names. (I'm slightly puzzled as to why I don't see failures from that module whenever running Perl's test suite in parallel; my guess is that, when only a few test files are being run, it's much more likely that the tests will be run simultaneously.) We can submit patches for modules with serial-only test suites, but for now at least, the best course of action seems to be for sync-with-cpan to run modules' test suites serially. M Porting/sync-with-cpan commit b65746715c7c616f06a21036aa3986b47e8519bf Author: Aaron Crane <a...@cpan.org> Date: Fri Dec 30 16:07:05 2016 +0000 Porting/sync-with-cpan: handle unwritable files in tarballs If the tarball contains an unwritable file, we were throwing an exception when trying to open the file for appending. Opening the file isn't actually necessary for bumping the file's timestamp, which was the intention of that code. However, it's a good idea to make the file locally-writable anyway, so that if the user later needs to edit it, they can do so easily. M Porting/sync-with-cpan commit 746bc9e17be02267078e17ac982eaff3ea41488d Author: Aaron Crane <a...@cpan.org> Date: Fri Dec 30 16:04:35 2016 +0000 Porting/sync-with-cpan: remove needless loop The de_exec() routine is only ever called with one argument at a time, so simplify it. M Porting/sync-with-cpan commit ec1d1ba057d560ff810890310034e7757e97a1b2 Author: Aaron Crane <a...@cpan.org> Date: Fri Dec 30 15:40:16 2016 +0000 Porting/sync-with-cpan: fix bug in updating Maintainers.pl We must look for $module, not $cpan_mod, because the former is specifically the key in %Modules under which we found the details for this dist. M Porting/sync-with-cpan commit 469f794845017634fade642803387556b4f226d4 Author: Aaron Crane <a...@cpan.org> Date: Fri Dec 30 15:26:37 2016 +0000 Porting/sync-with-cpan: try to change "::" to "-" in module name This is needed for cases like IO-Compress when the user asks for "IO::Compress". In addition, if we still can't find the module, be more explicit about what the problem is. M Porting/sync-with-cpan commit 7035e4d30f85a7fd0408e933a583d34d140e3714 Author: Aaron Crane <a...@cpan.org> Date: Fri Dec 30 15:05:42 2016 +0000 Porting/sync-with-cpan: offer advice in the face of CUSTOMIZED M Porting/sync-with-cpan ----------------------------------------------------------------------- Summary of changes: Porting/sync-with-cpan | 63 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 48 insertions(+), 15 deletions(-) diff --git a/Porting/sync-with-cpan b/Porting/sync-with-cpan index e45b1f3bc8..9c6a6b02d2 100755 --- a/Porting/sync-with-cpan +++ b/Porting/sync-with-cpan @@ -203,11 +203,19 @@ sub find_type_f { # Equivalent of `chmod a-x` sub de_exec { - for my $filename ( @_ ) { - my $mode= (stat $filename)[2] & 0777; - if( $mode & 0111 ) { # exec-bit set - chmod $mode & 0666, $filename; - }; + my ($filename) = @_; + my $mode = (stat $filename)[2] & 0777; + if ($mode & 0111) { # exec-bit set + chmod $mode & 0666, $filename; + } +} + +# Equivalent of `chmod +w` +sub make_writable { + my ($filename) = @_; + my $mode = (stat $filename)[2] & 0777; + if (!($mode & 0222)) { # not writable + chmod $mode | (0222 & ~umask), $filename; } } @@ -229,15 +237,37 @@ my ($module) = shift; my $info = $Modules{$module}; if (!$info) { - # Maybe the user said "Test-Simple" instead of "Test::Simple". See if we - # can fix it up. - (my $guess = $module) =~ s/-/::/g; - $info = $Modules{$guess} - or die "Cannot find module $module"; + # Maybe the user said "Test-Simple" instead of "Test::Simple", or + # "IO::Compress" instead of "IO-Compress". See if we can fix it up. + my $guess = $module; + s/-/::/g or s/::/-/g for $guess; + $info = $Modules{$guess} or die <<"EOF"; +Cannot find module $module. +The available options are listed in the %Modules hash in Porting/Maintainers.pl +EOF say "Guessing you meant $guess instead of $module"; $module = $guess; } +if ($info->{CUSTOMIZED}) { + print <<"EOF"; +$module has a CUSTOMIZED entry in Porting/Maintainers.pl. + +This program's behaviour is to copy every CUSTOMIZED file into the version +of the module being imported. But that might not be the right thing: in some +cases, the new CPAN version will supersede whatever changes had previously +been made in blead, so it would be better to import the new CPAN files. + +If you've checked that the CUSTOMIZED versions are still correct, you can +proceed now. Otherwise, you should abort and investigate the situation. If +the blead customizations are no longer needed, delete the CUSTOMIZED entry +for $module in Porting/Maintainers.pl (and you'll also need to regenerate +t/porting/customized.dat in that case; see t/porting/customized.t). + +EOF + print "Hit return to continue; ^C to abort "; <STDIN>; +} + my $cpan_mod = @ARGV ? shift : $module; my $distribution = $$info {DISTRIBUTION}; @@ -275,6 +305,8 @@ if (defined $tarball) { die "Tarball $tarball is not a plain file\n" if !-f _; $new_file = $tarball; $new_version = $version // ($new_file =~ /-([0-9._]+(?:-TRIAL[0-9]*)?)\.tar\.gz/) [0]; + die "Blead and that tarball both have version $new_version of $module\n" + if $new_version eq $old_version; } else { # @@ -299,6 +331,9 @@ else { } $new_file = (split '/', $new_path) [-1]; + die "The latest version of $module is $new_version, but blead already has it\n" + if $new_version eq $old_version; + my $url = "http://search.cpan.org/CPAN/authors/id/$new_path"; say "Fetching $url"; # @@ -324,8 +359,7 @@ Archive::Tar->extract_archive( $new_file ); # ensure 'make' will update all files my $t= time; for my $file (find_type_f($new_dir)) { - open(my $fh,'>>',$file) || die "Cannot write $file:$!"; - close($fh); + make_writable($file); # for convenience if the user later edits it utime($t,$t,$file); }; @@ -542,8 +576,7 @@ chdir "t"; say "Running module tests"; my @test_files = grep { /\.t$/ } find_type_f( "../cpan/$pkg_dir" ); my $exe_dir = WIN32 ? "..\\" : './'; -$ENV{TEST_JOBS} = $_ for grep defined, $make_jobs; -my $output = `${exe_dir}perl$Config{_exe} -I../lib harness @test_files`; +my $output = `${exe_dir}perl$Config{_exe} TEST @test_files`; unless ($output =~ /All tests successful/) { say $output; exit 1; @@ -585,7 +618,7 @@ while (<$Maintainers_pl>) { } } - if (/\Q$cpan_mod/) { + if (/\Q$module/) { $in_mod_section = 1; } } -- Perl5 Master Repository