Hello community, here is the log from the commit of package perl-Module-Build for openSUSE:Factory checked in at 2013-12-10 17:44:37 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Module-Build (Old) and /work/SRC/openSUSE:Factory/.perl-Module-Build.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Module-Build" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Module-Build/perl-Module-Build.changes 2013-10-14 13:05:23.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Module-Build.new/perl-Module-Build.changes 2013-12-10 17:44:38.000000000 +0100 @@ -1,0 +2,15 @@ +Tue Dec 10 06:36:39 UTC 2013 - co...@suse.com + +- updated to 0.4203 + [BUG FIXES] + - Map recommends back to runtime recommends [Leon Timmermans] + - Map restrictive license to restricted in meta 2.0 [Leon Timmermans] + - Don't merge prereqs from meta to mymeta [Leon Timmermans] + - Prefer META.json over META.yml [Leon Timmermans] + - Do not set provides in metadata if no_index is set [Leon Timmermans] + - Lowercase license in fallback logic [Leon Timmermans] + + [ENHANCEMENTS] + - Converted to using Meta 2.0 + +------------------------------------------------------------------- Old: ---- Module-Build-0.4007.tar.gz New: ---- Module-Build-0.4203.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Module-Build.spec ++++++ --- /var/tmp/diff_new_pack.7XGcbZ/_old 2013-12-10 17:44:39.000000000 +0100 +++ /var/tmp/diff_new_pack.7XGcbZ/_new 2013-12-10 17:44:39.000000000 +0100 @@ -17,7 +17,7 @@ Name: perl-Module-Build -Version: 0.4007 +Version: 0.4203 Release: 0 %define cpan_name Module-Build Summary: Build and install Perl modules ++++++ Module-Build-0.4007.tar.gz -> Module-Build-0.4203.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/Changes new/Module-Build-0.4203/Changes --- old/Module-Build-0.4007/Changes 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/Changes 2013-11-27 19:16:41.000000000 +0100 @@ -1,5 +1,60 @@ Revision history for Perl extension Module::Build. +0.4203 - Wed Nov 27 19:09:05 CET 2013 + + [BUG FIXES] + + - Map recommends back to runtime recommends [Leon Timmermans] + + - Map restrictive license to restricted in meta 2.0 [Leon Timmermans] + +0.4202 - Tue Nov 19 12:48:19 CET 2013 + + [BUG FIXES] + + - Don't merge prereqs from meta to mymeta [Leon Timmermans] + +0.4201 - Mon Nov 18 23:23:25 CET 2013 + + [BUG FIXES] + + - Prefer META.json over META.yml [Leon Timmermans] + +0.4200 - Tue Nov 12 12:39:25 CET 2013 + + - Released 0.40_11 as 0.4200 + +0.40_11 - Wed Nov 6 12:46:59 CET 2013 + + [BUG FIXES] + + - Do not set provides in metadata if no_index is set [Leon Timmermans] + +0.40_10 - Tue Nov 5 12:11:37 CET 2013 + + [BUG FIXES] + + - Lowercase license in fallback logic [Leon Timmermans] + +0.40_09 - Tue Nov 5 00:13:11 CET 2013 + + [ENHANCEMENTS] + + - Converted to using Meta 2.0 + +0.4008 - Mon Nov 4 23:10:54 CET 2013 + + [BUG FIXES] + + - Fix test failing on ancient perls <= 5.8.1 [Peter Rabbitson] + + - Do not set default switches in Test::Harness; not even -w [Leon Timmermans] + + [DOCUMENTATION] + + - Fix a couple more broken links to CPAN::META::Spec that should + have been CPAN::Meta::Spec. [Reported by Mike Doherty] + 0.4007 - Fri Jul 19 13:44:39 CEST 2013 [BUG FIXES] @@ -12,6 +67,44 @@ 0.4006 - Thu Jul 18 14:19:49 CEST 2013 + - Announcement: The Perl5-Porters have decided to remove + Module::Build from the perl core distribution. It will still be + available on CPAN, and development is planned to continue + regardless. + + For more information, see: + + * http://www.nntp.perl.org/group/perl.perl5.porters/2013/05/msg202041.html + * http://blogs.perl.org/users/joel_berger/2013/05/on-the-removal-of-some-core-modules.html + * http://www.dagolden.com/index.php/2140/paying-respect-to-modulebuild/ + * http://perlhacks.com/2013/06/removing-modules-from-core/ + + [BUG FIXES] + + - In the 'installdeps' action, w don't need to check for an + executable bit on the CPAN client, just try executing it. + Otherwise we needlessly fail on e.g. VMS. + + - Actually handle utf8 correctly in utf8-man tests. [Leon Timmermans] + + - Don't clobber standard array/hash attributes in subclasses that + have their own array/hash attributes. [Graham Ollis] + + - We now allow underscores in package names, when extracting the + name & abstract from POD. [Ricardo Signes, Shlomi Fish] + + - When building HTML docs, fix a problem with setting the --htmlroot + argument. [Ken Williams] + + - Lower Test::More dependency in the test metadata, so distgen + output won't mess up console with older Test::More installed. + [Tatsuhiko Miyagawa] + + - Revised detildification on VMS [Craig Berry] + + - Fix run_test_harness for case when $Switches is an empty string + [Victor Efimov, Ken Williams] + [ENHANCEMENTS] - Significantly sped up some tests by not forcing HTML docs to be @@ -31,14 +124,26 @@ can hugely speed things up. The main effect is speeding up the M::B tests themselves. [Ken Williams] - [BUG FIXES] + - Added continuous integration support for the Module::Build code + itself, through the Travis-CI project + (https://travis-ci.org/). [Tatsuhiko Miyagawa, Olivier Mengué] - - Fix hash argument parsing in subclasses [Graham Ollis] + [DOCUMENTATION] - - Revised detildification on VMS [Craig Berry] + - Removed suggestion in the INSTALL document to use the Makefile.PL + for installation. Making the Makefile.PL lower-profile in + general. [Ken Williams] + + - Fix link from UpperCase CPAN::META::Spec to CPAN::Meta::Spec in + API.pod. [Sven Dowideit] + + [OTHER] + + - Removed unused platform specific modules that never contained + anything. [Leon Timmermans] + + - Lots of typo fixes in comments & documentation. [David Steinbrunner] - - Fix run_test_harness for case when $Switches is an empty string - [Victor Efimov, Ken Williams] 0.4005 - Thu Apr 25 15:10:14 CEST 2013 @@ -127,7 +232,7 @@ [OTHER] - - List Perl-Toolchain-Gang repo as official repo + - List Perl-Toolchain-Gang repo as official repo 0.39_01 - Thu Jul 21 16:48:48 EDT 2011 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/MANIFEST new/Module-Build-0.4203/MANIFEST --- old/Module-Build-0.4007/MANIFEST 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/MANIFEST 2013-11-27 19:16:41.000000000 +0100 @@ -91,6 +91,7 @@ t/script_dist.t t/signature.t t/test_file_exts.t +t/test_reqs.t t/test_type.t t/test_types.t t/tilde.t diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/META.json new/Module-Build-0.4203/META.json --- old/Module-Build-0.4007/META.json 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/META.json 2013-11-27 19:16:41.000000000 +0100 @@ -5,7 +5,7 @@ "Module-Build mailing list at <module-bu...@perl.org>." ], "dynamic_config" : 1, - "generated_by" : "Module::Build version 0.4007, CPAN::Meta::Converter version 2.120921", + "generated_by" : "Module::Build version 0.4203", "license" : [ "perl_5" ], @@ -59,83 +59,83 @@ "provides" : { "Module::Build" : { "file" : "lib/Module/Build.pm", - "version" : "0.4007" + "version" : "0.4203" }, "Module::Build::Base" : { "file" : "lib/Module/Build/Base.pm", - "version" : "0.4007" + "version" : "0.4203" }, "Module::Build::Compat" : { "file" : "lib/Module/Build/Compat.pm", - "version" : "0.4007" + "version" : "0.4203" }, "Module::Build::Config" : { "file" : "lib/Module/Build/Config.pm", - "version" : "0.4007" + "version" : "0.4203" }, "Module::Build::Cookbook" : { "file" : "lib/Module/Build/Cookbook.pm", - "version" : "0.4007" + "version" : "0.4203" }, "Module::Build::Dumper" : { "file" : "lib/Module/Build/Dumper.pm", - "version" : "0.4007" + "version" : "0.4203" }, "Module::Build::ModuleInfo" : { "file" : "lib/Module/Build/ModuleInfo.pm", - "version" : "0.4007" + "version" : "0.4203" }, "Module::Build::Notes" : { "file" : "lib/Module/Build/Notes.pm", - "version" : "0.4007" + "version" : "0.4203" }, "Module::Build::PPMMaker" : { "file" : "lib/Module/Build/PPMMaker.pm", - "version" : "0.4007" + "version" : "0.4203" }, "Module::Build::Platform::Default" : { "file" : "lib/Module/Build/Platform/Default.pm", - "version" : "0.4007" + "version" : "0.4203" }, "Module::Build::Platform::MacOS" : { "file" : "lib/Module/Build/Platform/MacOS.pm", - "version" : "0.4007" + "version" : "0.4203" }, "Module::Build::Platform::Unix" : { "file" : "lib/Module/Build/Platform/Unix.pm", - "version" : "0.4007" + "version" : "0.4203" }, "Module::Build::Platform::VMS" : { "file" : "lib/Module/Build/Platform/VMS.pm", - "version" : "0.4007" + "version" : "0.4203" }, "Module::Build::Platform::VOS" : { "file" : "lib/Module/Build/Platform/VOS.pm", - "version" : "0.4007" + "version" : "0.4203" }, "Module::Build::Platform::Windows" : { "file" : "lib/Module/Build/Platform/Windows.pm", - "version" : "0.4007" + "version" : "0.4203" }, "Module::Build::Platform::aix" : { "file" : "lib/Module/Build/Platform/aix.pm", - "version" : "0.4007" + "version" : "0.4203" }, "Module::Build::Platform::cygwin" : { "file" : "lib/Module/Build/Platform/cygwin.pm", - "version" : "0.4007" + "version" : "0.4203" }, "Module::Build::Platform::darwin" : { "file" : "lib/Module/Build/Platform/darwin.pm", - "version" : "0.4007" + "version" : "0.4203" }, "Module::Build::Platform::os2" : { "file" : "lib/Module/Build/Platform/os2.pm", - "version" : "0.4007" + "version" : "0.4203" }, "Module::Build::PodParser" : { "file" : "lib/Module/Build/PodParser.pm", - "version" : "0.4007" + "version" : "0.4203" }, "Module::Build::Version" : { "file" : "lib/Module/Build/Version.pm", @@ -147,11 +147,11 @@ }, "inc::latest" : { "file" : "lib/inc/latest.pm", - "version" : "0.4007" + "version" : "0.4203" }, "inc::latest::private" : { "file" : "lib/inc/latest/private.pm", - "version" : "0.4007" + "version" : "0.4203" } }, "release_status" : "stable", @@ -162,7 +162,7 @@ "repository" : { "url" : "https://github.com/Perl-Toolchain-Gang/Module-Build" }, - "x_MailingList" : "mailto:module-bu...@perl.org" + "x_mailingList" : "mailto:module-bu...@perl.org" }, - "version" : "0.4007" + "version" : "0.4203" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/META.yml new/Module-Build-0.4203/META.yml --- old/Module-Build-0.4007/META.yml 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/META.yml 2013-11-27 19:16:41.000000000 +0100 @@ -10,7 +10,7 @@ Test::Harness: 3.16 Test::More: 0.49 dynamic_config: 1 -generated_by: 'Module::Build version 0.4007, CPAN::Meta::Converter version 2.120921' +generated_by: 'Module::Build version 0.4203, CPAN::Meta::Converter version 2.132830' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -19,64 +19,64 @@ provides: Module::Build: file: lib/Module/Build.pm - version: 0.4007 + version: 0.4203 Module::Build::Base: file: lib/Module/Build/Base.pm - version: 0.4007 + version: 0.4203 Module::Build::Compat: file: lib/Module/Build/Compat.pm - version: 0.4007 + version: 0.4203 Module::Build::Config: file: lib/Module/Build/Config.pm - version: 0.4007 + version: 0.4203 Module::Build::Cookbook: file: lib/Module/Build/Cookbook.pm - version: 0.4007 + version: 0.4203 Module::Build::Dumper: file: lib/Module/Build/Dumper.pm - version: 0.4007 + version: 0.4203 Module::Build::ModuleInfo: file: lib/Module/Build/ModuleInfo.pm - version: 0.4007 + version: 0.4203 Module::Build::Notes: file: lib/Module/Build/Notes.pm - version: 0.4007 + version: 0.4203 Module::Build::PPMMaker: file: lib/Module/Build/PPMMaker.pm - version: 0.4007 + version: 0.4203 Module::Build::Platform::Default: file: lib/Module/Build/Platform/Default.pm - version: 0.4007 + version: 0.4203 Module::Build::Platform::MacOS: file: lib/Module/Build/Platform/MacOS.pm - version: 0.4007 + version: 0.4203 Module::Build::Platform::Unix: file: lib/Module/Build/Platform/Unix.pm - version: 0.4007 + version: 0.4203 Module::Build::Platform::VMS: file: lib/Module/Build/Platform/VMS.pm - version: 0.4007 + version: 0.4203 Module::Build::Platform::VOS: file: lib/Module/Build/Platform/VOS.pm - version: 0.4007 + version: 0.4203 Module::Build::Platform::Windows: file: lib/Module/Build/Platform/Windows.pm - version: 0.4007 + version: 0.4203 Module::Build::Platform::aix: file: lib/Module/Build/Platform/aix.pm - version: 0.4007 + version: 0.4203 Module::Build::Platform::cygwin: file: lib/Module/Build/Platform/cygwin.pm - version: 0.4007 + version: 0.4203 Module::Build::Platform::darwin: file: lib/Module/Build/Platform/darwin.pm - version: 0.4007 + version: 0.4203 Module::Build::Platform::os2: file: lib/Module/Build/Platform/os2.pm - version: 0.4007 + version: 0.4203 Module::Build::PodParser: file: lib/Module/Build/PodParser.pm - version: 0.4007 + version: 0.4203 Module::Build::Version: file: lib/Module/Build/Version.pm version: 0.87 @@ -85,10 +85,10 @@ version: 1.41 inc::latest: file: lib/inc/latest.pm - version: 0.4007 + version: 0.4203 inc::latest::private: file: lib/inc/latest/private.pm - version: 0.4007 + version: 0.4203 recommends: ExtUtils::Install: 0.3 ExtUtils::Manifest: 1.54 @@ -118,6 +118,6 @@ version: 0.87 resources: license: http://dev.perl.org/licenses/ + mailingList: mailto:module-bu...@perl.org repository: https://github.com/Perl-Toolchain-Gang/Module-Build - x_MailingList: mailto:module-bu...@perl.org -version: 0.4007 +version: 0.4203 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/lib/Module/Build/API.pod new/Module-Build-0.4203/lib/Module/Build/API.pod --- old/Module-Build-0.4007/lib/Module/Build/API.pod 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/lib/Module/Build/API.pod 2013-11-27 19:16:41.000000000 +0100 @@ -2119,6 +2119,6 @@ L<Module::Build::Cookbook>(3), L<ExtUtils::MakeMaker>(3) F<META.yml> Specification: -L<CPAN::META::Spec> +L<CPAN::Meta::Spec> =cut diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/lib/Module/Build/Authoring.pod new/Module-Build-0.4203/lib/Module/Build/Authoring.pod --- old/Module-Build-0.4007/lib/Module/Build/Authoring.pod 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/lib/Module/Build/Authoring.pod 2013-11-27 19:16:41.000000000 +0100 @@ -317,7 +317,7 @@ L<Module::Build::Cookbook>(3), L<ExtUtils::MakeMaker>(3), L<YAML>(3) F<META.yml> Specification: -L<CPAN::META::Spec> +L<CPAN::Meta::Spec> L<http://www.dsmit.com/cons/> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/lib/Module/Build/Base.pm new/Module-Build-0.4203/lib/Module/Build/Base.pm --- old/Module-Build-0.4007/lib/Module/Build/Base.pm 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/lib/Module/Build/Base.pm 2013-11-27 19:16:41.000000000 +0100 @@ -6,7 +6,7 @@ use vars qw($VERSION); use warnings; -$VERSION = '0.4007'; +$VERSION = '0.4203'; $VERSION = eval $VERSION; BEGIN { require 5.006001 } @@ -1890,8 +1890,8 @@ my ($self) = @_; my ($meta_obj, $mymeta); - my @metafiles = ( $self->metafile, $self->metafile2 ); - my @mymetafiles = ( $self->mymetafile, $self->mymetafile2 ); + my @metafiles = ( $self->metafile2, $self->metafile, ); + my @mymetafiles = ( $self->mymetafile2, $self->mymetafile, ); # cleanup old MYMETA for my $f ( @mymetafiles ) { @@ -1904,53 +1904,29 @@ if ( $self->try_require("CPAN::Meta", "2.110420") ) { for my $file ( @metafiles ) { next unless -f $file; - $meta_obj = eval { CPAN::Meta->load_file($file) }; + $meta_obj = eval { CPAN::Meta->load_file($file, { lazy_validation => 0 }) }; last if $meta_obj; } } # 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; - # XXX refactor this mapping somewhere - $mymeta->{prereqs}{runtime}{requires} = $prereqs->{requires}; - $mymeta->{prereqs}{build}{requires} = $prereqs->{build_requires}; - $mymeta->{prereqs}{test}{requires} = $prereqs->{test_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"; - eval { $meta_obj = CPAN::Meta->new( $mymeta, { lazy_validation => 1 } ) } + my $mymeta_obj; + if ($meta_obj) { + # if we have metadata, just update it + my %updated = ( + %{ $meta_obj->as_struct({ version => 2.0 }) }, + prereqs => $self->_normalize_prereqs, + dynamic_config => 0, + generated_by => "Module::Build version $Module::Build::VERSION", + ); + $mymeta_obj = CPAN::Meta->new( \%updated, { lazy_validation => 0 } ); } - # or generate from scratch, ignoring errors if META doesn't exist else { - $meta_obj = $self->_get_meta_object( - quiet => 0, dynamic => 0, fatal => 0, auto => 0 - ); + $mymeta_obj = $self->_get_meta_object(quiet => 0, dynamic => 0, fatal => 1, auto => 0); } - my @created = $self->_write_meta_files( $meta_obj, 'MYMETA' ); + my @created = $self->_write_meta_files( $mymeta_obj, 'MYMETA' ); $self->log_warn("Could not create MYMETA files\n") unless @created; @@ -2760,28 +2736,9 @@ sub run_test_harness { my ($self, $tests) = @_; require Test::Harness; - my $p = $self->{properties}; - # Work around a Test::Harness bug that loses the particular perl - # we're running under. $self->perl is trustworthy, but $^X isn't. - local $^X = $self->perl; - - # Do everything in our power to work with all versions of Test::Harness - local ($Test::Harness::verbose, - $Test::Harness::Verbose, - $ENV{TEST_VERBOSE}, - $ENV{HARNESS_VERBOSE}) = ($p->{verbose} || 0) x 4; - - my @harness_switches = $self->harness_switches; - return Test::Harness::runtests(@$tests) unless @harness_switches; # Nothing to modify - - local $Test::Harness::switches = join ' ', grep defined, $Test::Harness::switches, @harness_switches; - local $Test::Harness::Switches = join ' ', grep defined, $Test::Harness::Switches, @harness_switches; - local $ENV{HARNESS_PERL_SWITCHES} = join ' ', grep defined, $ENV{HARNESS_PERL_SWITCHES}, @harness_switches; - - $Test::Harness::switches = undef unless length $Test::Harness::switches; - $Test::Harness::Switches = undef unless defined $Test::Harness::Switches and length $Test::Harness::Switches; - delete $ENV{HARNESS_PERL_SWITCHES} unless length $ENV{HARNESS_PERL_SWITCHES}; + local $Test::Harness::verbose = $self->verbose || 0; + local $Test::Harness::switches = join ' ', $self->harness_switches; Test::Harness::runtests(@$tests); } @@ -4442,9 +4399,9 @@ gpl3 => 'GPL_3', mit => 'MIT', mozilla => 'Mozilla_1_1', + restrictive => 'Restricted', open_source => undef, unrestricted => undef, - restrictive => undef, unknown => undef, ); @@ -4465,9 +4422,9 @@ gpl3 => 'http://opensource.org/licenses/gpl-3.0.html', mit => 'http://opensource.org/licenses/mit-license.php', mozilla => 'http://opensource.org/licenses/mozilla1.1.php', + restrictive => undef, open_source => undef, unrestricted => undef, - restrictive => undef, unknown => undef, ); sub valid_licenses { @@ -4586,7 +4543,7 @@ auto => $args{auto}, ); $data->{dynamic_config} = $args{dynamic} if defined $args{dynamic}; - $meta = CPAN::Meta->create( $data ); + $meta = CPAN::Meta->create($data); }; if ($@ && ! $args{quiet}) { $self->log_warn( @@ -4642,6 +4599,16 @@ return $version; } +my %prereq_map = ( + requires => [ qw/runtime requires/], + configure_requires => [qw/configure requires/], + build_requires => [ qw/build requires/ ], + test_requires => [ qw/test requires/ ], + test_recommends => [ qw/test recommends/ ], + recommends => [ qw/runtime recommends/ ], + conflicts => [ qw/build conflicts/ ], +); + sub _normalize_prereqs { my ($self) = @_; my $p = $self->{properties}; @@ -4649,46 +4616,97 @@ # copy prereq data structures so we can modify them before writing to META my %prereq_types; for my $type ( 'configure_requires', @{$self->prereq_action_types} ) { - if (exists $p->{$type}) { + if (exists $p->{$type} and keys %{ $p->{$type} }) { + my ($phase, $relation) = @{ $prereq_map{$type} }; for my $mod ( keys %{ $p->{$type} } ) { - $prereq_types{$type}{$mod} = - $self->normalize_version($p->{$type}{$mod}); + $prereq_types{$phase}{$relation}{$mod} = $self->normalize_version($p->{$type}{$mod}); } } } return \%prereq_types; } -# wrapper around old prepare_metadata API; -sub get_metadata { - my ($self, %args) = @_; - my $metadata = {}; - $self->prepare_metadata( $metadata, undef, \%args ); - return $metadata; +sub _get_license { + my $self = shift; + + my $license = $self->license; + my ($meta_license, $meta_license_url); + + my $valid_licenses = $self->valid_licenses(); + if ( my $sl = $self->_software_license_object ) { + $meta_license = $sl->meta2_name; + $meta_license_url = $sl->url; + } + elsif ( exists $valid_licenses->{$license} ) { + $meta_license = $valid_licenses->{$license} ? lc $valid_licenses->{$license} : $license; + $meta_license_url = $self->_license_url( $license ); + } + else { + $self->log_warn( "Can not determine license type for '" . $self->license + . "'\nSetting META license field to 'unknown'.\n"); + $meta_license = 'unknown'; + } + return ($meta_license, $meta_license_url); } -# To preserve compatibility with old API, $node *must* be a hashref -# passed in to prepare_metadata. $keys is an arrayref holding a -# list of keys -- it's use is optional and generally no longer needed -# but kept for back compatibility. $args is an optional parameter to -# support the new 'fatal' toggle +my %keep = map { $_ => 1 } qw/keywords dynamic_config provides no_index name version abstract/; +my %ignore = map { $_ => 1 } qw/distribution_type/; +my %reject = map { $_ => 1 } qw/private author license requires recommends build_requires configure_requires conflicts/; + +sub _upconvert_resources { + my ($input) = @_; + my %output; + for my $key (keys %{$input}) { + my $out_key = $key =~ /^\p{Lu}/ ? "x_\l$key" : $key; + if ($key eq 'repository') { + my $name = $input->{$key} =~ m{ \A http s? :// .* (<! \.git ) \z }xms ? 'web' : 'url'; + $output{$out_key} = { $name => $input->{$key} }; + } + elsif ($key eq 'bugtracker') { + $output{$out_key} = { web => $input->{$key} } + } + else { + $output{$out_key} = $input->{$key}; + } + } + return \%output +} +my %custom = ( + resources => \&_upconvert_resources, +); -sub prepare_metadata { - my ($self, $node, $keys, $args) = @_; - unless ( ref $node eq 'HASH' ) { - croak "prepare_metadata() requires a hashref argument to hold output\n"; +sub _upconvert_metapiece { + my ($input, $type) = @_; + return $input if exists $input->{'meta-spec'} && $input->{'meta-spec'}{version} == 2; + + my %ret; + for my $key (keys %{$input}) { + if ($keep{$key}) { + $ret{$key} = $input->{$key}; + } + elsif ($ignore{$key}) { + next; + } + elsif ($reject{$key}) { + croak "Can't $type $key, please use another mechanism"; + } + elsif (my $converter = $custom{$key}) { + $ret{$key} = $converter->($input->{$key}); + } + else { + warn "Unknown key $key\n" unless $key =~ / \A x_ /xi; + } } - my $fatal = $args->{fatal} || 0; - my $p = $self->{properties}; + return \%ret; +} - $self->auto_config_requires if $args->{auto}; +sub get_metadata { + my ($self, %args) = @_; - # A little helper sub - my $add_node = sub { - my ($name, $val) = @_; - $node->{$name} = $val; - push @$keys, $name if $keys; - }; + my $fatal = $args{fatal} || 0; + my $p = $self->{properties}; + + $self->auto_config_requires if $args{auto}; # validate required fields foreach my $f (qw(dist_name dist_version dist_author dist_abstract license)) { @@ -4704,80 +4722,61 @@ } } + my %metadata = ( + name => $self->dist_name, + version => $self->normalize_version($self->dist_version), + author => $self->dist_author, + abstract => $self->dist_abstract, + generated_by => "Module::Build version $Module::Build::VERSION", + 'meta-spec' => { + version => '2', + url => 'http://search.cpan.org/perldoc?CPAN::Meta::Spec', + }, + dynamic_config => exists $p->{dynamic_config} ? $p->{dynamic_config} : 1, + release_status => $self->release_status, + ); - # add dist_* fields - foreach my $f (qw(dist_name dist_version dist_author dist_abstract)) { - (my $name = $f) =~ s/^dist_//; - $add_node->($name, $self->$f()); - } - - # normalize version - $node->{version} = $self->normalize_version($node->{version}); - - # validate license information - my $license = $self->license; - my ($meta_license, $meta_license_url); - - # XXX this is still meta spec version 1 stuff - - # if Software::License::* exists, then we can use it to get normalized name - # for META files - - if ( my $sl = $self->_software_license_object ) { - $meta_license = $sl->meta_name; - $meta_license_url = $sl->url; - } - elsif ( exists $self->valid_licenses()->{$license} ) { - $meta_license = $license; - $meta_license_url = $self->_license_url( $license ); - } - else { - # if we didn't find a license from a Software::License class, - # then treat it as unknown - $self->log_warn( "Can not determine license type for '" . $self->license - . "'\nSetting META license field to 'unknown'.\n"); - $meta_license = 'unknown'; - } - - $node->{license} = $meta_license; - $node->{resources}{license} = $meta_license_url if defined $meta_license_url; + my ($meta_license, $meta_license_url) = $self->_get_license; + $metadata{license} = [ $meta_license ]; + $metadata{resources}{license} = [ $meta_license_url ] if defined $meta_license_url; - # add prerequisite data - my $prereqs = $self->_normalize_prereqs; - for my $t ( keys %$prereqs ) { - $add_node->($t, $prereqs->{$t}); - } + $metadata{prereqs} = $self->_normalize_prereqs; - if (exists $p->{dynamic_config}) { - $add_node->('dynamic_config', $p->{dynamic_config}); - } - my $pkgs = eval { $self->find_dist_packages }; - if ($@) { + if (exists $p->{no_index}) { + $metadata{no_index} = $p->{no_index}; + } elsif (my $pkgs = eval { $self->find_dist_packages }) { + $metadata{provides} = $pkgs if %$pkgs; + } else { $self->log_warn("$@\nWARNING: Possible missing or corrupt 'MANIFEST' file.\n" . "Nothing to enter for 'provides' field in metafile.\n"); - } else { - $node->{provides} = $pkgs if %$pkgs; } -; - if (exists $p->{no_index}) { - $add_node->('no_index', $p->{no_index}); + + my $meta_add = _upconvert_metapiece($self->meta_add, 'add'); + while (my($k, $v) = each %{$meta_add} ) { + $metadata{$k} = $v; } - $add_node->('generated_by', "Module::Build version $Module::Build::VERSION"); + my $meta_merge = _upconvert_metapiece($self->meta_merge, 'merge'); + while (my($k, $v) = each %{$meta_merge} ) { + $self->_hash_merge(\%metadata, $k, $v); + } - $add_node->('meta-spec', - {version => '1.4', - url => 'http://module-build.sourceforge.net/META-spec-v1.4.html', - }); + return \%metadata; +} - while (my($k, $v) = each %{$self->meta_add}) { - $add_node->($k, $v); - } +# To preserve compatibility with old API, $node *must* be a hashref +# passed in to prepare_metadata. $keys is an arrayref holding a +# list of keys -- it's use is optional and generally no longer needed +# but kept for back compatibility. $args is an optional parameter to +# support the new 'fatal' toggle - while (my($k, $v) = each %{$self->meta_merge}) { - $self->_hash_merge($node, $k, $v); +sub prepare_metadata { + my ($self, $node, $keys, $args) = @_; + unless ( ref $node eq 'HASH' ) { + croak "prepare_metadata() requires a hashref argument to hold output\n"; } - + croak 'Keys argument to prepare_metadata is no longer supported' if $keys; + %{$node} = %{ $self->get_meta(%{$args}) }; return $node; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/lib/Module/Build/Compat.pm new/Module-Build-0.4203/lib/Module/Build/Compat.pm --- old/Module-Build-0.4007/lib/Module/Build/Compat.pm 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/lib/Module/Build/Compat.pm 2013-11-27 19:16:41.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use vars qw($VERSION); -$VERSION = '0.4007'; +$VERSION = '0.4203'; use File::Basename (); use File::Spec; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/lib/Module/Build/Config.pm new/Module-Build-0.4203/lib/Module/Build/Config.pm --- old/Module-Build-0.4007/lib/Module/Build/Config.pm 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/lib/Module/Build/Config.pm 2013-11-27 19:16:41.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use vars qw($VERSION); -$VERSION = '0.4007'; +$VERSION = '0.4203'; $VERSION = eval $VERSION; use Config; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/lib/Module/Build/Cookbook.pm new/Module-Build-0.4203/lib/Module/Build/Cookbook.pm --- old/Module-Build-0.4007/lib/Module/Build/Cookbook.pm 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/lib/Module/Build/Cookbook.pm 2013-11-27 19:16:41.000000000 +0100 @@ -1,7 +1,7 @@ package Module::Build::Cookbook; use strict; use vars qw($VERSION); -$VERSION = '0.4007'; +$VERSION = '0.4203'; =head1 NAME diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/lib/Module/Build/Dumper.pm new/Module-Build-0.4203/lib/Module/Build/Dumper.pm --- old/Module-Build-0.4007/lib/Module/Build/Dumper.pm 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/lib/Module/Build/Dumper.pm 2013-11-27 19:16:41.000000000 +0100 @@ -1,7 +1,7 @@ package Module::Build::Dumper; use strict; use vars qw($VERSION); -$VERSION = '0.4007'; +$VERSION = '0.4203'; # This is just a split-out of a wrapper function to do Data::Dumper # stuff "the right way". See: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/lib/Module/Build/ModuleInfo.pm new/Module-Build-0.4203/lib/Module/Build/ModuleInfo.pm --- old/Module-Build-0.4007/lib/Module/Build/ModuleInfo.pm 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/lib/Module/Build/ModuleInfo.pm 2013-11-27 19:16:41.000000000 +0100 @@ -4,7 +4,7 @@ use strict; use vars qw($VERSION); -$VERSION = '0.4007'; +$VERSION = '0.4203'; $VERSION = eval $VERSION; require Module::Metadata; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/lib/Module/Build/Notes.pm new/Module-Build-0.4203/lib/Module/Build/Notes.pm --- old/Module-Build-0.4007/lib/Module/Build/Notes.pm 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/lib/Module/Build/Notes.pm 2013-11-27 19:16:41.000000000 +0100 @@ -4,7 +4,7 @@ use strict; use vars qw($VERSION); -$VERSION = '0.4007'; +$VERSION = '0.4203'; $VERSION = eval $VERSION; use Data::Dumper; use Module::Build::Dumper; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/lib/Module/Build/PPMMaker.pm new/Module-Build-0.4203/lib/Module/Build/PPMMaker.pm --- old/Module-Build-0.4007/lib/Module/Build/PPMMaker.pm 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/lib/Module/Build/PPMMaker.pm 2013-11-27 19:16:41.000000000 +0100 @@ -4,7 +4,7 @@ use Config; use vars qw($VERSION); -$VERSION = '0.4007'; +$VERSION = '0.4203'; $VERSION = eval $VERSION; # This code is mostly borrowed from ExtUtils::MM_Unix 6.10_03, with a diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/lib/Module/Build/Platform/Default.pm new/Module-Build-0.4203/lib/Module/Build/Platform/Default.pm --- old/Module-Build-0.4007/lib/Module/Build/Platform/Default.pm 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/lib/Module/Build/Platform/Default.pm 2013-11-27 19:16:41.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use vars qw($VERSION); -$VERSION = '0.4007'; +$VERSION = '0.4203'; $VERSION = eval $VERSION; use Module::Build::Base; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/lib/Module/Build/Platform/MacOS.pm new/Module-Build-0.4203/lib/Module/Build/Platform/MacOS.pm --- old/Module-Build-0.4007/lib/Module/Build/Platform/MacOS.pm 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/lib/Module/Build/Platform/MacOS.pm 2013-11-27 19:16:41.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use vars qw($VERSION); -$VERSION = '0.4007'; +$VERSION = '0.4203'; $VERSION = eval $VERSION; use Module::Build::Base; use vars qw(@ISA); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/lib/Module/Build/Platform/Unix.pm new/Module-Build-0.4203/lib/Module/Build/Platform/Unix.pm --- old/Module-Build-0.4007/lib/Module/Build/Platform/Unix.pm 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/lib/Module/Build/Platform/Unix.pm 2013-11-27 19:16:41.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use vars qw($VERSION); -$VERSION = '0.4007'; +$VERSION = '0.4203'; $VERSION = eval $VERSION; use Module::Build::Base; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/lib/Module/Build/Platform/VMS.pm new/Module-Build-0.4203/lib/Module/Build/Platform/VMS.pm --- old/Module-Build-0.4007/lib/Module/Build/Platform/VMS.pm 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/lib/Module/Build/Platform/VMS.pm 2013-11-27 19:16:41.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use vars qw($VERSION); -$VERSION = '0.4007'; +$VERSION = '0.4203'; $VERSION = eval $VERSION; use Module::Build::Base; use Config; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/lib/Module/Build/Platform/VOS.pm new/Module-Build-0.4203/lib/Module/Build/Platform/VOS.pm --- old/Module-Build-0.4007/lib/Module/Build/Platform/VOS.pm 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/lib/Module/Build/Platform/VOS.pm 2013-11-27 19:16:41.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use vars qw($VERSION); -$VERSION = '0.4007'; +$VERSION = '0.4203'; $VERSION = eval $VERSION; use Module::Build::Base; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/lib/Module/Build/Platform/Windows.pm new/Module-Build-0.4203/lib/Module/Build/Platform/Windows.pm --- old/Module-Build-0.4007/lib/Module/Build/Platform/Windows.pm 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/lib/Module/Build/Platform/Windows.pm 2013-11-27 19:16:41.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use vars qw($VERSION); -$VERSION = '0.4007'; +$VERSION = '0.4203'; $VERSION = eval $VERSION; use Config; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/lib/Module/Build/Platform/aix.pm new/Module-Build-0.4203/lib/Module/Build/Platform/aix.pm --- old/Module-Build-0.4007/lib/Module/Build/Platform/aix.pm 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/lib/Module/Build/Platform/aix.pm 2013-11-27 19:16:41.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use vars qw($VERSION); -$VERSION = '0.4007'; +$VERSION = '0.4203'; $VERSION = eval $VERSION; use Module::Build::Platform::Unix; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/lib/Module/Build/Platform/cygwin.pm new/Module-Build-0.4203/lib/Module/Build/Platform/cygwin.pm --- old/Module-Build-0.4007/lib/Module/Build/Platform/cygwin.pm 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/lib/Module/Build/Platform/cygwin.pm 2013-11-27 19:16:41.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use vars qw($VERSION); -$VERSION = '0.4007'; +$VERSION = '0.4203'; $VERSION = eval $VERSION; use Module::Build::Platform::Unix; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/lib/Module/Build/Platform/darwin.pm new/Module-Build-0.4203/lib/Module/Build/Platform/darwin.pm --- old/Module-Build-0.4007/lib/Module/Build/Platform/darwin.pm 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/lib/Module/Build/Platform/darwin.pm 2013-11-27 19:16:41.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use vars qw($VERSION); -$VERSION = '0.4007'; +$VERSION = '0.4203'; $VERSION = eval $VERSION; use Module::Build::Platform::Unix; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/lib/Module/Build/Platform/os2.pm new/Module-Build-0.4203/lib/Module/Build/Platform/os2.pm --- old/Module-Build-0.4007/lib/Module/Build/Platform/os2.pm 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/lib/Module/Build/Platform/os2.pm 2013-11-27 19:16:41.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use vars qw($VERSION); -$VERSION = '0.4007'; +$VERSION = '0.4203'; $VERSION = eval $VERSION; use Module::Build::Platform::Unix; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/lib/Module/Build/PodParser.pm new/Module-Build-0.4203/lib/Module/Build/PodParser.pm --- old/Module-Build-0.4007/lib/Module/Build/PodParser.pm 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/lib/Module/Build/PodParser.pm 2013-11-27 19:16:41.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use vars qw($VERSION); -$VERSION = '0.4007'; +$VERSION = '0.4203'; $VERSION = eval $VERSION; use vars qw(@ISA); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/lib/Module/Build.pm new/Module-Build-0.4203/lib/Module/Build.pm --- old/Module-Build-0.4007/lib/Module/Build.pm 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/lib/Module/Build.pm 2013-11-27 19:16:41.000000000 +0100 @@ -18,7 +18,7 @@ use vars qw($VERSION @ISA); @ISA = qw(Module::Build::Base); -$VERSION = '0.4007'; +$VERSION = '0.4203'; $VERSION = eval $VERSION; # Inserts the given module into the @ISA hierarchy between diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/lib/inc/latest/private.pm new/Module-Build-0.4203/lib/inc/latest/private.pm --- old/Module-Build-0.4007/lib/inc/latest/private.pm 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/lib/inc/latest/private.pm 2013-11-27 19:16:41.000000000 +0100 @@ -4,7 +4,7 @@ use strict; use vars qw($VERSION); -$VERSION = '0.4007'; +$VERSION = '0.4203'; $VERSION = eval $VERSION; use File::Spec; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/lib/inc/latest.pm new/Module-Build-0.4203/lib/inc/latest.pm --- old/Module-Build-0.4007/lib/inc/latest.pm 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/lib/inc/latest.pm 2013-11-27 19:16:41.000000000 +0100 @@ -4,7 +4,7 @@ use strict; use vars qw($VERSION); -$VERSION = '0.4007'; +$VERSION = '0.4203'; $VERSION = eval $VERSION; use Carp; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/t/extend.t new/Module-Build-0.4203/t/extend.t --- old/Module-Build-0.4007/t/extend.t 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/t/extend.t 2013-11-27 19:16:41.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use lib 't/lib'; -use MBTest tests => 64; +use MBTest tests => 63; blib_load('Module::Build'); @@ -183,23 +183,29 @@ ok my $mb = Module::Build->new( module_name => $dist->name, license => 'perl', - meta_add => {foo => 'bar'}, + meta_add => {abstract => 'bar'}, conflicts => {'Foo::Barxx' => 0}, ); my $data = $mb->get_metadata; - is $data->{foo}, 'bar'; + is_deeply $data->{abstract}, 'bar'; - $mb->meta_merge(foo => 'baz'); + $mb->meta_merge(abstract => 'baz'); $data = $mb->get_metadata; - is $data->{foo}, 'baz'; + is_deeply $data->{abstract}, 'baz'; - $mb->meta_merge(conflicts => {'Foo::Fooxx' => 0}); + $mb->meta_merge( + 'meta-spec' => { version => 2 }, + prereqs => { + test => { + requirements => { + 'Foo::Fooxx' => 0, + } + } + } + ); $data = $mb->get_metadata; - is_deeply $data->{conflicts}, {'Foo::Barxx' => 0, 'Foo::Fooxx' => 0}; + is_deeply $data->{prereqs}{test}{requirements}, { 'Foo::Fooxx' => 0 }; - $mb->meta_add(conflicts => {'Foo::Bazxx' => 0}); - $data = $mb->get_metadata; - is_deeply $data->{conflicts}, {'Foo::Bazxx' => 0, 'Foo::Fooxx' => 0}; } { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/t/metadata.t new/Module-Build-0.4203/t/metadata.t --- old/Module-Build-0.4007/t/metadata.t 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/t/metadata.t 2013-11-27 19:16:41.000000000 +0100 @@ -81,9 +81,9 @@ is $node->{version}, $metadata{dist_version}; is $node->{abstract}, $metadata{dist_abstract}; is_deeply $node->{author}, $metadata{dist_author}; - is $node->{license}, $metadata{license}; - is_deeply $node->{configure_requires}, $mb_config_req, 'Add M::B to configure_requires'; - is_deeply $node->{test_requires}, { + is_deeply $node->{license}, [ 'perl_5' ]; + is_deeply $node->{prereqs}{configure}{requires}, $mb_config_req, 'Add M::B to configure_requires'; + is_deeply $node->{prereqs}{test}{requires}, { 'Test::More' => '0.49', }, 'Test::More was required by ->new'; like $node->{generated_by}, qr{Module::Build}; @@ -102,7 +102,7 @@ # exists() doesn't seem to work here - is_deeply $node->{configure_requires}, $mb_prereq, 'Add M::B to configure_requires'; + is_deeply $node->{prereqs}{configure}{requires}, $mb_prereq, 'Add M::B to configure_requires'; } $dist->clean; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/t/mymeta.t new/Module-Build-0.4203/t/mymeta.t --- old/Module-Build-0.4007/t/mymeta.t 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/t/mymeta.t 2013-11-27 19:16:41.000000000 +0100 @@ -24,6 +24,9 @@ requires => { 'File::Spec' => ( \$ENV{BUMP_PREREQ} ? 0.86 : 0 ), }, + configure_requires => { + 'Module::Build' => '0.42', + } ); \$builder->create_build_script(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/t/properties/license.t new/Module-Build-0.4203/t/properties/license.t --- old/Module-Build-0.4007/t/properties/license.t 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/t/properties/license.t 2013-11-27 19:16:41.000000000 +0100 @@ -30,8 +30,8 @@ my $meta = $mb->get_metadata( fatal => 0 ); - is( $meta->{license} => 'perl', "META license will be 'perl'" ); - is( $meta->{resources}{license}, "http://dev.perl.org/licenses/", + is_deeply( $meta->{license} => [ 'perl_5' ], "META license will be 'perl'" ); + is_deeply( $meta->{resources}{license}, [ "http://dev.perl.org/licenses/" ], "META license URL is correct" ); @@ -55,8 +55,8 @@ my $meta = $mb->get_metadata( fatal => 0 ); - is( $meta->{license} => 'unrestricted', "META license will be 'unrestricted'" ); - is( $meta->{resources}{license}, "http://example.com/vaporware/", + is_deeply( $meta->{license} => [ 'unrestricted' ], "META license will be 'unrestricted'" ); + is_deeply( $meta->{resources}{license}, [ "http://example.com/vaporware/" ], "META license URL is correct" ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/t/properties/requires.t new/Module-Build-0.4203/t/properties/requires.t --- old/Module-Build-0.4007/t/properties/requires.t 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/t/properties/requires.t 2013-11-27 19:16:41.000000000 +0100 @@ -31,7 +31,7 @@ isa_ok( $mb, "Module::Build" ); $prereqs = $mb->_normalize_prereqs; -is($prereqs->{requires}{'File::Basename'}, 0, "undef prereq converted to 0"); +is($prereqs->{runtime}{requires}{'File::Basename'}, 0, "undef prereq converted to 0"); #--------------------------------------------------------------------------# # try empty string prereq version @@ -48,7 +48,7 @@ isa_ok( $mb, "Module::Build" ); $prereqs = $mb->_normalize_prereqs; -is($prereqs->{requires}{'File::Basename'}, 0, "empty string prereq converted to 0"); +is($prereqs->{runtime}{requires}{'File::Basename'}, 0, "empty string prereq converted to 0"); # vim:ts=2:sw=2:et:sta:sts=2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/t/test_reqs.t new/Module-Build-0.4203/t/test_reqs.t --- old/Module-Build-0.4007/t/test_reqs.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Module-Build-0.4203/t/test_reqs.t 2013-11-27 19:16:41.000000000 +0100 @@ -0,0 +1,52 @@ +#!/usr/bin/perl -w + +use strict; +use lib 't/lib'; +use MBTest; +use CPAN::Meta 2.110420; +use CPAN::Meta::YAML; +use Parse::CPAN::Meta 1.4401; +plan tests => 4; + +blib_load('Module::Build'); + +my $tmp = MBTest->tmpdir; + +use DistGen; +my $dist = DistGen->new( dir => $tmp ); +$dist->change_file('Build.PL', <<"---"); +use strict; +use Module::Build; + +my \$builder = Module::Build->new( + module_name => '$dist->{name}', + license => 'perl', + requires => { + 'File::Spec' => 0, + }, + test_requires => { + 'Test::More' => 0, + } +); + +\$builder->create_build_script(); +--- +$dist->regen; +$dist->chdir_in; +$dist->run_build_pl; +my $output = stdout_stderr_of sub { $dist->run_build('distmeta') }; + +for my $file ( qw/MYMETA META/ ) { + my $meta = Parse::CPAN::Meta->load_file($file.".json"); + is_deeply($meta->{prereqs}->{runtime},{ + requires => { + 'File::Spec' => '0', + } + }, "runtime prereqs in $file"); + is_deeply($meta->{prereqs}->{test},{ + requires => { + 'Test::More' => '0', + } + }, "test prereqs in $file"); +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Module-Build-0.4007/t/unit_run_test_harness.t new/Module-Build-0.4203/t/unit_run_test_harness.t --- old/Module-Build-0.4007/t/unit_run_test_harness.t 2013-07-19 13:53:57.000000000 +0200 +++ new/Module-Build-0.4203/t/unit_run_test_harness.t 2013-11-27 19:16:41.000000000 +0100 @@ -24,7 +24,7 @@ { package MB::Subclass; use base qw(Module::Build); - sub harness_switches { } + sub harness_switches { return } } { @@ -35,19 +35,19 @@ no warnings qw[redefine once]; # This runs run_test_harness with Test::Harness::switches = undef and harness_switches() returning empty list, - # ensure there are no warnings, and output is undef too + # ensure there are no warnings, and output is empty too { my $mb = MB::Subclass->new( module_name => $dist->name ); local *Test::Harness::runtests = sub { is shift(), $mock1, "runtests ran with expected parameters"; is shift(), $mock2, "runtests ran with expected parameters"; - is $Test::Harness::switches, undef, "switches are undef"; - is $Test::Harness::Switches, undef, "switches are undef"; + is $Test::Harness::switches, '', "switches are undef"; + is $Test::Harness::Switches, '', "switches are undef"; }; # $Test::Harness::switches and $Test::Harness::switches are aliases, but we pretend we don't know this - local $Test::Harness::switches = undef; - local $Test::Harness::switches = undef; + local $Test::Harness::switches = ''; + local $Test::Harness::switches = ''; $mb->run_test_harness([$mock1, $mock2]); ok 1, "run_test_harness should not produce warning if Test::Harness::[Ss]witches are undef and harness_switches() return empty list"; -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org