@@ -25,6 +25,12 @@ use Module::Build;
my $build = Module::Build->new(
module_name => 'Module::Build',
license => 'perl',
+ configure_requires => {
+ 'CPAN::Meta' => '2.142060',
+ 'Perl::OSType' => 1,
+ 'Module::Metadata' => '1.000002',
+ 'version' => '0.87',
+ },
build_requires => {
'File::Temp' => 0.15, # tmpdir() + fixes
'Test::More' => 0.49,
@@ -53,7 +59,7 @@ my $build = Module::Build->new(
'Text::ParseWords' => 0,
'Getopt::Long' => 0,
'Test::Harness' => 0,
- 'CPAN::Meta' => '2.110420',
+ 'CPAN::Meta' => '2.142060',
'Perl::OSType' => 1, # needs 1.0 API
'version' => 0.87, # No longer requires M::B
'Module::Metadata' => 1.000002, # uses version.pm
@@ -1,5 +1,51 @@
Revision history for Perl extension Module::Build.
+0.4210 - Mon Sep 1 13:30:29 CEST 2014
+
+ [BUG FIXES]
+
+ - Fixup CPAN::Meta dependency
+
+ - Handle old releases of CPAN::Meta more gracefully.
+
+0.4209 - Mon Sep 1 12:24:40 CEST 2014
+
+ [BUG FIXES]
+
+ - Stop calling UNIVERSAL::isa as a function
+
+ [ENHANCEMENTS]
+
+ - Use CPAN::Meta::Merge for meta_merge
+
+ - Convert with CPAN::Meta::Convert in meta_add
+
+ - Add configure requirements
+
+0.4208 - Mon Aug 18 21:44:38 CEST 2014
+
+ [BUG FIXES]
+
+ - Removed missed references to Module::Build::Version
+
+0.4207 - Sat Aug 16 12:56:59 CEST 2014
+
+ [BUG FIXES]
+
+ - Fix type installdir -> installdirs [Leon Timmermans, Vitaliy Tokarev]
+
+ [DEPRECATIONS]
+
+ - Module::Build::YAML has been removed
+
+ - Module::Build::ModuleInfo has been removed
+
+ - Module::Build::Version has been removed
+
+ - Get rid of "use vars"
+
+ - Added use warnings to all modules
+
0.4206 - Sat Jul 12 14:03:01 CEST 2014
[BUG FIXES]
@@ -18,7 +18,6 @@ lib/Module/Build/Compat.pm
lib/Module/Build/Config.pm
lib/Module/Build/Cookbook.pm
lib/Module/Build/Dumper.pm
-lib/Module/Build/ModuleInfo.pm
lib/Module/Build/Notes.pm
lib/Module/Build/Platform/aix.pm
lib/Module/Build/Platform/cygwin.pm
@@ -32,8 +31,6 @@ lib/Module/Build/Platform/VOS.pm
lib/Module/Build/Platform/Windows.pm
lib/Module/Build/PodParser.pm
lib/Module/Build/PPMMaker.pm
-lib/Module/Build/Version.pm
-lib/Module/Build/YAML.pm
LICENSE
Makefile.PL
MANIFEST
@@ -5,7 +5,7 @@
"Module-Build mailing list at <module-build@perl.org>."
],
"dynamic_config" : 1,
- "generated_by" : "Module::Build version 0.4206",
+ "generated_by" : "Module::Build version 0.421",
"license" : [
"perl_5"
],
@@ -24,13 +24,21 @@
"Test::More" : "0.49"
}
},
+ "configure" : {
+ "requires" : {
+ "CPAN::Meta" : "2.142060",
+ "Module::Metadata" : "1.000002",
+ "Perl::OSType" : "1",
+ "version" : "0.87"
+ }
+ },
"runtime" : {
"recommends" : {
"ExtUtils::Install" : "0.3",
"ExtUtils::Manifest" : "1.54"
},
"requires" : {
- "CPAN::Meta" : "2.110420",
+ "CPAN::Meta" : "2.142060",
"Cwd" : "0",
"Data::Dumper" : "0",
"ExtUtils::CBuilder" : "0.27",
@@ -51,7 +59,7 @@
"Test::Harness" : "0",
"Text::Abbrev" : "0",
"Text::ParseWords" : "0",
- "perl" : "5.006001",
+ "perl" : "5.008000",
"version" : "0.87"
}
}
@@ -59,99 +67,87 @@
"provides" : {
"Module::Build" : {
"file" : "lib/Module/Build.pm",
- "version" : "0.4206"
+ "version" : "0.4210"
},
"Module::Build::Base" : {
"file" : "lib/Module/Build/Base.pm",
- "version" : "0.4206"
+ "version" : "0.4210"
},
"Module::Build::Compat" : {
"file" : "lib/Module/Build/Compat.pm",
- "version" : "0.4206"
+ "version" : "0.4210"
},
"Module::Build::Config" : {
"file" : "lib/Module/Build/Config.pm",
- "version" : "0.4206"
+ "version" : "0.4210"
},
"Module::Build::Cookbook" : {
"file" : "lib/Module/Build/Cookbook.pm",
- "version" : "0.4206"
+ "version" : "0.4210"
},
"Module::Build::Dumper" : {
"file" : "lib/Module/Build/Dumper.pm",
- "version" : "0.4206"
- },
- "Module::Build::ModuleInfo" : {
- "file" : "lib/Module/Build/ModuleInfo.pm",
- "version" : "0.4206"
+ "version" : "0.4210"
},
"Module::Build::Notes" : {
"file" : "lib/Module/Build/Notes.pm",
- "version" : "0.4206"
+ "version" : "0.4210"
},
"Module::Build::PPMMaker" : {
"file" : "lib/Module/Build/PPMMaker.pm",
- "version" : "0.4206"
+ "version" : "0.4210"
},
"Module::Build::Platform::Default" : {
"file" : "lib/Module/Build/Platform/Default.pm",
- "version" : "0.4206"
+ "version" : "0.4210"
},
"Module::Build::Platform::MacOS" : {
"file" : "lib/Module/Build/Platform/MacOS.pm",
- "version" : "0.4206"
+ "version" : "0.4210"
},
"Module::Build::Platform::Unix" : {
"file" : "lib/Module/Build/Platform/Unix.pm",
- "version" : "0.4206"
+ "version" : "0.4210"
},
"Module::Build::Platform::VMS" : {
"file" : "lib/Module/Build/Platform/VMS.pm",
- "version" : "0.4206"
+ "version" : "0.4210"
},
"Module::Build::Platform::VOS" : {
"file" : "lib/Module/Build/Platform/VOS.pm",
- "version" : "0.4206"
+ "version" : "0.4210"
},
"Module::Build::Platform::Windows" : {
"file" : "lib/Module/Build/Platform/Windows.pm",
- "version" : "0.4206"
+ "version" : "0.4210"
},
"Module::Build::Platform::aix" : {
"file" : "lib/Module/Build/Platform/aix.pm",
- "version" : "0.4206"
+ "version" : "0.4210"
},
"Module::Build::Platform::cygwin" : {
"file" : "lib/Module/Build/Platform/cygwin.pm",
- "version" : "0.4206"
+ "version" : "0.4210"
},
"Module::Build::Platform::darwin" : {
"file" : "lib/Module/Build/Platform/darwin.pm",
- "version" : "0.4206"
+ "version" : "0.4210"
},
"Module::Build::Platform::os2" : {
"file" : "lib/Module/Build/Platform/os2.pm",
- "version" : "0.4206"
+ "version" : "0.4210"
},
"Module::Build::PodParser" : {
"file" : "lib/Module/Build/PodParser.pm",
- "version" : "0.4206"
- },
- "Module::Build::Version" : {
- "file" : "lib/Module/Build/Version.pm",
- "version" : "0.87"
- },
- "Module::Build::YAML" : {
- "file" : "lib/Module/Build/YAML.pm",
- "version" : "1.41"
+ "version" : "0.4210"
},
"inc::latest" : {
"file" : "lib/inc/latest.pm",
- "version" : "0.4206"
+ "version" : "0.4210"
},
"inc::latest::private" : {
"file" : "lib/inc/latest/private.pm",
- "version" : "0.4206"
+ "version" : "0.4210"
}
},
"release_status" : "stable",
@@ -162,7 +158,7 @@
"repository" : {
"url" : "https://github.com/Perl-Toolchain-Gang/Module-Build"
},
- "x_mailingList" : "mailto:module-build@perl.org"
+ "x_MailingList" : "mailto:module-build@perl.org"
},
- "version" : "0.4206"
+ "version" : "0.4210"
}
@@ -9,8 +9,13 @@ build_requires:
Parse::CPAN::Meta: '1.4401'
Test::Harness: '3.16'
Test::More: '0.49'
+configure_requires:
+ CPAN::Meta: '2.142060'
+ Module::Metadata: '1.000002'
+ Perl::OSType: '1'
+ version: '0.87'
dynamic_config: 1
-generated_by: 'Module::Build version 0.4206, CPAN::Meta::Converter version 2.140640'
+generated_by: 'Module::Build version 0.421, CPAN::Meta::Converter version 2.142060'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -19,81 +24,72 @@ name: Module-Build
provides:
Module::Build:
file: lib/Module/Build.pm
- version: '0.4206'
+ version: '0.4210'
Module::Build::Base:
file: lib/Module/Build/Base.pm
- version: '0.4206'
+ version: '0.4210'
Module::Build::Compat:
file: lib/Module/Build/Compat.pm
- version: '0.4206'
+ version: '0.4210'
Module::Build::Config:
file: lib/Module/Build/Config.pm
- version: '0.4206'
+ version: '0.4210'
Module::Build::Cookbook:
file: lib/Module/Build/Cookbook.pm
- version: '0.4206'
+ version: '0.4210'
Module::Build::Dumper:
file: lib/Module/Build/Dumper.pm
- version: '0.4206'
- Module::Build::ModuleInfo:
- file: lib/Module/Build/ModuleInfo.pm
- version: '0.4206'
+ version: '0.4210'
Module::Build::Notes:
file: lib/Module/Build/Notes.pm
- version: '0.4206'
+ version: '0.4210'
Module::Build::PPMMaker:
file: lib/Module/Build/PPMMaker.pm
- version: '0.4206'
+ version: '0.4210'
Module::Build::Platform::Default:
file: lib/Module/Build/Platform/Default.pm
- version: '0.4206'
+ version: '0.4210'
Module::Build::Platform::MacOS:
file: lib/Module/Build/Platform/MacOS.pm
- version: '0.4206'
+ version: '0.4210'
Module::Build::Platform::Unix:
file: lib/Module/Build/Platform/Unix.pm
- version: '0.4206'
+ version: '0.4210'
Module::Build::Platform::VMS:
file: lib/Module/Build/Platform/VMS.pm
- version: '0.4206'
+ version: '0.4210'
Module::Build::Platform::VOS:
file: lib/Module/Build/Platform/VOS.pm
- version: '0.4206'
+ version: '0.4210'
Module::Build::Platform::Windows:
file: lib/Module/Build/Platform/Windows.pm
- version: '0.4206'
+ version: '0.4210'
Module::Build::Platform::aix:
file: lib/Module/Build/Platform/aix.pm
- version: '0.4206'
+ version: '0.4210'
Module::Build::Platform::cygwin:
file: lib/Module/Build/Platform/cygwin.pm
- version: '0.4206'
+ version: '0.4210'
Module::Build::Platform::darwin:
file: lib/Module/Build/Platform/darwin.pm
- version: '0.4206'
+ version: '0.4210'
Module::Build::Platform::os2:
file: lib/Module/Build/Platform/os2.pm
- version: '0.4206'
+ version: '0.4210'
Module::Build::PodParser:
file: lib/Module/Build/PodParser.pm
- version: '0.4206'
- Module::Build::Version:
- file: lib/Module/Build/Version.pm
- version: '0.87'
- Module::Build::YAML:
- file: lib/Module/Build/YAML.pm
- version: '1.41'
+ version: '0.4210'
inc::latest:
file: lib/inc/latest.pm
- version: '0.4206'
+ version: '0.4210'
inc::latest::private:
file: lib/inc/latest/private.pm
- version: '0.4206'
+ version: '0.4210'
recommends:
ExtUtils::Install: '0.3'
ExtUtils::Manifest: '1.54'
requires:
- CPAN::Meta: '2.110420'
+ CPAN::Meta: '2.142060'
Cwd: '0'
Data::Dumper: '0'
ExtUtils::CBuilder: '0.27'
@@ -114,10 +110,10 @@ requires:
Test::Harness: '0'
Text::Abbrev: '0'
Text::ParseWords: '0'
- perl: '5.006001'
+ perl: '5.008000'
version: '0.87'
resources:
+ MailingList: mailto:module-build@perl.org
license: http://dev.perl.org/licenses/
- mailingList: mailto:module-build@perl.org
repository: https://github.com/Perl-Toolchain-Gang/Module-Build
-version: '0.4206'
+version: '0.4210'
@@ -959,10 +959,9 @@ sub stringify
sub vcmp
{
- require UNIVERSAL;
my ($left,$right,$swap) = @_;
my $class = ref($left);
- unless ( UNIVERSAL::isa($right, $class) ) {
+ unless ( eval { $right->isa($class) } ) {
$right = $class->new($right);
}
@@ -84,7 +84,7 @@ sub new_from_module {
my $compare_versions = sub {
my ($v1, $op, $v2) = @_;
$v1 = version->new($v1)
- unless UNIVERSAL::isa($v1,'version');
+ unless eval { $v1->isa('version') };
my $eval_str = "\$v1 $op \$v2";
my $result = eval $eval_str;
@@ -1267,7 +1267,7 @@ that were passed to the C<new()> method.
[version 0.20]
-[Deprecated] Please see L<Module::Build::ModuleInfo> instead.
+[Deprecated] Please see L<Module::Metadata> instead.
Returns true if the given file appears to contain POD documentation.
Currently this checks whether the file has a line beginning with
@@ -2,13 +2,12 @@
# vim:ts=8:sw=2:et:sta:sts=2
package Module::Build::Base;
+use 5.006;
use strict;
-use vars qw($VERSION);
use warnings;
-$VERSION = '0.4206';
+our $VERSION = '0.4210';
$VERSION = eval $VERSION;
-BEGIN { require 5.006001 }
use Carp;
use Cwd ();
@@ -21,10 +20,10 @@ use File::Compare ();
use Module::Build::Dumper ();
use Text::ParseWords ();
-use Module::Build::ModuleInfo;
+use Module::Metadata;
use Module::Build::Notes;
use Module::Build::Config;
-use Module::Build::Version;
+use version;
#################### Constructors ###########################
@@ -86,7 +85,7 @@ sub resume {
# Module::Build->new_from_context() and the correct class to use is
# actually a *subclass* of Module::Build, we may need to load that
# subclass here and re-delegate the resume() method to it.
- unless ( UNIVERSAL::isa($package, $self->build_class) ) {
+ unless ( $package->isa($self->build_class) ) {
my $build_class = $self->build_class;
my $config_dir = $self->config_dir || '_build';
my $build_lib = File::Spec->catdir( $config_dir, 'lib' );
@@ -1098,7 +1097,7 @@ sub _guess_module_name {
my $p = $self->{properties};
return if $p->{module_name};
if ( $p->{dist_version_from} && -e $p->{dist_version_from} ) {
- my $mi = Module::Build::ModuleInfo->new_from_file($self->dist_version_from);
+ my $mi = Module::Metadata->new_from_file($self->dist_version_from);
$p->{module_name} = $mi->name;
}
else {
@@ -1193,7 +1192,7 @@ sub dist_version {
if ( my $dist_version_from = $self->dist_version_from ) {
my $version_from = File::Spec->catfile( split( qr{/}, $dist_version_from ) );
- my $pm_info = Module::Build::ModuleInfo->new_from_file( $version_from )
+ my $pm_info = Module::Metadata->new_from_file( $version_from )
or die "Can't find file $version_from to determine version";
#$p->{$me} is undef here
$p->{$me} = $self->normalize_version( $pm_info->version() );
@@ -1212,7 +1211,7 @@ sub dist_version {
sub _is_dev_version {
my ($self) = @_;
my $dist_version = $self->dist_version;
- my $version_obj = eval { Module::Build::Version->new( $dist_version ) };
+ my $version_obj = eval { version->new( $dist_version ) };
# assume it's normal if the version string is fatal -- in this case
# the author might be doing something weird so should play along and
# assume they'll specify all necessary behavior
@@ -1240,11 +1239,11 @@ sub _pod_parse {
}
sub version_from_file { # Method provided for backwards compatibility
- return Module::Build::ModuleInfo->new_from_file($_[1])->version();
+ return Module::Metadata->new_from_file($_[1])->version();
}
sub find_module_by_name { # Method provided for backwards compatibility
- return Module::Build::ModuleInfo->find_module_by_name(@_[1,2]);
+ return Module::Metadata->find_module_by_name(@_[1,2]);
}
{
@@ -1683,7 +1682,7 @@ sub check_installed_status {
# Don't try to load if it's already loaded
} else {
- my $pm_info = Module::Build::ModuleInfo->new_from_module( $modname );
+ my $pm_info = Module::Metadata->new_from_module( $modname );
unless (defined( $pm_info )) {
@status{ qw(have message) } = ('<none>', "$modname is not installed");
return \%status;
@@ -1720,8 +1719,8 @@ sub check_installed_status {
sub compare_versions {
my $self = shift;
my ($v1, $op, $v2) = @_;
- $v1 = Module::Build::Version->new($v1)
- unless UNIVERSAL::isa($v1,'Module::Build::Version');
+ $v1 = version->new($v1)
+ unless eval { $v1->isa('version') };
my $eval_str = "\$v1 $op \$v2";
my $result = eval $eval_str;
@@ -1804,7 +1803,7 @@ sub print_build_script {
my $config_requires;
if ( -f $self->metafile ) {
my $meta = eval { $self->read_metafile( $self->metafile ) };
- $config_requires = $meta && $meta->{configure_requires}{'Module::Build'};
+ $config_requires = $meta && $meta->{prereqs}{configure}{requires}{'Module::Build'};
}
$config_requires ||= 0;
@@ -2062,8 +2061,8 @@ sub unparse_args {
my ($self, $args) = @_;
my @out;
while (my ($k, $v) = each %$args) {
- push @out, (UNIVERSAL::isa($v, 'HASH') ? map {+"--$k", "$_=$v->{$_}"} keys %$v :
- UNIVERSAL::isa($v, 'ARRAY') ? map {+"--$k", $_} @$v :
+ push @out, (ref $v eq 'HASH' ? map {+"--$k", "$_=$v->{$_}"} keys %$v :
+ ref $v eq 'ARRAY' ? map {+"--$k", $_} @$v :
("--$k", $v));
}
return @out;
@@ -2107,7 +2106,7 @@ sub _translate_option {
return $opt;
}
-my %singular_argument = map { ($_ => 1) } qw/install_base prefix destdir installdir verbose quiet uninst debug sign/;
+my %singular_argument = map { ($_ => 1) } qw/install_base prefix destdir installdirs verbose quiet uninst debug sign/;
sub _read_arg {
my ($self, $args, $key, $val) = @_;
@@ -2783,7 +2782,7 @@ sub ACTION_testdb {
sub ACTION_testcover {
my ($self) = @_;
- unless (Module::Build::ModuleInfo->find_module_by_name('Devel::Cover')) {
+ unless (Module::Metadata->find_module_by_name('Devel::Cover')) {
warn("Cannot run testcover action unless Devel::Cover is installed.\n");
return;
}
@@ -2971,12 +2970,12 @@ sub find_PL_files {
if (my $files = $self->{properties}{PL_files}) {
# 'PL_files' is given as a Unix file spec, so we localize_file_path().
- if (UNIVERSAL::isa($files, 'ARRAY')) {
+ if (ref $files eq 'ARRAY') {
return { map {$_, [/^(.*)\.PL$/]}
map $self->localize_file_path($_),
@$files };
- } elsif (UNIVERSAL::isa($files, 'HASH')) {
+ } elsif (ref $files eq 'HASH') {
my %out;
while (my ($file, $to) = each %$files) {
$out{ $self->localize_file_path($file) } = [ map $self->localize_file_path($_),
@@ -3017,7 +3016,7 @@ sub find_test_files {
my $p = $self->{properties};
if (my $files = $p->{test_files}) {
- $files = [keys %$files] if UNIVERSAL::isa($files, 'HASH');
+ $files = [keys %$files] if ref $files eq 'HASH';
$files = [map { -d $_ ? $self->expand_test_dir($_) : $_ }
map glob,
$self->split_like_shell($files)];
@@ -3524,7 +3523,7 @@ sub ACTION_diff {
my @parts = File::Spec->splitdir($file);
@parts = @parts[@localparts .. $#parts]; # Get rid of blib/lib or similar
- my $installed = Module::Build::ModuleInfo->find_module_by_name(
+ my $installed = Module::Metadata->find_module_by_name(
join('::', @parts), \@myINC );
if (not $installed) {
print "Only in lib: $file\n";
@@ -4363,8 +4362,8 @@ sub script_files {
next unless $_;
# Always coerce into a hash
- return $_ if UNIVERSAL::isa($_, 'HASH');
- return $_ = { map {$_,1} @$_ } if UNIVERSAL::isa($_, 'ARRAY');
+ return $_ if ref $_ eq 'HASH';
+ return $_ = { map {$_,1} @$_ } if ref $_ eq 'ARRAY';
die "'script_files' must be a hashref, arrayref, or string" if ref();
@@ -4566,28 +4565,13 @@ sub _get_meta_object {
return $meta;
}
-# 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, $struct) = @_;
-
- return unless $self->try_require("CPAN::Meta", "2.110420");
-
- my $meta = CPAN::Meta->new( $struct );
- return $meta->save( $metafile, { version => "1.4" } );
+ return $meta->as_struct( {version => "2.0"} );
}
sub normalize_version {
@@ -4597,8 +4581,7 @@ sub normalize_version {
if ( $version =~ /[=<>!,]/ ) { # logic, not just version
# take as is without modification
}
- elsif ( ref $version eq 'version' ||
- ref $version eq 'Module::Build::Version' ) { # version objects
+ elsif ( ref $version eq 'version') { # version objects
$version = $version->is_qv ? $version->normal : $version->stringify;
}
elsif ( $version =~ /^[^v][^.]*\.[^.]+\./ ) { # no leading v, multiple dots
@@ -4661,58 +4644,6 @@ sub _get_license {
return ($meta_license, $meta_license_url);
}
-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 _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 {
- my $out_key = $key =~ / \A x_ /xi ? $key : "x_$key";
- $ret{$out_key} = $input->{$key};
- }
- }
- return \%ret;
-}
-
sub get_metadata {
my ($self, %args) = @_;
@@ -4764,14 +4695,30 @@ sub get_metadata {
"Nothing to enter for 'provides' field in metafile.\n");
}
- my $meta_add = _upconvert_metapiece($self->meta_add, 'add');
- while (my($k, $v) = each %{$meta_add} ) {
- $metadata{$k} = $v;
+ if (my $add = $self->meta_add) {
+ if (not exists $add->{'meta-spec'} or $add->{'meta-spec'}{version} != 2) {
+ require CPAN::Meta::Converter;
+ if (CPAN::Meta::Converter->VERSION('2.141170')) {
+ $add = CPAN::Meta::Converter->new($add)->upgrade_fragment;
+ delete $add->{prereqs}; # XXX this would now overwrite all prereqs
+ }
+ else {
+ $self->log_warn("Can't meta_add without CPAN::Meta 2.141170");
+ }
+ }
+
+ while (my($k, $v) = each %{$add}) {
+ $metadata{$k} = $v;
+ }
}
- my $meta_merge = _upconvert_metapiece($self->meta_merge, 'merge');
- while (my($k, $v) = each %{$meta_merge} ) {
- $self->_hash_merge(\%metadata, $k, $v);
+ if (my $merge = $self->meta_merge) {
+ if (eval { require CPAN::Meta::Merge }) {
+ %metadata = %{ CPAN::Meta::Merge->new(default_version => '1.4')->merge(\%metadata, $merge) };
+ }
+ else {
+ $self->log_warn("Can't merge without CPAN::Meta::Merge");
+ }
}
return \%metadata;
@@ -4836,7 +4783,7 @@ sub find_packages_in_files {
my @path = split( /\//, $mapped_filename );
(my $prime_package = join( '::', @path[1..$#path] )) =~ s/\.pm$//;
- my $pm_info = Module::Build::ModuleInfo->new_from_file( $file );
+ my $pm_info = Module::Metadata->new_from_file( $file );
foreach my $package ( $pm_info->packages_inside ) {
next if $package eq 'main'; # main can appear numerous times, ignore
@@ -4847,7 +4794,7 @@ sub find_packages_in_files {
if ( $package eq $prime_package ) {
if ( exists( $prime{$package} ) ) {
- # M::B::ModuleInfo will handle this conflict
+ # Module::Metadata will handle this conflict
die "Unexpected conflict in '$package'; multiple versions found.\n";
} else {
$prime{$package}{file} = $mapped_filename;
@@ -5417,14 +5364,14 @@ sub compile_xs {
} else {
# Ok, I give up. Just use backticks.
- my $xsubpp = Module::Build::ModuleInfo->find_module_by_name('ExtUtils::xsubpp')
+ my $xsubpp = Module::Metadata->find_module_by_name('ExtUtils::xsubpp')
or die "Can't find ExtUtils::xsubpp in INC (@INC)";
my @typemaps;
- push @typemaps, Module::Build::ModuleInfo->find_module_by_name(
+ push @typemaps, Module::Metadata->find_module_by_name(
'ExtUtils::typemap', \@INC
);
- my $lib_typemap = Module::Build::ModuleInfo->find_module_by_name(
+ my $lib_typemap = Module::Metadata->find_module_by_name(
'typemap', [File::Basename::dirname($file), File::Spec->rel2abs('.')]
);
push @typemaps, $lib_typemap if $lib_typemap;
@@ -5447,7 +5394,7 @@ sub split_like_shell {
my ($self, $string) = @_;
return () unless defined($string);
- return @$string if UNIVERSAL::isa($string, 'ARRAY');
+ return @$string if ref $string eq 'ARRAY';
$string =~ s/^\s+|\s+$//g;
return () unless length($string);
@@ -1,15 +1,15 @@
package Module::Build::Compat;
use strict;
-use vars qw($VERSION);
-$VERSION = '0.4206';
+use warnings;
+our $VERSION = '0.4210';
use File::Basename ();
use File::Spec;
use Config;
use Module::Build;
-use Module::Build::ModuleInfo;
-use Module::Build::Version;
+use Module::Metadata;
+use version;
use Data::Dumper;
my %convert_installdirs = (
@@ -74,7 +74,7 @@ sub _merge_prereq {
for my $k (keys %$p) {
next if $k eq 'perl';
- my $v_obj = eval { Module::Build::Version->new($p->{$k}) };
+ my $v_obj = eval { version->new($p->{$k}) };
if ( ! defined $v_obj ) {
die "A prereq of the form '$p->{$k}' for '$k' is not supported by Module::Build::Compat ( use a simpler version like '0.05' or 'v1.4.25' )\n";
}
@@ -131,7 +131,7 @@ HERE
# Makefile.PL
my $requires = $build->requires;
if ( my $minimum_perl = $requires->{perl} ) {
- my $min_ver = Module::Build::Version->new($minimum_perl)->numify;
+ my $min_ver = version->new($minimum_perl)->numify;
print {$fh} "require $min_ver;\n";
}
@@ -259,7 +259,7 @@ sub _test_globs {
sub subclass_dir {
my ($self, $build) = @_;
- return (Module::Build::ModuleInfo->find_module_dir_by_name(ref $build)
+ return (Module::Metadata->find_module_dir_by_name(ref $build)
|| File::Spec->catdir($build->config_dir, 'lib'));
}
@@ -1,8 +1,8 @@
package Module::Build::Config;
use strict;
-use vars qw($VERSION);
-$VERSION = '0.4206';
+use warnings;
+our $VERSION = '0.4210';
$VERSION = eval $VERSION;
use Config;
@@ -1,7 +1,7 @@
package Module::Build::Cookbook;
use strict;
-use vars qw($VERSION);
-$VERSION = '0.4206';
+use warnings;
+our $VERSION = '0.4210';
=head1 NAME
@@ -1,7 +1,7 @@
package Module::Build::Dumper;
use strict;
-use vars qw($VERSION);
-$VERSION = '0.4206';
+use warnings;
+our $VERSION = '0.4210';
# This is just a split-out of a wrapper function to do Data::Dumper
# stuff "the right way". See:
@@ -1,34 +0,0 @@
-# -*- mode: cperl; tab-width: 8; indent-tabs-mode: nil; basic-offset: 2 -*-
-# vim:ts=8:sw=2:et:sta:sts=2
-package Module::Build::ModuleInfo;
-
-use strict;
-use vars qw($VERSION);
-$VERSION = '0.4206';
-$VERSION = eval $VERSION;
-
-require Module::Metadata;
-our @ISA = qw/Module::Metadata/;
-
-1;
-
-__END__
-
-=for :stopwords ModuleInfo
-
-=head1 NAME
-
-Module::Build::ModuleInfo - DEPRECATED
-
-=head1 DESCRIPTION
-
-This module has been extracted into a separate distribution and renamed
-L<Module::Metadata>. This module is kept as a subclass wrapper for
-compatibility.
-
-=head1 SEE ALSO
-
-perl(1), L<Module::Build>, L<Module::Metadata>
-
-=cut
-
@@ -3,8 +3,8 @@ package Module::Build::Notes;
# A class for persistent hashes
use strict;
-use vars qw($VERSION);
-$VERSION = '0.4206';
+use warnings;
+our $VERSION = '0.4210';
$VERSION = eval $VERSION;
use Data::Dumper;
use Module::Build::Dumper;
@@ -1,10 +1,10 @@
package Module::Build::PPMMaker;
use strict;
+use warnings;
use Config;
-use vars qw($VERSION);
-$VERSION = '0.4206';
+our $VERSION = '0.4210';
$VERSION = eval $VERSION;
# This code is mostly borrowed from ExtUtils::MM_Unix 6.10_03, with a
@@ -1,13 +1,12 @@
package Module::Build::Platform::Default;
use strict;
-use vars qw($VERSION);
-$VERSION = '0.4206';
+use warnings;
+our $VERSION = '0.4210';
$VERSION = eval $VERSION;
use Module::Build::Base;
-use vars qw(@ISA);
-@ISA = qw(Module::Build::Base);
+our @ISA = qw(Module::Build::Base);
1;
__END__
@@ -1,12 +1,11 @@
package Module::Build::Platform::MacOS;
use strict;
-use vars qw($VERSION);
-$VERSION = '0.4206';
+use warnings;
+our $VERSION = '0.4210';
$VERSION = eval $VERSION;
use Module::Build::Base;
-use vars qw(@ISA);
-@ISA = qw(Module::Build::Base);
+our @ISA = qw(Module::Build::Base);
use ExtUtils::Install;
@@ -1,13 +1,12 @@
package Module::Build::Platform::Unix;
use strict;
-use vars qw($VERSION);
-$VERSION = '0.4206';
+use warnings;
+our $VERSION = '0.4210';
$VERSION = eval $VERSION;
use Module::Build::Base;
-use vars qw(@ISA);
-@ISA = qw(Module::Build::Base);
+our @ISA = qw(Module::Build::Base);
sub is_executable {
# We consider the owner bit to be authoritative on a file, because
@@ -1,14 +1,13 @@
package Module::Build::Platform::VMS;
use strict;
-use vars qw($VERSION);
-$VERSION = '0.4206';
+use warnings;
+our $VERSION = '0.4210';
$VERSION = eval $VERSION;
use Module::Build::Base;
use Config;
-use vars qw(@ISA);
-@ISA = qw(Module::Build::Base);
+our @ISA = qw(Module::Build::Base);
@@ -152,7 +151,7 @@ sub _quote_args {
# elements of it and return the reference.
my ($self, @args) = @_;
my $got_arrayref = (scalar(@args) == 1
- && UNIVERSAL::isa($args[0], 'ARRAY'))
+ && ref $args[0] eq 'ARRAY')
? 1
: 0;
@@ -1,13 +1,12 @@
package Module::Build::Platform::VOS;
use strict;
-use vars qw($VERSION);
-$VERSION = '0.4206';
+use warnings;
+our $VERSION = '0.4210';
$VERSION = eval $VERSION;
use Module::Build::Base;
-use vars qw(@ISA);
-@ISA = qw(Module::Build::Base);
+our @ISA = qw(Module::Build::Base);
1;
@@ -1,8 +1,8 @@
package Module::Build::Platform::Windows;
use strict;
-use vars qw($VERSION);
-$VERSION = '0.4206';
+use warnings;
+our $VERSION = '0.4210';
$VERSION = eval $VERSION;
use Config;
@@ -11,8 +11,7 @@ use File::Spec;
use Module::Build::Base;
-use vars qw(@ISA);
-@ISA = qw(Module::Build::Base);
+our @ISA = qw(Module::Build::Base);
sub manpage_separator {
@@ -209,7 +208,7 @@ sub split_like_shell {
(my $self, local $_) = @_;
- return @$_ if defined() && UNIVERSAL::isa($_, 'ARRAY');
+ return @$_ if defined() && ref() eq 'ARRAY';
my @argv;
return @argv unless defined() && length();
@@ -1,13 +1,12 @@
package Module::Build::Platform::aix;
use strict;
-use vars qw($VERSION);
-$VERSION = '0.4206';
+use warnings;
+our $VERSION = '0.4210';
$VERSION = eval $VERSION;
use Module::Build::Platform::Unix;
-use vars qw(@ISA);
-@ISA = qw(Module::Build::Platform::Unix);
+our @ISA = qw(Module::Build::Platform::Unix);
# This class isn't necessary anymore, but we can't delete it, because
# some people might still have the old copy in their @INC, containing
@@ -1,13 +1,12 @@
package Module::Build::Platform::cygwin;
use strict;
-use vars qw($VERSION);
-$VERSION = '0.4206';
+use warnings;
+our $VERSION = '0.4210';
$VERSION = eval $VERSION;
use Module::Build::Platform::Unix;
-use vars qw(@ISA);
-@ISA = qw(Module::Build::Platform::Unix);
+our @ISA = qw(Module::Build::Platform::Unix);
sub manpage_separator {
'.'
@@ -1,13 +1,12 @@
package Module::Build::Platform::darwin;
use strict;
-use vars qw($VERSION);
-$VERSION = '0.4206';
+use warnings;
+our $VERSION = '0.4210';
$VERSION = eval $VERSION;
use Module::Build::Platform::Unix;
-use vars qw(@ISA);
-@ISA = qw(Module::Build::Platform::Unix);
+our @ISA = qw(Module::Build::Platform::Unix);
# This class isn't necessary anymore, but we can't delete it, because
# some people might still have the old copy in their @INC, containing
@@ -1,13 +1,12 @@
package Module::Build::Platform::os2;
use strict;
-use vars qw($VERSION);
-$VERSION = '0.4206';
+use warnings;
+our $VERSION = '0.4210';
$VERSION = eval $VERSION;
use Module::Build::Platform::Unix;
-use vars qw(@ISA);
-@ISA = qw(Module::Build::Platform::Unix);
+our @ISA = qw(Module::Build::Platform::Unix);
sub manpage_separator { '.' }
@@ -1,17 +1,15 @@
package Module::Build::PodParser;
use strict;
-use vars qw($VERSION);
-$VERSION = '0.4206';
+use warnings;
+our $VERSION = '0.4210';
$VERSION = eval $VERSION;
-use vars qw(@ISA);
sub new {
# Perl is so fun.
my $package = shift;
my $self;
- @ISA = ();
$self = bless {have_pod_parser => 0, @_}, $package;
unless ($self->{fh}) {
@@ -1,21 +0,0 @@
-package Module::Build::Version;
-use strict;
-use vars qw($VERSION);
-$VERSION = '0.87'; ### XXX sync with version of version.pm below
-
-use version 0.87;
-our @ISA = qw(version);
-
-1;
-
-=head1 NAME
-
-Module::Build::Version - DEPRECATED
-
-=head1 DESCRIPTION
-
-Module::Build now lists L<version> as a C<configure_requires> dependency
-and no longer installs a copy.
-
-=cut
-
@@ -1,19 +0,0 @@
-package Module::Build::YAML;
-use strict;
-use CPAN::Meta::YAML 0.002 ();
-our @ISA = qw(CPAN::Meta::YAML);
-our $VERSION = '1.41';
-1;
-
-=head1 NAME
-
-Module::Build::YAML - DEPRECATED
-
-=head1 DESCRIPTION
-
-This module was originally an inline copy of L<YAML::Tiny>. It has been
-deprecated in favor of using L<CPAN::Meta::YAML> directly. This module is kept
-as a subclass wrapper for compatibility.
-
-=cut
-
@@ -8,7 +8,9 @@ use if $] >= 5.019, 'deprecate';
# OS-specific modules don't do anything either - most of the work is
# done in Module::Build::Base.
+use 5.006;
use strict;
+use warnings;
use File::Spec ();
use File::Path ();
use File::Basename ();
@@ -16,9 +18,8 @@ use Perl::OSType ();
use Module::Build::Base;
-use vars qw($VERSION @ISA);
-@ISA = qw(Module::Build::Base);
-$VERSION = '0.4206';
+our @ISA = qw(Module::Build::Base);
+our $VERSION = '0.4210';
$VERSION = eval $VERSION;
# Inserts the given module into the @ISA hierarchy between
@@ -2,9 +2,10 @@ package inc::latest::private;
use if $] >= 5.019, 'deprecate';
+use 5.006;
use strict;
-use vars qw($VERSION);
-$VERSION = '0.4206';
+use warnings;
+our $VERSION = '0.4210';
$VERSION = eval $VERSION;
use File::Spec;
@@ -2,9 +2,10 @@ package inc::latest;
use if $] >= 5.019, 'deprecate';
+use 5.006;
use strict;
-use vars qw($VERSION);
-$VERSION = '0.4206';
+use warnings;
+our $VERSION = '0.4210';
$VERSION = eval $VERSION;
use Carp;
@@ -50,9 +51,8 @@ sub write {
print {$fh} <<'HERE';
package inc::latest;
use strict;
-use vars '@ISA';
require inc::latest::private;
-@ISA = qw/inc::latest::private/;
+our @ISA = qw/inc::latest::private/;
HERE
if (@preload) {
print {$fh} "\npackage inc::latest::preload;\n";
@@ -25,7 +25,6 @@ if ( $Config{make} && $^O ne 'VMS' ? find_in_path($Config{make}) : 1 ) {
my $is_vms_mms = ($^O eq 'VMS') && ($Config{make} =~ /MM[SK]/i);
blib_load('Module::Build');
-blib_load('Module::Build::Version');
#########################
@@ -183,28 +183,28 @@ print "Hello, World!\n";
ok my $mb = Module::Build->new(
module_name => $dist->name,
license => 'perl',
- meta_add => {abstract => 'bar'},
+ meta_add => {keywords => ['bar']},
conflicts => {'Foo::Barxx' => 0},
);
my $data = $mb->get_metadata;
- is_deeply $data->{abstract}, 'bar';
+ is_deeply $data->{keywords}, ['bar'];
- $mb->meta_merge(abstract => 'baz');
+ $mb->meta_merge(keywords => ['baz']);
$data = $mb->get_metadata;
- is_deeply $data->{abstract}, 'baz';
+ is_deeply $data->{keywords}, [qw/bar baz/];
$mb->meta_merge(
'meta-spec' => { version => 2 },
prereqs => {
test => {
- requirements => {
+ requires => {
'Foo::Fooxx' => 0,
}
}
}
);
$data = $mb->get_metadata;
- is_deeply $data->{prereqs}{test}{requirements}, { 'Foo::Fooxx' => 0 };
+ is_deeply $data->{prereqs}{test}{requires}, { 'Foo::Fooxx' => 0 } or diag explain $mb->meta_merge;
}