@@ -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,8 +59,8 @@ my $build = Module::Build->new(
'Text::ParseWords' => 0,
'Getopt::Long' => 0,
'Test::Harness' => 0,
- 'CPAN::Meta' => '2.110420',
- 'Perl::OSType' => 1, # needs 1.0 API
+ 'CPAN::Meta' => '2.142060',
+ 'Perl::OSType' => ( $^O eq 'bitrig' ? 1.004 : 1 ), # needs 1.0 API
'version' => 0.87, # No longer requires M::B
'Module::Metadata' => 1.000002, # uses version.pm
'Pod::Man' => 2.17, # utf8 support
@@ -101,6 +107,7 @@ my $build = Module::Build->new(
inc_bundling_support => {
description => "Bundle Module::Build in inc/",
requires => {
+ 'inc::latest' => 0.500, # split out from Module::Build
'ExtUtils::Install' => 1.54, # also gets us ExtUtils::Installed 1.999_001
'ExtUtils::Installed' => 1.999, # technically 1.999_001 is what's available
},
@@ -120,7 +127,8 @@ my $build = Module::Build->new(
meta_merge => {
resources => {
MailingList => 'mailto:module-build@perl.org',
- repository => 'https://github.com/Perl-Toolchain-Gang/Module-Build'
+ repository => 'https://github.com/Perl-Toolchain-Gang/Module-Build',
+ IRC => 'irc://irc.perl.org/#toolchain',
}
},
);
@@ -1,5 +1,65 @@
Revision history for Perl extension Module::Build.
+0.4211 - Tue Jan 20 01:33:42 CET 2015
+
+ [BUG FIXES]
+
+ - Fix t/actions/installdeps.t to work on "perl in space" [Ed J]
+
+ - Stop using version->normal(); prefer stringify() [John Peacock]
+
+ [DEPRECATIONS]
+
+ - inc::latest has been split out to a separate distribution on CPAN.
+ It is an optional prerequisite, only needed for the experimental
+ bundling feature.
+
+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]
@@ -7,8 +7,6 @@ inc/MBVersion.pm
inc/Module/Metadata.pm
inc/Perl/OSType.pm
INSTALL
-lib/inc/latest.pm
-lib/inc/latest/private.pm
lib/Module/Build.pm
lib/Module/Build/API.pod
lib/Module/Build/Authoring.pod
@@ -18,7 +16,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 +29,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.4211",
"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,79 @@
"provides" : {
"Module::Build" : {
"file" : "lib/Module/Build.pm",
- "version" : "0.4206"
+ "version" : "0.4211"
},
"Module::Build::Base" : {
"file" : "lib/Module/Build/Base.pm",
- "version" : "0.4206"
+ "version" : "0.4211"
},
"Module::Build::Compat" : {
"file" : "lib/Module/Build/Compat.pm",
- "version" : "0.4206"
+ "version" : "0.4211"
},
"Module::Build::Config" : {
"file" : "lib/Module/Build/Config.pm",
- "version" : "0.4206"
+ "version" : "0.4211"
},
"Module::Build::Cookbook" : {
"file" : "lib/Module/Build/Cookbook.pm",
- "version" : "0.4206"
+ "version" : "0.4211"
},
"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.4211"
},
"Module::Build::Notes" : {
"file" : "lib/Module/Build/Notes.pm",
- "version" : "0.4206"
+ "version" : "0.4211"
},
"Module::Build::PPMMaker" : {
"file" : "lib/Module/Build/PPMMaker.pm",
- "version" : "0.4206"
+ "version" : "0.4211"
},
"Module::Build::Platform::Default" : {
"file" : "lib/Module/Build/Platform/Default.pm",
- "version" : "0.4206"
+ "version" : "0.4211"
},
"Module::Build::Platform::MacOS" : {
"file" : "lib/Module/Build/Platform/MacOS.pm",
- "version" : "0.4206"
+ "version" : "0.4211"
},
"Module::Build::Platform::Unix" : {
"file" : "lib/Module/Build/Platform/Unix.pm",
- "version" : "0.4206"
+ "version" : "0.4211"
},
"Module::Build::Platform::VMS" : {
"file" : "lib/Module/Build/Platform/VMS.pm",
- "version" : "0.4206"
+ "version" : "0.4211"
},
"Module::Build::Platform::VOS" : {
"file" : "lib/Module/Build/Platform/VOS.pm",
- "version" : "0.4206"
+ "version" : "0.4211"
},
"Module::Build::Platform::Windows" : {
"file" : "lib/Module/Build/Platform/Windows.pm",
- "version" : "0.4206"
+ "version" : "0.4211"
},
"Module::Build::Platform::aix" : {
"file" : "lib/Module/Build/Platform/aix.pm",
- "version" : "0.4206"
+ "version" : "0.4211"
},
"Module::Build::Platform::cygwin" : {
"file" : "lib/Module/Build/Platform/cygwin.pm",
- "version" : "0.4206"
+ "version" : "0.4211"
},
"Module::Build::Platform::darwin" : {
"file" : "lib/Module/Build/Platform/darwin.pm",
- "version" : "0.4206"
+ "version" : "0.4211"
},
"Module::Build::Platform::os2" : {
"file" : "lib/Module/Build/Platform/os2.pm",
- "version" : "0.4206"
+ "version" : "0.4211"
},
"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"
- },
- "inc::latest" : {
- "file" : "lib/inc/latest.pm",
- "version" : "0.4206"
- },
- "inc::latest::private" : {
- "file" : "lib/inc/latest/private.pm",
- "version" : "0.4206"
+ "version" : "0.4211"
}
},
"release_status" : "stable",
@@ -162,7 +150,8 @@
"repository" : {
"url" : "https://github.com/Perl-Toolchain-Gang/Module-Build"
},
- "x_mailingList" : "mailto:module-build@perl.org"
+ "x_IRC" : "irc://irc.perl.org/#toolchain",
+ "x_MailingList" : "mailto:module-build@perl.org"
},
- "version" : "0.4206"
+ "version" : "0.4211"
}
@@ -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.4211, CPAN::Meta::Converter version 2.142060'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -19,81 +24,66 @@ name: Module-Build
provides:
Module::Build:
file: lib/Module/Build.pm
- version: '0.4206'
+ version: '0.4211'
Module::Build::Base:
file: lib/Module/Build/Base.pm
- version: '0.4206'
+ version: '0.4211'
Module::Build::Compat:
file: lib/Module/Build/Compat.pm
- version: '0.4206'
+ version: '0.4211'
Module::Build::Config:
file: lib/Module/Build/Config.pm
- version: '0.4206'
+ version: '0.4211'
Module::Build::Cookbook:
file: lib/Module/Build/Cookbook.pm
- version: '0.4206'
+ version: '0.4211'
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.4211'
Module::Build::Notes:
file: lib/Module/Build/Notes.pm
- version: '0.4206'
+ version: '0.4211'
Module::Build::PPMMaker:
file: lib/Module/Build/PPMMaker.pm
- version: '0.4206'
+ version: '0.4211'
Module::Build::Platform::Default:
file: lib/Module/Build/Platform/Default.pm
- version: '0.4206'
+ version: '0.4211'
Module::Build::Platform::MacOS:
file: lib/Module/Build/Platform/MacOS.pm
- version: '0.4206'
+ version: '0.4211'
Module::Build::Platform::Unix:
file: lib/Module/Build/Platform/Unix.pm
- version: '0.4206'
+ version: '0.4211'
Module::Build::Platform::VMS:
file: lib/Module/Build/Platform/VMS.pm
- version: '0.4206'
+ version: '0.4211'
Module::Build::Platform::VOS:
file: lib/Module/Build/Platform/VOS.pm
- version: '0.4206'
+ version: '0.4211'
Module::Build::Platform::Windows:
file: lib/Module/Build/Platform/Windows.pm
- version: '0.4206'
+ version: '0.4211'
Module::Build::Platform::aix:
file: lib/Module/Build/Platform/aix.pm
- version: '0.4206'
+ version: '0.4211'
Module::Build::Platform::cygwin:
file: lib/Module/Build/Platform/cygwin.pm
- version: '0.4206'
+ version: '0.4211'
Module::Build::Platform::darwin:
file: lib/Module/Build/Platform/darwin.pm
- version: '0.4206'
+ version: '0.4211'
Module::Build::Platform::os2:
file: lib/Module/Build/Platform/os2.pm
- version: '0.4206'
+ version: '0.4211'
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'
- inc::latest:
- file: lib/inc/latest.pm
- version: '0.4206'
- inc::latest::private:
- file: lib/inc/latest/private.pm
- version: '0.4206'
+ version: '0.4211'
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 +104,11 @@ requires:
Test::Harness: '0'
Text::Abbrev: '0'
Text::ParseWords: '0'
- perl: '5.006001'
+ perl: '5.008000'
version: '0.87'
resources:
+ IRC: irc://irc.perl.org/#toolchain
+ 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.4211'
@@ -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.4211';
$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,9 +4581,8 @@ 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
- $version = $version->is_qv ? $version->normal : $version->stringify;
+ elsif ( ref $version eq 'version') { # version objects
+ $version = $version->stringify;
}
elsif ( $version =~ /^[^v][^.]*\.[^.]+\./ ) { # no leading v, multiple dots
# normalize string tuples without "v": "1.2.3" -> "v1.2.3"
@@ -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);
@@ -34,7 +34,7 @@ The "trick" to making this work for Module::Build is making sure the
highest version Module::Build is used, whether this is in C<inc/> or
already installed on the user's system. This ensures that all necessary
features are available as well as any new bug fixes. This is done using
-the new L<inc::latest> module.
+the experimental L<inc::latest> module, available on CPAN.
A "normal" Build.PL looks like this (with only the minimum required
fields):
@@ -1,15 +1,15 @@
package Module::Build::Compat;
use strict;
-use vars qw($VERSION);
-$VERSION = '0.4206';
+use warnings;
+our $VERSION = '0.4211';
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.4211';
$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.4211';
=head1 NAME
@@ -1,7 +1,7 @@
package Module::Build::Dumper;
use strict;
-use vars qw($VERSION);
-$VERSION = '0.4206';
+use warnings;
+our $VERSION = '0.4211';
# 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.4211';
$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.4211';
$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.4211';
$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.4211';
$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.4211';
$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.4211';
$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.4211';
$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.4211';
$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.4211';
$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.4211';
$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.4211';
$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.4211';
$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.4211';
$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.4211';
$VERSION = eval $VERSION;
# Inserts the given module into the @ISA hierarchy between
@@ -1,102 +0,0 @@
-package inc::latest::private;
-
-use if $] >= 5.019, 'deprecate';
-
-use strict;
-use vars qw($VERSION);
-$VERSION = '0.4206';
-$VERSION = eval $VERSION;
-
-use File::Spec;
-
-# must ultimately "goto" the import routine of the module to be loaded
-# so that the calling package is correct when $mod->import() runs.
-sub import {
- my ($package, $mod, @args) = @_;
- my $file = $package->_mod2path($mod);
-
- if ($INC{$file}) {
- # Already loaded, but let _load_module handle import args
- goto \&_load_module;
- }
-
- # A bundled copy must be present
- my ($bundled, $bundled_dir) = $package->_search_bundled($file)
- or die "No bundled copy of $mod found";
-
- my $from_inc = $package->_search_INC($file);
- unless ($from_inc) {
- # Only bundled is available
- unshift(@INC, $bundled_dir);
- goto \&_load_module;
- }
-
- if (_version($from_inc) >= _version($bundled)) {
- # Ignore the bundled copy
- goto \&_load_module;
- }
-
- # Load the bundled copy
- unshift(@INC, $bundled_dir);
- goto \&_load_module;
-}
-
-sub _version {
- require ExtUtils::MakeMaker;
- return ExtUtils::MM->parse_version(shift);
-}
-
-# use "goto" for import to preserve caller
-sub _load_module {
- my $package = shift; # remaining @_ is ready for goto
- my ($mod, @args) = @_;
- eval "require $mod; 1" or die $@;
- if ( my $import = $mod->can('import') ) {
- goto $import;
- }
- return 1;
-}
-
-sub _search_bundled {
- my ($self, $file) = @_;
-
- my $mypath = 'inc';
-
- opendir my $DH, $mypath or die "Can't open directory $mypath: $!";
-
- while (defined(my $e = readdir $DH)) {
- next unless $e =~ /^inc_/;
- my $try = File::Spec->catfile($mypath, $e, $file);
-
- return($try, File::Spec->catdir($mypath, $e)) if -e $try;
- }
- return;
-}
-
-# Look for the given path in @INC.
-sub _search_INC {
- # TODO: doesn't handle coderefs or arrayrefs or objects in @INC, but
- # it probably should
- my ($self, $file) = @_;
-
- foreach my $dir (@INC) {
- next if ref $dir;
- my $try = File::Spec->catfile($dir, $file);
- return $try if -e $try;
- }
-
- return;
-}
-
-# Translate a module name into a directory/file.pm to search for in @INC
-sub _mod2path {
- my ($self, $mod) = @_;
- my @parts = split /::/, $mod;
- $parts[-1] .= '.pm';
- return $parts[0] if @parts == 1;
- return File::Spec->catfile(@parts);
-}
-
-1;
-
-
@@ -1,248 +0,0 @@
-package inc::latest;
-
-use if $] >= 5.019, 'deprecate';
-
-use strict;
-use vars qw($VERSION);
-$VERSION = '0.4206';
-$VERSION = eval $VERSION;
-
-use Carp;
-use File::Basename ();
-use File::Spec ();
-use File::Path ();
-use File::Copy ();
-
-# track and return modules loaded by inc::latest
-my @loaded_modules;
-sub loaded_modules {@loaded_modules}
-
-# must ultimately "goto" the import routine of the module to be loaded
-# so that the calling package is correct when $mod->import() runs.
-sub import {
- my ($package, $mod, @args) = @_;
- return unless(defined $mod);
-
- my $private_path = 'inc/latest/private.pm';
- if(-e $private_path) {
- # user mode - delegate work to bundled private module
- require $private_path;
- splice( @_, 0, 1, 'inc::latest::private');
- goto \&inc::latest::private::import;
- }
-
- # author mode - just record and load the modules
- push(@loaded_modules, $mod);
- require inc::latest::private;
- goto \&inc::latest::private::_load_module;
-}
-
-sub write {
- my $package = shift;
- my ($where, @preload) = @_;
-
- warn "should really be writing in inc/" unless $where =~ /inc$/;
-
- # write inc/latest.pm
- File::Path::mkpath( $where );
- open my $fh, '>', File::Spec->catfile($where,'latest.pm');
- print {$fh} "# This stub created by inc::latest $VERSION\n";
- print {$fh} <<'HERE';
-package inc::latest;
-use strict;
-use vars '@ISA';
-require inc::latest::private;
-@ISA = qw/inc::latest::private/;
-HERE
- if (@preload) {
- print {$fh} "\npackage inc::latest::preload;\n";
- for my $mod (@preload) {
- print {$fh} "inc::latest->import('$mod');\n";
- }
- }
- print {$fh} "\n1;\n";
- close $fh;
-
- # write inc/latest/private;
- require inc::latest::private;
- File::Path::mkpath( File::Spec->catdir( $where, 'latest' ) );
- my $from = $INC{'inc/latest/private.pm'};
- my $to = File::Spec->catfile($where,'latest','private.pm');
- File::Copy::copy( $from, $to ) or die "Couldn't copy '$from' to '$to': $!";
-
- return 1;
-}
-
-sub bundle_module {
- my ($package, $module, $where) = @_;
-
- # create inc/inc_$foo
- (my $dist = $module) =~ s{::}{-}g;
- my $inc_lib = File::Spec->catdir($where,"inc_$dist");
- File::Path::mkpath $inc_lib;
-
- # get list of files to copy
- require ExtUtils::Installed;
- # workaround buggy EU::Installed check of @INC
- my $inst = ExtUtils::Installed->new(extra_libs => [@INC]);
- my $packlist = $inst->packlist( $module ) or die "Couldn't find packlist";
- my @files = grep { /\.pm$/ } keys %$packlist;
-
-
- # figure out prefix
- my $mod_path = quotemeta $package->_mod2path( $module );
- my ($prefix) = grep { /$mod_path$/ } @files;
- $prefix =~ s{$mod_path$}{};
-
- # copy files
- for my $from ( @files ) {
- next unless $from =~ /\.pm$/;
- (my $mod_path = $from) =~ s{^\Q$prefix\E}{};
- my $to = File::Spec->catfile( $inc_lib, $mod_path );
- File::Path::mkpath(File::Basename::dirname($to));
- File::Copy::copy( $from, $to ) or die "Couldn't copy '$from' to '$to': $!";
- }
- return 1;
-}
-
-# Translate a module name into a directory/file.pm to search for in @INC
-sub _mod2path {
- my ($self, $mod) = @_;
- my @parts = split /::/, $mod;
- $parts[-1] .= '.pm';
- return $parts[0] if @parts == 1;
- return File::Spec->catfile(@parts);
-}
-
-1;
-
-
-=head1 NAME
-
-inc::latest - use modules bundled in inc/ if they are newer than installed ones
-
-=head1 SYNOPSIS
-
- # in Build.PL
- use inc::latest 'Module::Build';
-
-=head1 DESCRIPTION
-
-The C<inc::latest> module helps bootstrap configure-time dependencies for CPAN
-distributions. These dependencies get bundled into the C<inc> directory within
-a distribution and are used by Build.PL (or Makefile.PL).
-
-Arguments to C<inc::latest> are module names that are checked against both the
-current C<@INC> array and against specially-named directories in C<inc>. If
-the bundled version is newer than the installed one (or the module isn't
-installed, then, the bundled directory is added to the start of <@INC> and the
-module is loaded from there.
-
-There are actually two variations of C<inc::latest> -- one for authors and one
-for the C<inc> directory. For distribution authors, the C<inc::latest>
-installed in the system will record modules loaded via C<inc::latest> and can
-be used to create the bundled files in C<inc>, including writing the second
-variation as C<inc/latest.pm>.
-
-This second C<inc::latest> is the one that is loaded in a distribution being
-installed (e.g. from Build.PL). This bundled C<inc::latest> is the one
-that determines which module to load.
-
-=head2 Special notes on bundling
-
-The C<inc::latest> module creates bundled directories based on the packlist
-file of an installed distribution. Even though C<inc::latest> takes module
-name arguments, it is better to think of it as bundling and making available
-entire I<distributions>. When a module is loaded through C<inc::latest>,
-it looks in all bundled distributions in C<inc/> for a newer module than
-can be found in the existing C<@INC> array.
-
-Thus, the module-name provided should usually be the "top-level" module name of
-a distribution, though this is not strictly required. For example,
-L<Module::Build> has a number of heuristics to map module names to packlists,
-allowing users to do things like this:
-
- use inc::latest 'Devel::AssertOS::Unix';
-
-even though Devel::AssertOS::Unix is contained within the Devel-CheckOS
-distribution.
-
-At the current time, packlists are required. Thus, bundling dual-core modules
-may require a 'forced install' over versions in the latest version of perl
-in order to create the necessary packlist for bundling.
-
-=head1 USAGE
-
-When calling C<use>, the bundled C<inc::latest> takes a single module name and
-optional arguments to pass to that module's own import method.
-
- use 'inc::latest' 'Foo::Bar' qw/foo bar baz/;
-
-=head2 Author-mode
-
-You are in author-mode inc::latest if any of the Author-mode methods are
-available. For example:
-
- if ( inc::latest->can('write') ) {
- inc::latest->write('inc');
- }
-
-=over 4
-
-=item loaded_modules()
-
- my @list = inc::latest->loaded_modules;
-
-This takes no arguments and always returns a list of module names requested for
-loading via "use inc::latest 'MODULE'", regardless of whether the load was
-successful or not.
-
-=item write()
-
- inc::latest->write( 'inc' );
-
-This writes the bundled version of inc::latest to the directory name given as an
-argument. It almost all cases, it should be 'C<inc>'.
-
-=item bundle_module()
-
- for my $mod ( inc::latest->loaded_modules ) {
- inc::latest->bundle_module($mod, $dir);
- }
-
-If $mod corresponds to a packlist, then this function creates a specially-named
-directory in $dir and copies all .pm files from the modlist to the new
-directory (which almost always should just be 'inc'). For example, if Foo::Bar
-is the name of the module, and $dir is 'inc', then the directory would be
-'inc/inc_Foo-Bar' and contain files like this:
-
- inc/inc_Foo-Bar/Foo/Bar.pm
-
-Currently, $mod B<must> have a packlist. If this is not the case (e.g. for a
-dual-core module), then the bundling will fail. You may be able to create a
-packlist by forced installing the module on top of the version that came with
-core Perl.
-
-=back
-
-=head2 As bundled in inc/
-
-All methods are private. Only the C<import> method is public.
-
-=head1 AUTHOR
-
-Eric Wilhelm <ewilhelm@cpan.org>, David Golden <dagolden@cpan.org>
-
-=head1 COPYRIGHT
-
-Copyright (c) 2009 by Eric Wilhelm and David Golden
-
-This library is free software; you can redistribute it and/or
-modify it under the same terms as Perl itself.
-
-=head1 SEE ALSO
-
-L<Module::Build>
-
-=cut
-
@@ -20,14 +20,14 @@ $dist->change_build_pl(
build_requires => {
'Getopt::Long' => 9998,
},
- cpan_client => $^X . ' -le print($_)for($^X,@ARGV)',
+ cpan_client => qq{"$^X"} . ' -le print($_)for($^X,@ARGV)',
)->regen;
# get a Module::Build object and test with it
my $mb;
stdout_stderr_of( sub { $mb = $dist->new_from_context('verbose' => 1) } );
isa_ok( $mb, "Module::Build" );
-like( $mb->cpan_client, qr/^\Q$^X\E/, "cpan_client is mocked with perl" );
+like( $mb->cpan_client, qr/^"\Q$^X\E"/, "cpan_client is mocked with perl" );
my $retval;
my $out = stdout_of( sub {
@@ -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;
}