diff options
author | David Golden <dagolden@cpan.org> | 2011-02-16 15:39:06 -0500 |
---|---|---|
committer | David Golden <dagolden@cpan.org> | 2011-02-16 15:43:09 -0500 |
commit | a7c7ab1eb55093ae1948d626729fa5ed34d738b2 (patch) | |
tree | bbb2fe58ad41a1c1e36962c974e95f3becf08299 /cpan | |
parent | 6ec9eadadea29cb041c69eec0fade79a4534f754 (diff) | |
download | perl-a7c7ab1eb55093ae1948d626729fa5ed34d738b2.tar.gz |
Update Module::Build to CPAN version 0.37_04
[DELTA]
0.37_04 - Wed Feb 16 15:27:21 EST 2011
[OTHER]
- moved scripts/ to bin/ for less confusing porting to bleadperl
0.37_03 - Wed Feb 16 09:54:05 EST 2011
[BUG FIXES]
- removed an irrelevant test in t/actions/installdeps.t that was causing
failures on some Cygwin platforms
[OTHER]
- dropped configure_requires as some CPAN clients apparently get
confused by having things in both configure_requires and requires
- bumped Parse::CPAN::Meta build prereq to 1.4401
- bumped CPAN::Meta prereq to 2.110420
0.37_02 - Mon Feb 7 21:05:30 EST 2011
[BUG FIXES]
- bumped CPAN::Meta prereq to 2.110390 to avoid a regression in 2.110360
0.37_01 - Thu Feb 3 03:44:38 EST 2011
[ENHANCEMENTS]
- Generates META.json and MYMETA.json consistent with version 2 of the
CPAN Meta Spec. [David Golden]
[BUG FIXES]
- t/signature.t now uses a mocked Module::Signature; this should be
more robust across platforms as it only needs to confirm that
Module::Build is calling Module::Signature when expected
[OTHER]
- Added CPAN::Meta and Parse::CPAN::Meta to prerequisites and dropped
CPAN::Meta::YAML
0.3624 - Thu Jan 27 11:38:39 EST 2011
- Fixed pod2html directory bugs and fixed creation of spurious blib
directory in core perl directory when running install.t (RT#63003)
[Chris Williams]
0.3623 - Wed Jan 26 17:45:30 EST 2011
- Fixed bugs involving bootstrapping configure_requires prerequisites
on older CPANPLUS clients or for either CPAN/CPANPLUS when using
the compatibility Makefile.PL
- Added diagnostic output when configure_requires are missing for
the benefit of users doing manual installation
Diffstat (limited to 'cpan')
34 files changed, 301 insertions, 117 deletions
diff --git a/cpan/Module-Build/Changes b/cpan/Module-Build/Changes index e77367e4a0..414fb36534 100644 --- a/cpan/Module-Build/Changes +++ b/cpan/Module-Build/Changes @@ -1,5 +1,66 @@ Revision history for Perl extension Module::Build. +0.37_04 - Wed Feb 16 15:27:21 EST 2011 + + [OTHER] + + - moved scripts/ to bin/ for less confusing porting to bleadperl + +0.37_03 - Wed Feb 16 09:54:05 EST 2011 + + [BUG FIXES] + + - removed an irrelevant test in t/actions/installdeps.t that was causing + failures on some Cygwin platforms + + [OTHER] + + - dropped configure_requires as some CPAN clients apparently get + confused by having things in both configure_requires and requires + + - bumped Parse::CPAN::Meta build prereq to 1.4401 + + - bumped CPAN::Meta prereq to 2.110420 + +0.37_02 - Mon Feb 7 21:05:30 EST 2011 + + [BUG FIXES] + + - bumped CPAN::Meta prereq to 2.110390 to avoid a regression in 2.110360 + +0.37_01 - Thu Feb 3 03:44:38 EST 2011 + + [ENHANCEMENTS] + + - Generates META.json and MYMETA.json consistent with version 2 of the + CPAN Meta Spec. [David Golden] + + [BUG FIXES] + + - t/signature.t now uses a mocked Module::Signature; this should be + more robust across platforms as it only needs to confirm that + Module::Build is calling Module::Signature when expected + + [OTHER] + + - Added CPAN::Meta and Parse::CPAN::Meta to prerequisites and dropped + CPAN::Meta::YAML + +0.3624 - Thu Jan 27 11:38:39 EST 2011 + + - Fixed pod2html directory bugs and fixed creation of spurious blib + directory in core perl directory when running install.t (RT#63003) + [Chris Williams] + +0.3623 - Wed Jan 26 17:45:30 EST 2011 + + - Fixed bugs involving bootstrapping configure_requires prerequisites + on older CPANPLUS clients or for either CPAN/CPANPLUS when using + the compatibility Makefile.PL + + - Added diagnostic output when configure_requires are missing for + the benefit of users doing manual installation + 0.3622 - Mon Jan 24 21:06:50 EST 2011 - No changes from 0.36_21 diff --git a/cpan/Module-Build/scripts/config_data b/cpan/Module-Build/bin/config_data index 40c8ea48f6..40c8ea48f6 100644 --- a/cpan/Module-Build/scripts/config_data +++ b/cpan/Module-Build/bin/config_data diff --git a/cpan/Module-Build/lib/Module/Build.pm b/cpan/Module-Build/lib/Module/Build.pm index e23375e7df..28aaf1e1b3 100644 --- a/cpan/Module-Build/lib/Module/Build.pm +++ b/cpan/Module-Build/lib/Module/Build.pm @@ -16,7 +16,7 @@ use Module::Build::Base; use vars qw($VERSION @ISA); @ISA = qw(Module::Build::Base); -$VERSION = '0.3622'; +$VERSION = '0.37_04'; $VERSION = eval $VERSION; @@ -682,7 +682,7 @@ specify the C<versionlib> parameter when you run the C<Build.PL> script: perl Build.PL --versionlib /my/version/place/ To override which version the module is installed as, specify the -C<versionlib> parameter when you run the C<Build.PL> script: +C<version> parameter when you run the C<Build.PL> script: perl Build.PL --version 0.50 @@ -858,7 +858,7 @@ This is the same as C<bindoc> above, but applies to HTML documents. =item libhtml -This is the same as C<bindoc> above, but applies to HTML documents. +This is the same as C<libdoc> above, but applies to HTML documents. =back @@ -1085,8 +1085,8 @@ Module-Build mailing list at <module-build@perl.org>. Bug reports are also welcome at <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Module-Build>. -The latest development version is available from the Subversion -repository at <https://svn.perl.org/modules/Module-Build/trunk/> +The latest development version is available from the Git +repository at <https://github.com/dagolden/module-build/> =head1 COPYRIGHT diff --git a/cpan/Module-Build/lib/Module/Build/API.pod b/cpan/Module-Build/lib/Module/Build/API.pod index 1106bc8469..3494cb96c8 100644 --- a/cpan/Module-Build/lib/Module/Build/API.pod +++ b/cpan/Module-Build/lib/Module/Build/API.pod @@ -1930,6 +1930,8 @@ accessor methods for the following properties: =item destdir() +=item dynamic_config() + =item get_options() =item html_css() @@ -1954,10 +1956,14 @@ accessor methods for the following properties: =item metafile() +=item metafile2() + =item module_name() =item mymetafile() +=item mymetafile2() + =item needs_compiler() =item orig_dir() @@ -2004,7 +2010,6 @@ accessor methods for the following properties: =back - =head1 MODULE METADATA If you would like to add other useful metadata, C<Module::Build> diff --git a/cpan/Module-Build/lib/Module/Build/Authoring.pod b/cpan/Module-Build/lib/Module/Build/Authoring.pod index 38fb3f089a..f8a5d14201 100644 --- a/cpan/Module-Build/lib/Module/Build/Authoring.pod +++ b/cpan/Module-Build/lib/Module/Build/Authoring.pod @@ -2,7 +2,6 @@ Module::Build::Authoring - Authoring Module::Build modules - =head1 DESCRIPTION When creating a C<Build.PL> script for a module, something like the diff --git a/cpan/Module-Build/lib/Module/Build/Base.pm b/cpan/Module-Build/lib/Module/Build/Base.pm index d42c8af4da..a448aa7a4a 100644 --- a/cpan/Module-Build/lib/Module/Build/Base.pm +++ b/cpan/Module-Build/lib/Module/Build/Base.pm @@ -4,7 +4,7 @@ package Module::Build::Base; use strict; use vars qw($VERSION); -$VERSION = '0.3622'; +$VERSION = '0.37_04'; $VERSION = eval $VERSION; BEGIN { require 5.00503 } @@ -902,10 +902,13 @@ __PACKAGE__->add_property(build_bat => 0); __PACKAGE__->add_property(bundle_inc => []); __PACKAGE__->add_property(bundle_inc_preload => []); __PACKAGE__->add_property(config_dir => '_build'); +__PACKAGE__->add_property(dynamic_config => 1); __PACKAGE__->add_property(include_dirs => []); __PACKAGE__->add_property(license => 'unknown'); __PACKAGE__->add_property(metafile => 'META.yml'); __PACKAGE__->add_property(mymetafile => 'MYMETA.yml'); +__PACKAGE__->add_property(metafile2 => 'META.json'); +__PACKAGE__->add_property(mymetafile2 => 'MYMETA.json'); __PACKAGE__->add_property(recurse_into => []); __PACKAGE__->add_property(use_rcfile => 1); __PACKAGE__->add_property(create_packlist => 1); @@ -1876,39 +1879,72 @@ EOF sub create_mymeta { my ($self) = @_; - my $mymetafile = $self->mymetafile; - my $metafile = $self->metafile; - # cleanup - if ( $self->delete_filetree($mymetafile) ) { - $self->log_verbose("Removed previous '$mymetafile'\n"); + my ($meta_obj, $mymeta); + my @metafiles = ( $self->metafile, $self->metafile2 ); + my @mymetafiles = ( $self->mymetafile, $self->mymetafile2 ); + + # cleanup old MYMETA + for my $f ( @mymetafiles ) { + if ( $self->delete_filetree($f) ) { + $self->log_verbose("Removed previous '$f'\n"); + } } - $self->log_info("Creating new '$mymetafile' with configuration results\n"); - # use old meta and update prereqs, if possible - my $mymeta; - if ( -f $metafile ) { - $mymeta = eval { $self->read_metafile( $self->metafile ) }; + # Try loading META.json or META.yml + if ( $self->try_require("CPAN::Meta", "2.110420") ) { + for my $file ( @metafiles ) { + next unless -f $file; + $meta_obj = eval { CPAN::Meta->load_file($file) }; + last if $meta_obj; + } } - # if we read META OK, just update it + + # maybe get a copy in spec v2 format (regardless of original source) + $mymeta = $meta_obj->as_struct + if $meta_obj; + + # if we have metadata, just update it if ( defined $mymeta ) { my $prereqs = $self->_normalize_prereqs; - for my $t ( 'configure_requires', @{$self->prereq_action_types} ) { - $mymeta->{$t} = $prereqs->{$t} if $prereqs->{$t}; + # XXX refactor this mapping somewhere + $mymeta->{prereqs}{runtime}{requires} = $prereqs->{requires}; + $mymeta->{prereqs}{build}{requires} = $prereqs->{build_requires}; + $mymeta->{prereqs}{runtime}{recommends} = $prereqs->{recommends}; + $mymeta->{prereqs}{runtime}{conflicts} = $prereqs->{conflicts}; + # delete empty entries + for my $phase ( keys %{$mymeta->{prereqs}} ) { + if ( ref $mymeta->{prereqs}{$phase} eq 'HASH' ) { + for my $type ( keys %{$mymeta->{prereqs}{$phase}} ) { + if ( ! defined $mymeta->{prereqs}{$phase}{$type} + || ! keys %{$mymeta->{prereqs}{$phase}{$type}} + ) { + delete $mymeta->{prereqs}{$phase}{$type}; + } + } + } + if ( ! defined $mymeta->{prereqs}{$phase} + || ! keys %{$mymeta->{prereqs}{$phase}} + ) { + delete $mymeta->{prereqs}{$phase}; + } } + $mymeta->{dynamic_config} = 0; + $mymeta->{generated_by} = "Module::Build version $Module::Build::VERSION"; + $meta_obj = CPAN::Meta->new( $mymeta ); } - # but generate from scratch, ignoring errors if META doesn't exist + # or generate from scratch, ignoring errors if META doesn't exist else { - $mymeta = $self->get_metadata( fatal => 0 ); + $meta_obj = $self->_get_meta_object( + quiet => 0, dynamic => 0, fatal => 0, auto => 0 + ); } - # MYMETA is always static - $mymeta->{dynamic_config} = 0; - # Note which M::B created it - $mymeta->{generated_by} = "Module::Build version $Module::Build::VERSION"; + my @created = $self->_write_meta_files( $meta_obj, 'MYMETA' ); + + $self->log_warn("Could not create MYMETA files\n") + unless @created; - $self->write_metafile( $mymetafile, $mymeta ) or - $self->log_warn("Could not create MYMETA.yml\n"); return 1; } @@ -2977,9 +3013,9 @@ sub find_PL_files { } return unless -d 'lib'; - return { - map {$_, [/^(.*)\.PL$/i ]} - @{ $self->rscan_dir('lib', $self->file_qr('\.PL$')) } + return { + map {$_, [/^(.*)\.PL$/i ]} + @{ $self->rscan_dir('lib', $self->file_qr('\.PL$')) } }; } @@ -3317,8 +3353,7 @@ sub htmlify_pods { ( $self->install_sets('core', 'lib'), # lib $self->install_sets('core', 'bin'), # bin $self->install_sets('site', 'lib'), # site/lib - ),File::Spec->rel2abs($self->blib) - ); + ) ), File::Spec->rel2abs($self->blib); my $podpath = join(":", map { tr,:\\,|/,; $_ } @podpath); @@ -3403,9 +3438,13 @@ sub htmlify_pods { } $self->log_verbose("P::H::pod2html @opts\n"); - eval { Pod::Html::pod2html(@opts); 1 } - or $self->log_warn("[$htmltool] pod2html( " . - join(", ", map { "q{$_}" } @opts) . ") failed: $@"); + { + my $orig = Cwd::getcwd(); + eval { Pod::Html::pod2html(@opts); 1 } + or $self->log_warn("[$htmltool] pod2html( " . + join(", ", map { "q{$_}" } @opts) . ") failed: $@"); + chdir($orig); + } } # We now have to cleanup the resulting html file if ( ! -r $tmpfile ) { @@ -3650,7 +3689,7 @@ sub ACTION_realclean { $self->depends_on('clean'); $self->log_info("Cleaning up configuration files\n"); $self->delete_filetree( - $self->config_dir, $self->mymetafile, $self->build_script + $self->config_dir, $self->mymetafile, $self->mymetafile2, $self->build_script ); } @@ -3782,9 +3821,12 @@ sub _check_mymeta_skip { my $mymetafile = $self->mymetafile; # we can't check it, just add it anyway to be safe - unless ( $skip_factory && $skip_factory->($maniskip)->($mymetafile) ) { - $self->log_warn("File '$maniskip' does not include '$mymetafile'. Adding it now.\n"); - $self->_append_maniskip("^$mymetafile\$", $maniskip); + for my $file ( $self->mymetafile, $self->mymetafile2 ) { + unless ( $skip_factory && $skip_factory->($maniskip)->($file) ) { + $self->log_warn("File '$maniskip' does not include '$file'. Adding it now.\n"); + my $safe = quotemeta($file); + $self->_append_maniskip("^$safe\$", $maniskip); + } } } @@ -3902,7 +3944,6 @@ HERE $self->delete_filetree('LICENSE'); - my $author = join " & ", @{ $self->dist_author }; my $fh = IO::File->new('> LICENSE') or die "Can't write LICENSE file: $!"; print $fh $license->fulltext; @@ -4420,7 +4461,8 @@ sub _software_license_object { return unless defined $class; # Software::License requires a 'holder' argument - my $sl = eval { $class->new({holder=>"nobody"}) }; + my $author = join( " & ", @{ $self->dist_author }) || 'unknown'; + my $sl = eval { $class->new({holder=>$author}) }; if ( $@ ) { $self->log_warn( "Error getting '$class' object: $@" ); } @@ -4452,16 +4494,15 @@ sub do_create_metafile { return if $self->{wrote_metadata}; my $p = $self->{properties}; - my $metafile = $self->metafile; unless ($p->{license}) { $self->log_warn("No license specified, setting license = 'unknown'\n"); $p->{license} = 'unknown'; } + my @metafiles = ( $self->metafile, $self->metafile2 ); # If we're in the distdir, the metafile may exist and be non-writable. - $self->delete_filetree($metafile); - $self->log_info("Creating $metafile\n"); + $self->delete_filetree($_) for @metafiles; # Since we're building ourself, we have to do some special stuff # here: the ConfigData module is found in blib/lib. @@ -4471,46 +4512,85 @@ sub do_create_metafile { push @INC, File::Spec->catdir($self->blib, 'lib'); } - if ( - $self->write_metafile( - $self->metafile,$self->get_metadata(fatal=>1, auto => 1) - ) - ){ + my $meta_obj = $self->_get_meta_object( + quiet => 1, fatal => 1, auto => 1 + ); + my @created = $self->_write_meta_files( $meta_obj, 'META' ); + if ( @created ) { $self->{wrote_metadata} = 1; - $self->_add_to_manifest('MANIFEST', $metafile); + $self->_add_to_manifest('MANIFEST', $_) for @created; } - return 1; } -# We handle slurping from the metafile to ensure proper utf8 if possible -sub read_metafile { +sub _write_meta_files { my $self = shift; - my ($metafile) = @_; + my ($meta, $file) = @_; + $file =~ s{\.(?:yml|json)$}{}; - return unless $self->try_require("CPAN::Meta::YAML", "0.002"); + my @created; + push @created, "$file\.yml" + if $meta && $meta->save( "$file\.yml", {version => "1.4"} ); + push @created, "$file\.json" + if $meta && $meta->save( "$file\.json" ); - my $string = $self->_slurp($metafile, $] < 5.8 ? "" : ":utf8"); - my $meta = CPAN::Meta::YAML->read_string($string) - or $self->log_warn( "Error parsing '$metafile': " . CPAN::Meta::YAML->errstr . "\n"); + if ( @created ) { + $self->log_info("Created " . join(" and ", @created) . "\n"); + } + return @created; +} + +sub _get_meta_object { + my $self = shift; + my %args = @_; + return unless $self->try_require("CPAN::Meta", "2.110420"); + + my $meta; + eval { + my $data = $self->get_metadata( + fatal => $args{fatal}, + auto => $args{auto}, + ); + $data->{dynamic_config} = $args{dynamic} if defined $args{dynamic}; + $meta = CPAN::Meta->create( $data ); + }; + if ($@ && ! $args{quiet}) { + $self->log_warn( + "Could not get valid metadata. Error is: $@\n" + ); + } - return $meta->[0] || {}; + return $meta; } -# We handle spewing to the metafile to ensure proper utf8 if possible +# We return a version 1.4 structure for backwards compatibility +sub read_metafile { + my $self = shift; + my ($metafile) = @_; + + return unless $self->try_require("CPAN::Meta", "2.110420"); + my $meta = CPAN::Meta->load_file($metafile); + return $meta->as_struct( {version => "1.4"} ); +} + +# For legacy compatibility, we upconvert a 1.4 data structure, ensuring +# validity, and then downconvert it back to save it. +# +# generally, this code should no longer be used sub write_metafile { my $self = shift; - my ($metafile, $node) = @_; + my ($metafile, $struct) = @_; - return unless $self->try_require("CPAN::Meta::YAML", "0.002"); + return unless $self->try_require("CPAN::Meta", "2.110420"); - my $yaml = CPAN::Meta::YAML->new($node); - my $string = $yaml->write_string; - return $self->_spew($metafile, $string, $] < 5.8 ? "" : ":utf8") + my $meta = CPAN::Meta->new( $struct ); + return $meta->save( $metafile, { version => "1.4" } ); } sub normalize_version { my ($self, $version) = @_; + $version = 0 unless defined $version; + if ( $version =~ /[=<>!,]/ ) { # logic, not just version # take as is without modification } @@ -4545,7 +4625,6 @@ sub _normalize_prereqs { return \%prereq_types; } - # wrapper around old prepare_metadata API; sub get_metadata { my ($self, %args) = @_; diff --git a/cpan/Module-Build/lib/Module/Build/Compat.pm b/cpan/Module-Build/lib/Module/Build/Compat.pm index fa92296694..eee856ec2a 100644 --- a/cpan/Module-Build/lib/Module/Build/Compat.pm +++ b/cpan/Module-Build/lib/Module/Build/Compat.pm @@ -2,7 +2,7 @@ package Module::Build::Compat; use strict; use vars qw($VERSION); -$VERSION = '0.3622'; +$VERSION = '0.37_04'; use File::Basename (); use File::Spec; diff --git a/cpan/Module-Build/lib/Module/Build/Config.pm b/cpan/Module-Build/lib/Module/Build/Config.pm index b9e1cebd1b..e73bad46f8 100644 --- a/cpan/Module-Build/lib/Module/Build/Config.pm +++ b/cpan/Module-Build/lib/Module/Build/Config.pm @@ -2,7 +2,7 @@ package Module::Build::Config; use strict; use vars qw($VERSION); -$VERSION = '0.3622'; +$VERSION = '0.37_04'; $VERSION = eval $VERSION; use Config; diff --git a/cpan/Module-Build/lib/Module/Build/Cookbook.pm b/cpan/Module-Build/lib/Module/Build/Cookbook.pm index 4ab571482b..43ec37b2a4 100644 --- a/cpan/Module-Build/lib/Module/Build/Cookbook.pm +++ b/cpan/Module-Build/lib/Module/Build/Cookbook.pm @@ -1,7 +1,7 @@ package Module::Build::Cookbook; use strict; use vars qw($VERSION); -$VERSION = '0.3622'; +$VERSION = '0.37_04'; =head1 NAME diff --git a/cpan/Module-Build/lib/Module/Build/Dumper.pm b/cpan/Module-Build/lib/Module/Build/Dumper.pm index b89f21ddab..7a32de20e7 100644 --- a/cpan/Module-Build/lib/Module/Build/Dumper.pm +++ b/cpan/Module-Build/lib/Module/Build/Dumper.pm @@ -1,7 +1,7 @@ package Module::Build::Dumper; use strict; use vars qw($VERSION); -$VERSION = '0.3622'; +$VERSION = '0.37_04'; # This is just a split-out of a wrapper function to do Data::Dumper # stuff "the right way". See: diff --git a/cpan/Module-Build/lib/Module/Build/ModuleInfo.pm b/cpan/Module-Build/lib/Module/Build/ModuleInfo.pm index 2ee9faee7c..9c2dae126d 100644 --- a/cpan/Module-Build/lib/Module/Build/ModuleInfo.pm +++ b/cpan/Module-Build/lib/Module/Build/ModuleInfo.pm @@ -4,7 +4,7 @@ package Module::Build::ModuleInfo; use strict; use vars qw($VERSION); -$VERSION = '0.3622'; +$VERSION = '0.37_04'; $VERSION = eval $VERSION; require Module::Metadata; diff --git a/cpan/Module-Build/lib/Module/Build/Notes.pm b/cpan/Module-Build/lib/Module/Build/Notes.pm index 3d9e56cd6b..d66e43864e 100644 --- a/cpan/Module-Build/lib/Module/Build/Notes.pm +++ b/cpan/Module-Build/lib/Module/Build/Notes.pm @@ -4,7 +4,7 @@ package Module::Build::Notes; use strict; use vars qw($VERSION); -$VERSION = '0.3622'; +$VERSION = '0.37_04'; $VERSION = eval $VERSION; use Data::Dumper; use IO::File; diff --git a/cpan/Module-Build/lib/Module/Build/PPMMaker.pm b/cpan/Module-Build/lib/Module/Build/PPMMaker.pm index a683b56dd2..676920129b 100644 --- a/cpan/Module-Build/lib/Module/Build/PPMMaker.pm +++ b/cpan/Module-Build/lib/Module/Build/PPMMaker.pm @@ -5,7 +5,7 @@ use Config; use vars qw($VERSION); use IO::File; -$VERSION = '0.3622'; +$VERSION = '0.37_04'; $VERSION = eval $VERSION; # This code is mostly borrowed from ExtUtils::MM_Unix 6.10_03, with a diff --git a/cpan/Module-Build/lib/Module/Build/Platform/Amiga.pm b/cpan/Module-Build/lib/Module/Build/Platform/Amiga.pm index d4fed10fa9..f47f8a1253 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/Amiga.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/Amiga.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::Amiga; use strict; use vars qw($VERSION); -$VERSION = '0.3622'; +$VERSION = '0.37_04'; $VERSION = eval $VERSION; use Module::Build::Base; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/Default.pm b/cpan/Module-Build/lib/Module/Build/Platform/Default.pm index b19f2ed1e5..845e34eb45 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/Default.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/Default.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::Default; use strict; use vars qw($VERSION); -$VERSION = '0.3622'; +$VERSION = '0.37_04'; $VERSION = eval $VERSION; use Module::Build::Base; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/EBCDIC.pm b/cpan/Module-Build/lib/Module/Build/Platform/EBCDIC.pm index 0bd5a7079a..65ee0038ab 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/EBCDIC.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/EBCDIC.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::EBCDIC; use strict; use vars qw($VERSION); -$VERSION = '0.3622'; +$VERSION = '0.37_04'; $VERSION = eval $VERSION; use Module::Build::Base; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/MPEiX.pm b/cpan/Module-Build/lib/Module/Build/Platform/MPEiX.pm index cb0a42b8e5..91711829f6 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/MPEiX.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/MPEiX.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::MPEiX; use strict; use vars qw($VERSION); -$VERSION = '0.3622'; +$VERSION = '0.37_04'; $VERSION = eval $VERSION; use Module::Build::Base; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/MacOS.pm b/cpan/Module-Build/lib/Module/Build/Platform/MacOS.pm index 9af367afce..ca7bb7eb16 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/MacOS.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/MacOS.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::MacOS; use strict; use vars qw($VERSION); -$VERSION = '0.3622'; +$VERSION = '0.37_04'; $VERSION = eval $VERSION; use Module::Build::Base; use vars qw(@ISA); diff --git a/cpan/Module-Build/lib/Module/Build/Platform/RiscOS.pm b/cpan/Module-Build/lib/Module/Build/Platform/RiscOS.pm index fc746bafb7..c8a8fe4e79 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/RiscOS.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/RiscOS.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::RiscOS; use strict; use vars qw($VERSION); -$VERSION = '0.3622'; +$VERSION = '0.37_04'; $VERSION = eval $VERSION; use Module::Build::Base; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/Unix.pm b/cpan/Module-Build/lib/Module/Build/Platform/Unix.pm index 2db3adf4ca..3897c7c95a 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/Unix.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/Unix.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::Unix; use strict; use vars qw($VERSION); -$VERSION = '0.3622'; +$VERSION = '0.37_04'; $VERSION = eval $VERSION; use Module::Build::Base; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/VMS.pm b/cpan/Module-Build/lib/Module/Build/Platform/VMS.pm index 5f6d3e86bf..24087c5b1e 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/VMS.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/VMS.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::VMS; use strict; use vars qw($VERSION); -$VERSION = '0.3622'; +$VERSION = '0.37_04'; $VERSION = eval $VERSION; use Module::Build::Base; use Config; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/VOS.pm b/cpan/Module-Build/lib/Module/Build/Platform/VOS.pm index 98f1151f0e..29e8ea3159 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/VOS.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/VOS.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::VOS; use strict; use vars qw($VERSION); -$VERSION = '0.3622'; +$VERSION = '0.37_04'; $VERSION = eval $VERSION; use Module::Build::Base; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/Windows.pm b/cpan/Module-Build/lib/Module/Build/Platform/Windows.pm index 3e13e72be7..3daf4f1741 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/Windows.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/Windows.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::Windows; use strict; use vars qw($VERSION); -$VERSION = '0.3622'; +$VERSION = '0.37_04'; $VERSION = eval $VERSION; use Config; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/aix.pm b/cpan/Module-Build/lib/Module/Build/Platform/aix.pm index 03dfb1e4d7..692dbc7cbc 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/aix.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/aix.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::aix; use strict; use vars qw($VERSION); -$VERSION = '0.3622'; +$VERSION = '0.37_04'; $VERSION = eval $VERSION; use Module::Build::Platform::Unix; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/cygwin.pm b/cpan/Module-Build/lib/Module/Build/Platform/cygwin.pm index 6e06b7b895..8ddd242221 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/cygwin.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/cygwin.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::cygwin; use strict; use vars qw($VERSION); -$VERSION = '0.3622'; +$VERSION = '0.37_04'; $VERSION = eval $VERSION; use Module::Build::Platform::Unix; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/darwin.pm b/cpan/Module-Build/lib/Module/Build/Platform/darwin.pm index 3b6b482b83..465701d477 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/darwin.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/darwin.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::darwin; use strict; use vars qw($VERSION); -$VERSION = '0.3622'; +$VERSION = '0.37_04'; $VERSION = eval $VERSION; use Module::Build::Platform::Unix; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/os2.pm b/cpan/Module-Build/lib/Module/Build/Platform/os2.pm index 310900ae6b..e21be6a386 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/os2.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/os2.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::os2; use strict; use vars qw($VERSION); -$VERSION = '0.3622'; +$VERSION = '0.37_04'; $VERSION = eval $VERSION; use Module::Build::Platform::Unix; diff --git a/cpan/Module-Build/lib/Module/Build/PodParser.pm b/cpan/Module-Build/lib/Module/Build/PodParser.pm index 2684401453..5d402ad57f 100644 --- a/cpan/Module-Build/lib/Module/Build/PodParser.pm +++ b/cpan/Module-Build/lib/Module/Build/PodParser.pm @@ -2,7 +2,7 @@ package Module::Build::PodParser; use strict; use vars qw($VERSION); -$VERSION = '0.3622'; +$VERSION = '0.37_04'; $VERSION = eval $VERSION; use vars qw(@ISA); diff --git a/cpan/Module-Build/lib/inc/latest.pm b/cpan/Module-Build/lib/inc/latest.pm index 16c21d3331..bca9b503d4 100644 --- a/cpan/Module-Build/lib/inc/latest.pm +++ b/cpan/Module-Build/lib/inc/latest.pm @@ -1,7 +1,7 @@ package inc::latest; use strict; use vars qw($VERSION); -$VERSION = '0.3622'; +$VERSION = '0.37_04'; $VERSION = eval $VERSION; use Carp; diff --git a/cpan/Module-Build/lib/inc/latest/private.pm b/cpan/Module-Build/lib/inc/latest/private.pm index 44c8833666..08752b6bac 100644 --- a/cpan/Module-Build/lib/inc/latest/private.pm +++ b/cpan/Module-Build/lib/inc/latest/private.pm @@ -1,7 +1,7 @@ package inc::latest::private; use strict; use vars qw($VERSION); -$VERSION = '0.3622'; +$VERSION = '0.37_04'; $VERSION = eval $VERSION; use File::Spec; diff --git a/cpan/Module-Build/t/actions/installdeps.t b/cpan/Module-Build/t/actions/installdeps.t index 95e221d0ad..5df98336b5 100644 --- a/cpan/Module-Build/t/actions/installdeps.t +++ b/cpan/Module-Build/t/actions/installdeps.t @@ -3,7 +3,7 @@ use lib 't/lib'; use MBTest; use DistGen; -plan tests => 7; +plan tests => 6; # Ensure any Module::Build modules are loaded from correct directory blib_load('Module::Build'); @@ -33,8 +33,6 @@ my $out = stdout_of( sub { $dist->run_build('installdeps') }); ok( length($out), "ran mocked Build installdeps"); -my $expected = quotemeta(Module::Build->find_command($^X)); -like( $out, qr/$expected/i, "relative cpan_client resolved relative to \$^X" ); like( $out, qr/File::Spec/, "saw File::Spec prereq" ); like( $out, qr/Getopt::Long/, "saw Getopt::Long prereq" ); diff --git a/cpan/Module-Build/t/lib/Module/Signature.pm b/cpan/Module-Build/t/lib/Module/Signature.pm new file mode 100644 index 0000000000..2d58f7d6dd --- /dev/null +++ b/cpan/Module-Build/t/lib/Module/Signature.pm @@ -0,0 +1,11 @@ +package Module::Signature; # mocked +use strict; +use warnings; +our $VERSION = 999; + +sub sign { + open my $fh, ">", "SIGNATURE"; + print {$fh} "SIGNATURE"; +} + +1; diff --git a/cpan/Module-Build/t/mymeta.t b/cpan/Module-Build/t/mymeta.t index 78c4f6d986..86a67f78cb 100644 --- a/cpan/Module-Build/t/mymeta.t +++ b/cpan/Module-Build/t/mymeta.t @@ -3,8 +3,9 @@ use strict; use lib 't/lib'; use MBTest; -use CPAN::Meta::YAML; -plan tests => 25; +use CPAN::Meta 2.110420; +use Parse::CPAN::Meta 1.4401; +plan tests => 39; blib_load('Module::Build'); @@ -35,12 +36,15 @@ $dist->chdir_in; { ok( ! -e "META.yml", "META.yml doesn't exist before Build.PL runs" ); ok( ! -e "MYMETA.yml", "MYMETA.yml doesn't exist before Build.PL runs" ); + ok( ! -e "META.json", "META.json doesn't exist before Build.PL runs" ); + ok( ! -e "MYMETA.json", "MYMETA.json doesn't exist before Build.PL runs" ); my $output; $output = stdout_of sub { $dist->run_build_pl }; - like($output, qr/Creating new 'MYMETA.yml' with configuration results/, + like($output, qr/Created MYMETA\.yml and MYMETA\.json/, "Ran Build.PL and saw MYMETA.yml creation message" ); ok( -e "MYMETA.yml", "MYMETA.yml exists" ); + ok( -e "MYMETA.json", "MYMETA.json exists" ); } ######################### @@ -48,58 +52,84 @@ $dist->chdir_in; # Test interactions between META/MYMETA { my $output = stdout_stderr_of sub { $dist->run_build('distmeta') }; - like($output, qr/Creating META.yml/, + like($output, qr/Created META\.yml and META\.json/, "Ran Build distmeta to create META.yml"); # regenerate MYMETA to pick up from META instead of creating from scratch $output = stdout_of sub { $dist->run_build_pl }; - like($output, qr/Creating new 'MYMETA.yml' with configuration results/, + like($output, qr/Created MYMETA\.yml and MYMETA\.json/, "Re-ran Build.PL and regenerated MYMETA.yml based on META.yml" ); - my $meta = CPAN::Meta::YAML->read('META.yml')->[0]; - my $mymeta = CPAN::Meta::YAML->read('MYMETA.yml')->[0]; - is( delete $mymeta->{dynamic_config}, 0, - "MYMETA 'dynamic_config' is 0" - ); - is_deeply( $mymeta, $meta, "Other generated MYMETA matches generated META" ); + for my $suffix ( qw/.yml .json/ ) { + my $meta = Parse::CPAN::Meta->load_file("META$suffix"); + my $mymeta = Parse::CPAN::Meta->load_file("MYMETA$suffix"); + is( delete $meta->{dynamic_config}, 1, + "META$suffix 'dynamic_config' is 1" + ); + is( delete $mymeta->{dynamic_config}, 0, + "MYMETA$suffix 'dynamic_config' is 0" + ); + is_deeply( $mymeta, $meta, "Other generated MYMETA$suffix matches generated META$suffix" ) + or do { + require Data::Dumper; + diag "MYMETA:\n" . Data::Dumper::Dumper($mymeta) + . "META:\n" . Data::Dumper::Dumper($meta); + }; + } + $output = stdout_stderr_of sub { $dist->run_build('realclean') }; like( $output, qr/Cleaning up/, "Ran realclean"); ok( ! -e 'Build', "Build file removed" ); - ok( ! -e 'MYMETA.yml', "MYMETA file removed" ); + ok( ! -e 'MYMETA.yml', "MYMETA.yml file removed" ); + ok( ! -e 'MYMETA.json', "MYMETA.json file removed" ); # test that dynamic prereq is picked up + my $meta = Parse::CPAN::Meta->load_file("META.yml"); + my $meta2 = Parse::CPAN::Meta->load_file("META.json"); local $ENV{BUMP_PREREQ} = 1; $output = stdout_of sub { $dist->run_build_pl }; - like($output, qr/Creating new 'MYMETA.yml' with configuration results/, + like($output, qr/Created MYMETA\.yml and MYMETA\.json/, "Ran Build.PL with dynamic config" ); ok( -e "MYMETA.yml", "MYMETA.yml exists" ); - $mymeta = CPAN::Meta::YAML->read('MYMETA.yml')->[0]; + ok( -e "MYMETA.json", "MYMETA.json exists" ); + my $mymeta = Parse::CPAN::Meta->load_file('MYMETA.yml'); + my $mymeta2 = Parse::CPAN::Meta->load_file('MYMETA.json'); isnt( $meta->{requires}{'File::Spec'}, $mymeta->{requires}{'File::Spec'}, - "MYMETA requires differs from META" + "MYMETA.yml requires differs from META.yml" + ); + isnt( $meta2->{prereqs}{runtime}{requires}{'File::Spec'}, + $mymeta2->{prereqs}{runtime}{requires}{'File::Spec'}, + "MYMETA.json requires differs from META.json" ); $output = stdout_stderr_of sub { $dist->run_build('realclean') }; like( $output, qr/Cleaning up/, "Ran realclean"); ok( ! -e 'Build', "Build file removed" ); ok( ! -e 'MYMETA.yml', "MYMETA file removed" ); + ok( ! -e 'MYMETA.json', "MYMETA file removed" ); # manually change META and check that changes are preserved $meta->{author} = ['John Gault']; + $meta2->{author} = ['John Gault']; ok( CPAN::Meta::YAML->new($meta)->write('META.yml'), "Wrote manually modified META.yml" ); + ok( CPAN::Meta->new( $meta2 )->save('META.json'), + "Wrote manually modified META.json" ); $output = stdout_of sub { $dist->run_build_pl }; - like($output, qr/Creating new 'MYMETA.yml' with configuration results/, + like($output, qr/Created MYMETA\.yml and MYMETA\.json/, "Ran Build.PL" ); - my $mymeta2 = CPAN::Meta::YAML->read('MYMETA.yml')->[0]; + $mymeta = Parse::CPAN::Meta->load_file('MYMETA.yml'); + $mymeta2 = Parse::CPAN::Meta->load_file('MYMETA.json'); + is_deeply( $mymeta->{author}, [ 'John Gault' ], + "MYMETA.yml preserved META.yml modifications" + ); is_deeply( $mymeta2->{author}, [ 'John Gault' ], - "MYMETA preserved META modifications" + "MYMETA.json preserved META.json modifications" ); - - } ######################### @@ -118,11 +148,12 @@ $dist->chdir_in; { my $output = stdout_of sub { $dist->run_build_pl }; - like($output, qr/Creating new 'MYMETA.yml' with configuration results/, + like($output, qr/Created MYMETA\.yml and MYMETA\.json/, "Ran Build.PL and saw MYMETA.yml creation message" ); $output = stdout_stderr_of sub { $dist->run_build('distclean') }; ok( ! -f 'MYMETA.yml', "No MYMETA.yml after distclean" ); + ok( ! -f 'MYMETA.json', "No MYMETA.json after distclean" ); ok( ! -f 'MANIFEST.SKIP', "No MANIFEST.SKIP after distclean" ); } diff --git a/cpan/Module-Build/t/script_dist.t b/cpan/Module-Build/t/script_dist.t index 26720b2739..fa02b49d33 100644 --- a/cpan/Module-Build/t/script_dist.t +++ b/cpan/Module-Build/t/script_dist.t @@ -40,7 +40,7 @@ my %details = ( dist_version => '0.01', ); my %meta_provides = ( - 'bin-foo' => { + 'foo' => { file => 'bin/foo', version => '0.01', } |