summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build
diff options
context:
space:
mode:
authorafresh1 <afresh1@openbsd.org>2014-11-17 20:52:31 +0000
committerafresh1 <afresh1@openbsd.org>2014-11-17 20:52:31 +0000
commit6fb12b7054efc6b436584db6cef9c2f85c0d7e27 (patch)
treeaa09a524574ec7ae2f521a24573deeecb78ff66a /gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build
parentAdd the Cammelia cipher to libcrypto. (diff)
downloadwireguard-openbsd-6fb12b7054efc6b436584db6cef9c2f85c0d7e27.tar.xz
wireguard-openbsd-6fb12b7054efc6b436584db6cef9c2f85c0d7e27.zip
Import perl-5.20.1
Diffstat (limited to 'gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build')
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/API.pod40
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Authoring.pod6
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Base.pm565
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Compat.pm7
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Config.pm2
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/ConfigData.pm64
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Cookbook.pm2
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Dumper.pm2
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Notes.pm20
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/PPMMaker.pm10
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Default.pm2
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/MacOS.pm2
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Unix.pm6
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/VMS.pm47
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/VOS.pm2
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Windows.pm13
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/aix.pm2
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/cygwin.pm2
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/darwin.pm2
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/os2.pm2
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/PodParser.pm6
21 files changed, 413 insertions, 391 deletions
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/API.pod b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/API.pod
index 4980218dac7..af859e7fe40 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/API.pod
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/API.pod
@@ -72,6 +72,13 @@ An array reference of files to be cleaned up when the C<clean> action
is performed. See also the L<add_to_cleanup()|/"add_to_cleanup(@files)">
method.
+=item allow_pureperl
+
+[version 0.4005]
+
+A bool indicating the module is still functional without its xs parts.
+When an XS module is build with --pureperl_only, it will otherwise fail.
+
=item auto_configure_requires
[version 0.34]
@@ -175,6 +182,15 @@ See L</auto_configure_requires> for details.
See the documentation for L<Module::Build::Authoring/"PREREQUISITES">
for the details of how requirements can be specified.
+=item test_requires
+
+[version 0.4004]
+
+Modules listed in this section must be installed before testing the distribution.
+
+See the documentation for L<Module::Build::Authoring/"PREREQUISITES">
+for the details of how requirements can be specified.
+
=item create_packlist
[version 0.28]
@@ -379,6 +395,14 @@ To link your XS code against glib you might write something like:
extra_linker_flags => scalar `glib-config --libs`,
);
+=item extra_manify_args
+
+[version 0.4006]
+
+Any extra arguments to pass to C<< Pod::Man->new() >> when building
+man pages. One common choice might be C<< utf8 => 1 >> to get Unicode
+support.
+
=item get_options
[version 0.26]
@@ -1066,7 +1090,7 @@ This method is the preferred interface for retrieving the arguments passed via
command line options to F<Build.PL> or F<Build>, minus the Module-Build
specific options.
-When called in in a scalar context with no arguments, this method returns a
+When called in a scalar context with no arguments, this method returns a
reference to the hash storing all of the arguments; in an array context, it
returns the hash itself. When passed a single argument, it returns the value
stored in the args hash for that option key. When called with two arguments,
@@ -1753,7 +1777,7 @@ Examples:
Returns a reference to a hash describing all prerequisites. The keys of the
hash will be the various prerequisite types ('requires', 'build_requires',
-'configure_requires', 'recommends', or 'conflicts') and the values will be
+'test_requires', 'configure_requires', 'recommends', or 'conflicts') and the values will be
references to hashes of module names and version numbers. Only prerequisites
types that are defined will be included. The C<prereq_data> action is just a
thin wrapper around the C<prereq_data()> method and dumps the hash as a string
@@ -1916,6 +1940,8 @@ accessor methods for the following properties:
=item allow_mb_mismatch()
+=item allow_pureperl()
+
=item auto_configure_requires()
=item autosplit()
@@ -1966,6 +1992,8 @@ accessor methods for the following properties:
=item dynamic_config()
+=item extra_manify_args()
+
=item get_options()
=item html_css()
@@ -2016,6 +2044,8 @@ accessor methods for the following properties:
=item program_name()
+=item pureperl_only()
+
=item quiet()
=item recommends()
@@ -2034,6 +2064,8 @@ accessor methods for the following properties:
=item test_file_exts()
+=item test_requires()
+
=item use_rcfile()
=item use_tap_harness()
@@ -2049,7 +2081,7 @@ accessor methods for the following properties:
If you would like to add other useful metadata, C<Module::Build>
supports this with the C<meta_add> and C<meta_merge> arguments to
L</new()>. The authoritative list of supported metadata can be found at
-L<CPAN::META::Spec> but for convenience - here are a few of the more useful ones:
+L<CPAN::Meta::Spec> but for convenience - here are a few of the more useful ones:
=over 4
@@ -2087,6 +2119,6 @@ perl(1), L<Module::Build>(3), L<Module::Build::Authoring>(3),
L<Module::Build::Cookbook>(3), L<ExtUtils::MakeMaker>(3)
F<META.yml> Specification:
-L<CPAN::META::Spec>
+L<CPAN::Meta::Spec>
=cut
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Authoring.pod b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Authoring.pod
index b1dc5843bfb..a32b31e2e1e 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Authoring.pod
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Authoring.pod
@@ -183,6 +183,10 @@ ways to use this distribution without having them installed. You
might also think of this as "can use" or "is aware of" or "changes
behavior in the presence of".
+=item test_requires
+
+Items that are necessary for testing.
+
=item conflicts
Items that can cause problems with this distribution when installed.
@@ -313,7 +317,7 @@ perl(1), L<Module::Build>(3), L<Module::Build::API>(3),
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 --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Base.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Base.pm
index cf42cc0b230..84e137fb4f2 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Base.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Base.pm
@@ -6,7 +6,7 @@ use strict;
use vars qw($VERSION);
use warnings;
-$VERSION = '0.4003';
+$VERSION = '0.4205';
$VERSION = eval $VERSION;
BEGIN { require 5.006001 }
@@ -19,7 +19,6 @@ use File::Basename ();
use File::Spec 0.82 ();
use File::Compare ();
use Module::Build::Dumper ();
-use IO::File ();
use Text::ParseWords ();
use Module::Build::ModuleInfo;
@@ -757,17 +756,11 @@ sub ACTION_config_data {
}
sub array_properties {
- for (shift->_mb_classes) {
- return @{$additive_properties{$_}->{ARRAY}}
- if exists $additive_properties{$_}->{ARRAY};
- }
+ map { exists $additive_properties{$_}->{ARRAY} ? @{$additive_properties{$_}->{ARRAY}} : () } shift->_mb_classes;
}
sub hash_properties {
- for (shift->_mb_classes) {
- return @{$additive_properties{$_}->{'HASH'}}
- if exists $additive_properties{$_}->{'HASH'};
- }
+ map { exists $additive_properties{$_}->{HASH} ? @{$additive_properties{$_}->{HASH}} : () } shift->_mb_classes;
}
sub add_property {
@@ -798,10 +791,10 @@ sub ACTION_config_data {
return $class;
}
- sub property_error {
- my $self = shift;
- die 'ERROR: ', @_;
- }
+ sub property_error {
+ my $self = shift;
+ die 'ERROR: ', @_;
+ }
sub _set_defaults {
my $self = shift;
@@ -831,7 +824,7 @@ sub ACTION_config_data {
}
}
-} # end closure
+} # end enclosure
########################################################################
sub _make_hash_accessor {
my ($property, $p) = @_;
@@ -922,6 +915,8 @@ __PACKAGE__->add_property(test_file_exts => ['.t']);
__PACKAGE__->add_property(use_tap_harness => 0);
__PACKAGE__->add_property(cpan_client => 'cpan');
__PACKAGE__->add_property(tap_harness_args => {});
+__PACKAGE__->add_property(pureperl_only => 0);
+__PACKAGE__->add_property(allow_pureperl => 0);
__PACKAGE__->add_property(
'installdirs',
default => 'site',
@@ -942,7 +937,7 @@ __PACKAGE__->add_property(
}
{
- my @prereq_action_types = qw(requires build_requires conflicts recommends);
+ my @prereq_action_types = qw(requires build_requires test_requires conflicts recommends);
foreach my $type (@prereq_action_types) {
__PACKAGE__->add_property($type => {});
}
@@ -1005,6 +1000,7 @@ __PACKAGE__->add_property($_) for qw(
verbose
debug
xs_files
+ extra_manify_args
);
sub config {
@@ -1080,7 +1076,7 @@ sub subclass {
File::Path::mkpath($filedir);
die "Can't create directory $filedir: $!" unless -d $filedir;
- my $fh = IO::File->new("> $filename") or die "Can't create $filename: $!";
+ open(my $fh, '>', $filename) or die "Can't create $filename: $!";
print $fh <<EOF;
package $opts{class};
use $pack;
@@ -1127,83 +1123,90 @@ END_WARN
sub dist_name {
my $self = shift;
my $p = $self->{properties};
- return $p->{dist_name} if defined $p->{dist_name};
+ my $me = 'dist_name';
+ return $p->{$me} if defined $p->{$me};
die "Can't determine distribution name, must supply either 'dist_name' or 'module_name' parameter"
unless $self->module_name;
- ($p->{dist_name} = $self->module_name) =~ s/::/-/g;
+ ($p->{$me} = $self->module_name) =~ s/::/-/g;
- return $p->{dist_name};
+ return $p->{$me};
}
sub release_status {
my ($self) = @_;
+ my $me = 'release_status';
my $p = $self->{properties};
- if ( ! defined $p->{release_status} ) {
- $p->{release_status} = $self->_is_dev_version ? 'testing' : 'stable';
+ if ( ! defined $p->{$me} ) {
+ $p->{$me} = $self->_is_dev_version ? 'testing' : 'stable';
}
- unless ( $p->{release_status} =~ qr/\A(?:stable|testing|unstable)\z/ ) {
- die "Illegal value '$p->{release_status}' for release_status\n";
+ unless ( $p->{$me} =~ qr/\A(?:stable|testing|unstable)\z/ ) {
+ die "Illegal value '$p->{$me}' for $me\n";
}
- if ( $p->{release_status} eq 'stable' && $self->_is_dev_version ) {
+ if ( $p->{$me} eq 'stable' && $self->_is_dev_version ) {
my $version = $self->dist_version;
- die "Illegal value '$p->{release_status}' with version '$version'\n";
+ die "Illegal value '$p->{$me}' with version '$version'\n";
}
- return $p->{release_status};
+ return $p->{$me};
}
sub dist_suffix {
my ($self) = @_;
my $p = $self->{properties};
- return $p->{dist_suffix} if defined $p->{dist_suffix};
+ my $me = 'dist_suffix';
+
+ return $p->{$me} if defined $p->{$me};
if ( $self->release_status eq 'stable' ) {
- $p->{dist_suffix} = "";
+ $p->{$me} = "";
}
else {
# non-stable release but non-dev version number needs '-TRIAL' appended
- $p->{dist_suffix} = $self->_is_dev_version ? "" : "TRIAL" ;
+ $p->{$me} = $self->_is_dev_version ? "" : "TRIAL" ;
}
- return $p->{dist_suffix};
+ return $p->{$me};
}
sub dist_version_from {
my ($self) = @_;
my $p = $self->{properties};
+ my $me = 'dist_version_from';
+
if ($self->module_name) {
- $p->{dist_version_from} ||=
+ $p->{$me} ||=
join( '/', 'lib', split(/::/, $self->module_name) ) . '.pm';
}
- return $p->{dist_version_from} || undef;
+ return $p->{$me} || undef;
}
sub dist_version {
my ($self) = @_;
my $p = $self->{properties};
+ my $me = 'dist_version';
- return $p->{dist_version} if defined $p->{dist_version};
+ return $p->{$me} if defined $p->{$me};
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 )
or die "Can't find file $version_from to determine version";
- #$p->{dist_version} is undef here
- $p->{dist_version} = $self->normalize_version( $pm_info->version() );
- unless (defined $p->{dist_version}) {
+ #$p->{$me} is undef here
+ $p->{$me} = $self->normalize_version( $pm_info->version() );
+ unless (defined $p->{$me}) {
die "Can't determine distribution version from $version_from";
}
}
die ("Can't determine distribution version, must supply either 'dist_version',\n".
"'dist_version_from', or 'module_name' parameter")
- unless defined $p->{dist_version};
+ unless defined $p->{$me};
- return $p->{dist_version};
+ return $p->{$me};
}
sub _is_dev_version {
@@ -1227,7 +1230,7 @@ sub _pod_parse {
my $docfile = $self->_main_docfile
or return;
- my $fh = IO::File->new($docfile)
+ open(my $fh, '<', $docfile)
or return;
require Module::Build::PodParser;
@@ -1287,13 +1290,13 @@ sub read_config {
my $file = $self->config_file('build_params')
or die "Can't find 'build_params' in " . $self->config_dir;
- my $fh = IO::File->new($file) or die "Can't read '$file': $!";
+ open(my $fh, '<', $file) or die "Can't read '$file': $!";
my $ref = eval do {local $/; <$fh>};
die if $@;
+ close $fh;
my $c;
($self->{args}, $c, $self->{properties}) = @$ref;
$self->{config} = Module::Build::Config->new(values => $c);
- close $fh;
}
sub has_config_data {
@@ -1305,13 +1308,14 @@ sub _write_data {
my ($self, $filename, $data) = @_;
my $file = $self->config_file($filename);
- my $fh = IO::File->new("> $file") or die "Can't create '$file': $!";
+ open(my $fh, '>', $file) or die "Can't create '$file': $!";
unless (ref($data)) { # e.g. magicnum
print $fh $data;
return;
}
print {$fh} Module::Build::Dumper->_data_dump($data);
+ close $fh;
}
sub write_config {
@@ -1509,7 +1513,7 @@ sub auto_require {
my ($self) = @_;
my $p = $self->{properties};
- # If needs_compiler is not explictly set, automatically set it
+ # If needs_compiler is not explicitly set, automatically set it
# If set, we need ExtUtils::CBuilder (and a compiler)
my $xs_files = $self->find_xs_files;
if ( ! defined $p->{needs_compiler} ) {
@@ -1812,7 +1816,7 @@ sub print_build_script {
my @myINC = $self->_added_to_INC;
for (@myINC, values %q) {
- $_ = File::Spec->canonpath( $_ );
+ $_ = File::Spec->canonpath( $_ ) unless $self->is_vmsish;
s/([\\\'])/\\$1/g;
}
@@ -1830,10 +1834,10 @@ use File::Spec;
sub magic_number_matches {
return 0 unless -e '$q{magic_numfile}';
- local *FH;
- open FH, '$q{magic_numfile}' or return 0;
- my \$filenum = <FH>;
- close FH;
+ my \$FH;
+ open \$FH, '<','$q{magic_numfile}' or return 0;
+ my \$filenum = <\$FH>;
+ close \$FH;
return \$filenum == $magic_number;
}
@@ -1886,8 +1890,8 @@ sub create_mymeta {
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 ) {
@@ -1900,52 +1904,29 @@ sub create_mymeta {
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}{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;
@@ -1969,7 +1950,7 @@ sub create_build_script {
$self->log_info("Creating new '$build_script' script for ",
"'$dist_name' version '$dist_version'\n");
- my $fh = IO::File->new(">$build_script") or die "Can't create '$build_script': $!";
+ open(my $fh, '>', $build_script) or die "Can't create '$build_script': $!";
$self->print_build_script($fh);
close $fh;
@@ -2119,6 +2100,8 @@ sub _translate_option {
use_tap_harness
tap_harness_args
cpan_client
+ pureperl_only
+ allow_pureperl
); # normalize only selected option names
return $opt;
@@ -2159,6 +2142,8 @@ sub _optional_arg {
debug
sign
use_tap_harness
+ pureperl_only
+ allow_pureperl
);
# inverted boolean options; eg --noverbose or --no-verbose
@@ -2333,7 +2318,7 @@ sub read_modulebuildrc {
return () unless $modulebuildrc;
}
- my $fh = IO::File->new( $modulebuildrc )
+ open(my $fh, '<', $modulebuildrc )
or die "Can't open $modulebuildrc: $!";
my %options; my $buffer = '';
@@ -2454,7 +2439,7 @@ sub get_action_docs {
(my $file = $class) =~ s{::}{/}g;
# NOTE: silently skipping relative paths if any chdir() happened
$file = $INC{$file . '.pm'} or next;
- my $fh = IO::File->new("< $file") or next;
+ open(my $fh, '<', $file) or next;
$files_found++;
# Code below modified from /usr/bin/perldoc
@@ -2593,8 +2578,8 @@ sub ACTION_help {
print <<EOF;
- Usage: $0 <action> arg1=value arg2=value ...
- Example: $0 test verbose=1
+ Usage: $0 <action> --arg1=value --arg2=value ...
+ Example: $0 test --verbose=1
Actions defined:
EOF
@@ -2751,26 +2736,9 @@ sub run_tap_harness {
sub run_test_harness {
my ($self, $tests) = @_;
require Test::Harness;
- my $p = $self->{properties};
- my @harness_switches = $self->harness_switches;
- # 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::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 length $Test::Harness::Switches;
- delete $ENV{HARNESS_PERL_SWITCHES} unless length $ENV{HARNESS_PERL_SWITCHES};
-
- local ($Test::Harness::verbose,
- $Test::Harness::Verbose,
- $ENV{TEST_VERBOSE},
- $ENV{HARNESS_VERBOSE}) = ($p->{verbose} || 0) x 4;
+ local $Test::Harness::verbose = $self->verbose || 0;
+ local $Test::Harness::switches = join ' ', $self->harness_switches;
Test::Harness::runtests(@$tests);
}
@@ -2968,7 +2936,9 @@ sub process_PL_files {
sub process_xs_files {
my $self = shift;
+ return if $self->pureperl_only && $self->allow_pureperl;
my $files = $self->find_xs_files;
+ croak 'Can\'t build xs files under --pureperl-only' if %$files && $self->pureperl_only;
while (my ($from, $to) = each %$files) {
unless ($from eq $to) {
$self->add_to_cleanup($to);
@@ -3095,10 +3065,10 @@ sub fix_shebang_line { # Adapted from fixin() in ExtUtils::MM_Unix 1.35
my ($does_shbang) = $c->get('sharpbang') =~ /^\s*\#\!/;
for my $file (@files) {
- my $FIXIN = IO::File->new($file) or die "Can't process '$file': $!";
+ open(my $FIXIN, '<', $file) or die "Can't process '$file': $!";
local $/ = "\n";
chomp(my $line = <$FIXIN>);
- next unless $line =~ s/^\s*\#!\s*//; # Not a shbang file.
+ next unless $line =~ s/^\s*\#!\s*//; # Not a shebang file.
my ($cmd, $arg) = (split(' ', $line, 2), '');
next unless $cmd =~ /perl/i;
@@ -3115,7 +3085,7 @@ eval 'exec $interpreter $arg -S \$0 \${1+"\$\@"}'
if 0; # not running under some shell
} unless $self->is_windowsish; # this won't work on win32, so don't
- my $FIXOUT = IO::File->new(">$file.new")
+ open(my $FIXOUT, '>', "$file.new")
or die "Can't create new $file: $!\n";
# Print out the new #! line (or equivalent).
@@ -3228,6 +3198,8 @@ sub ACTION_manpages {
$self->depends_on('code');
+ my %extra_manify_args = $self->{properties}{'extra_manify_args'} ? %{ $self->{properties}{'extra_manify_args'} } : ();
+
foreach my $type ( qw(bin lib) ) {
next unless ( $self->invoked_action eq 'manpages' || $self->_is_default_installable("${type}doc"));
my $files = $self->_find_pods( $self->{properties}{"${type}doc_dirs"},
@@ -3235,12 +3207,13 @@ sub ACTION_manpages {
next unless %$files;
my $sub = $self->can("manify_${type}_pods");
- $self->$sub() if defined( $sub );
+ $self->$sub( %extra_manify_args ) if defined( $sub );
}
}
sub manify_bin_pods {
my $self = shift;
+ my %podman_args = (section => 1, @_); # binaries go in section 1
my $files = $self->_find_pods( $self->{properties}{bindoc_dirs},
exclude => [ $self->file_qr('\.bat$') ] );
@@ -3253,7 +3226,7 @@ sub manify_bin_pods {
foreach my $file (keys %$files) {
# Pod::Simple based parsers only support one document per instance.
# This is expected to change in a future version (Pod::Simple > 3.03).
- my $parser = Pod::Man->new( section => 1 ); # binaries go in section 1
+ my $parser = Pod::Man->new( %podman_args );
my $manpage = $self->man1page_name( $file ) . '.' .
$self->config( 'man1ext' );
my $outfile = File::Spec->catfile($mandir, $manpage);
@@ -3267,6 +3240,7 @@ sub manify_bin_pods {
sub manify_lib_pods {
my $self = shift;
+ my %podman_args = (section => 3, @_); # libraries go in section 3
my $files = $self->_find_pods($self->{properties}{libdoc_dirs});
return unless keys %$files;
@@ -3278,7 +3252,7 @@ sub manify_lib_pods {
while (my ($file, $relfile) = each %$files) {
# Pod::Simple based parsers only support one document per instance.
# This is expected to change in a future version (Pod::Simple > 3.03).
- my $parser = Pod::Man->new( section => 3 ); # libraries go in section 3
+ my $parser = Pod::Man->new( %podman_args );
my $manpage = $self->man3page_name( $relfile ) . '.' .
$self->config( 'man3ext' );
my $outfile = File::Spec->catfile( $mandir, $manpage);
@@ -3301,6 +3275,7 @@ sub _find_pods {
foreach my $regexp ( @{ $args{exclude} } ) {
next FILE if $file =~ $regexp;
}
+ $file = $self->localize_file_path($file);
$files{$file} = File::Spec->abs2rel($file, $dir) if $self->contains_pod( $file )
}
}
@@ -3311,7 +3286,7 @@ sub contains_pod {
my ($self, $file) = @_;
return '' unless -T $file; # Only look at text files
- my $fh = IO::File->new( $file ) or die "Can't open $file: $!";
+ open(my $fh, '<', $file ) or die "Can't open $file: $!";
while (my $line = <$fh>) {
return 1 if $line =~ /^\=(?:head|pod|item)/;
}
@@ -3358,15 +3333,18 @@ sub htmlify_pods {
: $self->original_prefix('core');
my $htmlroot = $self->install_sets('core')->{libhtml};
- my @podpath = (map { File::Spec->abs2rel($_ ,$podroot) } grep { -d }
- ( $self->install_sets('core', 'lib'), # lib
- $self->install_sets('core', 'bin'), # bin
- $self->install_sets('site', 'lib'), # site/lib
- ) ), File::Spec->rel2abs($self->blib);
+ my $podpath;
+ unless (defined $self->args('html_links') and !$self->args('html_links')) {
+ my @podpath = ( (map { File::Spec->abs2rel($_ ,$podroot) } grep { -d }
+ ( $self->install_sets('core', 'lib'), # lib
+ $self->install_sets('core', 'bin'), # bin
+ $self->install_sets('site', 'lib'), # site/lib
+ ) ), File::Spec->rel2abs($self->blib) );
- my $podpath = $ENV{PERL_CORE}
- ? File::Spec->catdir($podroot, 'lib')
- : join(":", map { tr,:\\,|/,; $_ } @podpath);
+ $podpath = $ENV{PERL_CORE}
+ ? File::Spec->catdir($podroot, 'lib')
+ : join(":", map { tr,:\\,|/,; $_ } @podpath);
+ }
my $blibdir = join('/', File::Spec->splitdir(
(File::Spec->splitpath(File::Spec->rel2abs($htmldir),1))[1]),''
@@ -3416,7 +3394,7 @@ sub htmlify_pods {
my $depth = @rootdirs + @dirs;
my %opts = ( infile => $infile,
outfile => $tmpfile,
- podpath => $podpath,
+ ( defined($podpath) ? (podpath => $podpath) : ()),
podroot => $podroot,
index => 1,
depth => $depth,
@@ -3427,8 +3405,8 @@ sub htmlify_pods {
} or $self->log_warn("[$htmltool] pod2html (" .
join(", ", map { "q{$_} => q{$opts{$_}}" } (keys %opts)) . ") failed: $@");
} else {
- my $path2root = join( '/', ('..') x (@rootdirs+@dirs) );
- my $fh = IO::File->new($infile) or die "Can't read $infile: $!";
+ my $path2root = File::Spec->catdir((File::Spec->updir) x @dirs);
+ open(my $fh, '<', $infile) or die "Can't read $infile: $!";
my $abstract = Module::Build::PodParser->new(fh => $fh)->get_abstract();
my $title = join( '::', (@dirs, $name) );
@@ -3436,11 +3414,11 @@ sub htmlify_pods {
my @opts = (
"--title=$title",
- "--podpath=$podpath",
+ ( defined($podpath) ? "--podpath=$podpath" : ()),
"--infile=$infile",
"--outfile=$tmpfile",
"--podroot=$podroot",
- "--htmlroot=$path2root",
+ ($path2root ? "--htmlroot=$path2root" : ()),
);
unless ( eval{Pod::Html->VERSION(1.12)} ) {
@@ -3467,9 +3445,9 @@ sub htmlify_pods {
$errors++;
next POD;
}
- my $fh = IO::File->new($tmpfile) or die "Can't read $tmpfile: $!";
+ open(my $fh, '<', $tmpfile) or die "Can't read $tmpfile: $!";
my $html = join('',<$fh>);
- $fh->close;
+ close $fh;
if (!$self->_is_ActivePerl) {
# These fixups are already done by AP::DT:P:pod2html
# The output from pod2html is NOT XHTML!
@@ -3484,9 +3462,9 @@ sub htmlify_pods {
# Fixup links that point to our temp blib
$html =~ s/\Q$blibdir\E//g;
- $fh = IO::File->new(">$outfile") or die "Can't write $outfile: $!";
+ open($fh, '>', $outfile) or die "Can't write $outfile: $!";
print $fh $html;
- $fh->close;
+ close $fh;
unlink($tmpfile);
}
@@ -3574,7 +3552,7 @@ sub ACTION_install {
my ($self) = @_;
require ExtUtils::Install;
$self->depends_on('build');
- # RT#63003 suggest that odd cirmstances that we might wind up
+ # RT#63003 suggest that odd circumstances that we might wind up
# in a different directory than we started, so wrap with _do_in_dir to
# ensure we get back to where we started; hope this fixes it!
$self->_do_in_dir( ".", sub {
@@ -3685,10 +3663,6 @@ sub ACTION_installdeps {
}
}
- if ( ! -x $command ) {
- die "cpan_client '$command' is not executable\n";
- }
-
$self->do_system($command, @opts, @install);
}
@@ -3859,12 +3833,12 @@ sub _add_to_manifest {
my $mode = (stat $manifest)[2];
chmod($mode | oct(222), $manifest) or die "Can't make $manifest writable: $!";
- my $fh = IO::File->new("< $manifest") or die "Can't read $manifest: $!";
+ open(my $fh, '<', $manifest) or die "Can't read $manifest: $!";
my $last_line = (<$fh>)[-1] || "\n";
my $has_newline = $last_line =~ /\n$/;
- $fh->close;
+ close $fh;
- $fh = IO::File->new(">> $manifest") or die "Can't write to $manifest: $!";
+ open($fh, '>>', $manifest) or die "Can't write to $manifest: $!";
print $fh "\n" unless $has_newline;
print $fh map "$_\n", @$lines;
close $fh;
@@ -3960,7 +3934,7 @@ HERE
$self->delete_filetree('LICENSE');
- my $fh = IO::File->new('> LICENSE')
+ open(my $fh, '>', 'LICENSE')
or die "Can't write LICENSE file: $!";
print $fh $license->fulltext;
close $fh;
@@ -3992,8 +3966,7 @@ EOF
} elsif ( eval {require Pod::Text; 1} ) {
$self->log_info("Creating README using Pod::Text\n");
- my $fh = IO::File->new('> README');
- if ( defined($fh) ) {
+ if ( open(my $fh, '>', 'README') ) {
local $^W = 0;
no strict "refs";
@@ -4014,7 +3987,7 @@ EOF
Pod::Text::pod2text( $docfile, $fh );
- $fh->close;
+ close $fh;
} else {
$self->log_warn(
"Cannot create 'README' file: Can't open file for writing\n" );
@@ -4094,9 +4067,9 @@ sub ACTION_disttest {
$self->run_perl_script('Build.PL') # XXX Should this be run w/ --nouse-rcfile
or die "Error executing 'Build.PL' in dist directory: $!";
- $self->run_perl_script('Build')
- or die "Error executing 'Build' in dist directory: $!";
- $self->run_perl_script('Build', [], ['test'])
+ $self->run_perl_script($self->build_script)
+ or die "Error executing $self->build_script in dist directory: $!";
+ $self->run_perl_script($self->build_script, [], ['test'])
or die "Error executing 'Build test' in dist directory";
});
}
@@ -4110,9 +4083,9 @@ sub ACTION_distinstall {
sub {
$self->run_perl_script('Build.PL')
or die "Error executing 'Build.PL' in dist directory: $!";
- $self->run_perl_script('Build')
- or die "Error executing 'Build' in dist directory: $!";
- $self->run_perl_script('Build', [], ['install'])
+ $self->run_perl_script($self->build_script)
+ or die "Error executing $self->build_script in dist directory: $!";
+ $self->run_perl_script($self->build_script, [], ['install'])
or die "Error executing 'Build install' in dist directory";
}
);
@@ -4208,17 +4181,17 @@ sub _append_maniskip {
my $skip = shift;
my $file = shift || 'MANIFEST.SKIP';
return unless defined $skip && length $skip;
- my $fh = IO::File->new(">> $file")
+ open(my $fh, '>>', $file)
or die "Can't open $file: $!";
print $fh "$skip\n";
- $fh->close();
+ close $fh;
}
sub _write_default_maniskip {
my $self = shift;
my $file = shift || 'MANIFEST.SKIP';
- my $fh = IO::File->new("> $file")
+ open(my $fh, '>', $file)
or die "Can't open $file: $!";
my $content = $self->_eumanifest_has_include ? "#!include_default\n"
@@ -4244,6 +4217,8 @@ EOF
$content .= '\b'.$self->dist_name.'-[\d\.\_]+'."\n";
print $fh $content;
+
+ close $fh;
return;
}
@@ -4413,8 +4388,8 @@ BEGIN { *scripts = \&script_files; }
perl => 'Perl_5',
apache => 'Apache_2_0',
apache_1_1 => 'Apache_1_1',
- artistic => 'Artistic_1_0',
- artistic_2 => 'Artistic_2_0',
+ artistic => 'Artistic_1',
+ artistic_2 => 'Artistic_2',
lgpl => 'LGPL_2_1',
lgpl2 => 'LGPL_2_1',
lgpl3 => 'LGPL_3_0',
@@ -4424,9 +4399,9 @@ BEGIN { *scripts = \&script_files; }
gpl3 => 'GPL_3',
mit => 'MIT',
mozilla => 'Mozilla_1_1',
+ restrictive => 'Restricted',
open_source => undef,
unrestricted => undef,
- restrictive => undef,
unknown => undef,
);
@@ -4447,9 +4422,9 @@ BEGIN { *scripts = \&script_files; }
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 {
@@ -4460,21 +4435,30 @@ BEGIN { *scripts = \&script_files; }
}
}
-# use mapping or license name directly
-sub _software_license_object {
- my ($self) = @_;
- return unless defined( my $license = $self->license );
-
- my $class;
+sub _software_license_class {
+ my ($self, $license) = @_;
+ if ($self->valid_licenses->{$license} && eval { require Software::LicenseUtils; Software::LicenseUtils->VERSION(0.103009) }) {
+ my ($class) = Software::LicenseUtils->guess_license_from_meta_key($license, 1);
+ eval "require $class";
+ #die $class;
+ return $class;
+ }
LICENSE: for my $l ( $self->valid_licenses->{ $license }, $license ) {
next unless defined $l;
my $trial = "Software::License::" . $l;
if ( eval "require Software::License; Software::License->VERSION(0.014); require $trial; 1" ) {
- $class = $trial;
- last LICENSE;
+ return $trial;
}
}
- return unless defined $class;
+ return;
+}
+
+# use mapping or license name directly
+sub _software_license_object {
+ my ($self) = @_;
+ return unless defined( my $license = $self->license );
+
+ my $class = $self->_software_license_class($license) or return;
# Software::License requires a 'holder' argument
my $author = join( " & ", @{ $self->dist_author }) || 'unknown';
@@ -4568,7 +4552,7 @@ sub _get_meta_object {
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(
@@ -4624,6 +4608,16 @@ sub normalize_version {
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/runtime conflicts/ ],
+);
+
sub _normalize_prereqs {
my ($self) = @_;
my $p = $self->{properties};
@@ -4631,46 +4625,98 @@ sub _normalize_prereqs {
# 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 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_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};
+ }
}
- my $fatal = $args->{fatal} || 0;
- my $p = $self->{properties};
+ return \%output
+}
+my %custom = (
+ resources => \&_upconvert_resources,
+);
- $self->auto_config_requires if $args->{auto};
+sub _upconvert_metapiece {
+ my ($input, $type) = @_;
+ return $input if exists $input->{'meta-spec'} && $input->{'meta-spec'}{version} == 2;
- # A little helper sub
- my $add_node = sub {
- my ($name, $val) = @_;
- $node->{$name} = $val;
- push @$keys, $name if $keys;
- };
+ 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) = @_;
+
+ 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)) {
@@ -4686,80 +4732,61 @@ sub prepare_metadata {
}
}
+ 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;
}
@@ -5321,7 +5348,7 @@ sub have_c_compiler {
return $p->{_have_c_compiler} if defined $p->{_have_c_compiler};
$self->log_verbose("Checking if compiler tools configured... ");
- my $b = eval { $self->cbuilder };
+ my $b = $self->cbuilder;
my $have = $b && eval { $b->have_compiler };
$self->log_verbose($have ? "ok.\n" : "failed.\n");
return $p->{_have_c_compiler} = $have;
@@ -5407,7 +5434,7 @@ sub compile_xs {
@typemaps, $file);
$self->log_info("@command\n");
- my $fh = IO::File->new("> $args{outfile}") or die "Couldn't write $args{outfile}: $!";
+ open(my $fh, '>', $args{outfile}) or die "Couldn't write $args{outfile}: $!";
print {$fh} $self->_backticks(@command);
close $fh;
}
@@ -5493,17 +5520,19 @@ sub _infer_xs_spec {
$spec{archdir} = File::Spec->catdir($self->blib, 'arch', 'auto',
@d, $file_base);
- $spec{bs_file} = File::Spec->catfile($spec{archdir}, "${file_base}.bs");
-
- $spec{lib_file} = File::Spec->catfile($spec{archdir},
- "${file_base}.".$cf->get('dlext'));
-
$spec{c_file} = File::Spec->catfile( $spec{src_dir},
"${file_base}.c" );
$spec{obj_file} = File::Spec->catfile( $spec{src_dir},
"${file_base}".$cf->get('obj_ext') );
+ require DynaLoader;
+ my $modfname = defined &DynaLoader::mod2fname ? DynaLoader::mod2fname([@d, $file_base]) : $file_base;
+
+ $spec{bs_file} = File::Spec->catfile($spec{archdir}, "$modfname.bs");
+
+ $spec{lib_file} = File::Spec->catfile($spec{archdir}, "$modfname.".$cf->get('dlext'));
+
return \%spec;
}
@@ -5536,7 +5565,7 @@ sub process_xs {
require ExtUtils::Mkbootstrap;
$self->log_info("ExtUtils::Mkbootstrap::Mkbootstrap('$spec->{bs_file}')\n");
ExtUtils::Mkbootstrap::Mkbootstrap($spec->{bs_file}); # Original had $BSLOADLIBS - what's that?
- {my $fh = IO::File->new(">> $spec->{bs_file}")} # create
+ open(my $fh, '>>', $spec->{bs_file}); # create
utime((time)x2, $spec->{bs_file}); # touch
}
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Compat.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Compat.pm
index 79499a6efd9..11bbf11b4a9 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Compat.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Compat.pm
@@ -2,11 +2,10 @@ package Module::Build::Compat;
use strict;
use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4205';
use File::Basename ();
use File::Spec;
-use IO::File;
use Config;
use Module::Build;
use Module::Build::ModuleInfo;
@@ -123,7 +122,7 @@ HERE
$args{file} ||= 'Makefile.PL';
local $build->{properties}{quiet} = 1;
$build->delete_filetree($args{file});
- $fh = IO::File->new("> $args{file}") or die "Can't write $args{file}: $!";
+ open($fh, '>', "$args{file}") or die "Can't write $args{file}: $!";
}
print {$fh} "# Note: this file was auto-generated by ", __PACKAGE__, " version $VERSION\n";
@@ -406,7 +405,7 @@ EOF
sub fake_prereqs {
my $file = File::Spec->catfile('_build', 'prereqs');
- my $fh = IO::File->new("< $file") or die "Can't read $file: $!";
+ open(my $fh, '<', "$file") or die "Can't read $file: $!";
my $prereqs = eval do {local $/; <$fh>};
close $fh;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Config.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Config.pm
index 88a3ff31579..69bec80543a 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Config.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Config.pm
@@ -2,7 +2,7 @@ package Module::Build::Config;
use strict;
use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4205';
$VERSION = eval $VERSION;
use Config;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/ConfigData.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/ConfigData.pm
index 85fa28d869b..ec72359cd08 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/ConfigData.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/ConfigData.pm
@@ -21,7 +21,6 @@ sub config_names { keys %$config }
sub write {
my $me = __FILE__;
- require IO::File;
# Can't use Module::Build::Dumper here because M::B is only a
# build-time prereq of this module
@@ -29,7 +28,7 @@ sub write {
my $mode_orig = (stat $me)[2] & 07777;
chmod($mode_orig | 0222, $me); # Make it writeable
- my $fh = IO::File->new($me, 'r+') or die "Can't rewrite $me: $!";
+ open(my $fh, '+<', $me) or die "Can't rewrite $me: $!";
seek($fh, 0, 0);
while (<$fh>) {
last if /^__DATA__$/;
@@ -38,11 +37,11 @@ sub write {
seek($fh, tell($fh), 0);
my $data = [$config, $features, $auto_features];
- $fh->print( 'do{ my '
+ print($fh 'do{ my '
. Data::Dumper->new([$data],['x'])->Purity(1)->Dump()
. '$x; }' );
truncate($fh, tell($fh));
- $fh->close;
+ close $fh;
chmod($mode_orig, $me)
or warn "Couldn't restore permissions on $me: $!";
@@ -168,47 +167,44 @@ do{ my $x = [
{},
{},
{
- 'license_creation' => {
- 'requires' => {
- 'Software::License' => 0
- },
- 'description' => 'Create licenses automatically in distributions'
- },
- 'inc_bundling_support' => {
- 'requires' => {
- 'ExtUtils::Installed' => '1.999',
- 'ExtUtils::Install' => '1.54'
- },
- 'description' => 'Bundle Module::Build in inc/'
- },
- 'manpage_support' => {
- 'requires' => {
- 'Pod::Man' => 0
- },
- 'description' => 'Create Unix man pages'
- },
- 'PPM_support' => {
- 'requires' => {
- 'IO::File' => '1.13'
- },
- 'description' => 'Generate PPM files for distributions'
- },
'dist_authoring' => {
'requires' => {
'Archive::Tar' => '1.09'
},
+ 'description' => 'Create new distributions',
'recommends' => {
- 'Module::Signature' => '0.21',
- 'Pod::Readme' => '0.04'
- },
- 'description' => 'Create new distributions'
+ 'Pod::Readme' => '0.04',
+ 'Module::Signature' => '0.21'
+ }
},
'HTML_support' => {
'requires' => {
'Pod::Html' => 0
},
'description' => 'Create HTML documentation'
- }
+ },
+ 'manpage_support' => {
+ 'requires' => {
+ 'Pod::Man' => 0
+ },
+ 'description' => 'Create Unix man pages'
+ },
+ 'license_creation' => {
+ 'requires' => {
+ 'Software::License' => '0.103009'
+ },
+ 'description' => 'Create licenses automatically in distributions'
+ },
+ 'PPM_support' => {
+ 'description' => 'Generate PPM files for distributions'
+ },
+ 'inc_bundling_support' => {
+ 'requires' => {
+ 'ExtUtils::Installed' => '1.999',
+ 'ExtUtils::Install' => '1.54'
+ },
+ 'description' => 'Bundle Module::Build in inc/'
+ }
}
];
$x; } \ No newline at end of file
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Cookbook.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Cookbook.pm
index e66020cf826..08d10b3ceb2 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Cookbook.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Cookbook.pm
@@ -1,7 +1,7 @@
package Module::Build::Cookbook;
use strict;
use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4205';
=head1 NAME
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Dumper.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Dumper.pm
index 73839c79e4d..d70a38e5ae5 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Dumper.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Dumper.pm
@@ -1,7 +1,7 @@
package Module::Build::Dumper;
use strict;
use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4205';
# This is just a split-out of a wrapper function to do Data::Dumper
# stuff "the right way". See:
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Notes.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Notes.pm
index 04773229932..bd4a2491b2a 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Notes.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Notes.pm
@@ -4,10 +4,9 @@ package Module::Build::Notes;
use strict;
use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4205';
$VERSION = eval $VERSION;
use Data::Dumper;
-use IO::File;
use Module::Build::Dumper;
sub new {
@@ -24,9 +23,10 @@ sub new {
sub restore {
my $self = shift;
- my $fh = IO::File->new("< $self->{file}") or die "Can't read $self->{file}: $!";
+ open(my $fh, '<', $self->{file}) or die "Can't read $self->{file}: $!";
$self->{disk} = eval do {local $/; <$fh>};
die $@ if $@;
+ close $fh;
$self->{new} = {};
}
@@ -107,8 +107,9 @@ sub write {
sub _dump {
my ($self, $file, $data) = @_;
- my $fh = IO::File->new("> $file") or die "Can't create '$file': $!";
+ open(my $fh, '>', $file) or die "Can't create '$file': $!";
print {$fh} Module::Build::Dumper->_data_dump($data);
+ close $fh;
}
my $orig_template = do { local $/; <DATA> };
@@ -127,11 +128,11 @@ sub write_config_data {
# recognized for *this* source file
$template =~ s{$_\n}{} for '=begin private', '=end private';
- my $fh = IO::File->new("> $args{file}") or die "Can't create '$args{file}': $!";
+ open(my $fh, '>', $args{file}) or die "Can't create '$args{file}': $!";
print {$fh} $template;
print {$fh} "\n__DATA__\n";
print {$fh} Module::Build::Dumper->_data_dump([$args{config_data}, $args{feature}, $args{auto_features}]);
-
+ close $fh;
}
1;
@@ -188,7 +189,6 @@ sub config_names { keys %$config }
sub write {
my $me = __FILE__;
- require IO::File;
# Can't use Module::Build::Dumper here because M::B is only a
# build-time prereq of this module
@@ -196,7 +196,7 @@ sub write {
my $mode_orig = (stat $me)[2] & 07777;
chmod($mode_orig | 0222, $me); # Make it writeable
- my $fh = IO::File->new($me, 'r+') or die "Can't rewrite $me: $!";
+ open(my $fh, '+<', $me) or die "Can't rewrite $me: $!";
seek($fh, 0, 0);
while (<$fh>) {
last if /^__DATA__$/;
@@ -205,11 +205,11 @@ sub write {
seek($fh, tell($fh), 0);
my $data = [$config, $features, $auto_features];
- $fh->print( 'do{ my '
+ print($fh 'do{ my '
. Data::Dumper->new([$data],['x'])->Purity(1)->Dump()
. '$x; }' );
truncate($fh, tell($fh));
- $fh->close;
+ close $fh;
chmod($mode_orig, $me)
or warn "Couldn't restore permissions on $me: $!";
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/PPMMaker.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/PPMMaker.pm
index 34f549576af..3ffa32ef329 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/PPMMaker.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/PPMMaker.pm
@@ -3,9 +3,8 @@ package Module::Build::PPMMaker;
use strict;
use Config;
use vars qw($VERSION);
-use IO::File;
-$VERSION = '0.4003';
+$VERSION = '0.4205';
$VERSION = eval $VERSION;
# This code is mostly borrowed from ExtUtils::MM_Unix 6.10_03, with a
@@ -100,12 +99,11 @@ EOF
EOF
my $ppd_file = "$dist{name}.ppd";
- my $fh = IO::File->new(">$ppd_file")
+ open(my $fh, '>', $ppd_file)
or die "Cannot write to $ppd_file: $!";
- my $io_file_ok = eval { IO::File->VERSION(1.13); 1 };
- $fh->binmode(":utf8")
- if $io_file_ok && $fh->can('binmode') && $] >= 5.008 && $Config{useperlio};
+ binmode($fh, ":utf8")
+ if $] >= 5.008 && $Config{useperlio};
print $fh $ppd;
close $fh;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Default.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Default.pm
index 53bffc05940..8a9cf8b0a75 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Default.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Default.pm
@@ -2,7 +2,7 @@ package Module::Build::Platform::Default;
use strict;
use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4205';
$VERSION = eval $VERSION;
use Module::Build::Base;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/MacOS.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/MacOS.pm
index 8b567668529..7e12ca12fa2 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/MacOS.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/MacOS.pm
@@ -2,7 +2,7 @@ package Module::Build::Platform::MacOS;
use strict;
use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4205';
$VERSION = eval $VERSION;
use Module::Build::Base;
use vars qw(@ISA);
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Unix.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Unix.pm
index e3d7ff5b224..ec13ebea9be 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Unix.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Unix.pm
@@ -2,7 +2,7 @@ package Module::Build::Platform::Unix;
use strict;
use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4205';
$VERSION = eval $VERSION;
use Module::Build::Base;
@@ -43,8 +43,8 @@ sub _detildefy {
my ($self, $value) = @_;
$value =~ s[^~([^/]+)?(?=/|$)] # tilde with optional username
[$1 ?
- ((getpwnam $1)[7] || "~$1") :
- ($ENV{HOME} || (getpwuid $>)[7])
+ (eval{(getpwnam $1)[7]} || "~$1") :
+ ($ENV{HOME} || eval{(getpwuid $>)[7]} || glob("~"))
]ex;
return $value;
}
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/VMS.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/VMS.pm
index 7ff7e056bdc..5b06baa5f87 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/VMS.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/VMS.pm
@@ -2,7 +2,7 @@ package Module::Build::Platform::VMS;
use strict;
use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4205';
$VERSION = eval $VERSION;
use Module::Build::Base;
use Config;
@@ -279,30 +279,6 @@ sub oneliner {
return "MCR $^X $oneliner";
}
-=item _infer_xs_spec
-
-Inherit the standard version but tweak the library file name to be
-something Dynaloader can find.
-
-=cut
-
-sub _infer_xs_spec {
- my $self = shift;
- my $file = shift;
-
- my $spec = $self->SUPER::_infer_xs_spec($file);
-
- # Need to create with the same name as DynaLoader will load with.
- if (defined &DynaLoader::mod2fname) {
- my $file = $$spec{module_name} . '.' . $self->{config}->get('dlext');
- $file =~ tr/:/_/;
- $file = DynaLoader::mod2fname([$file]);
- $$spec{lib_file} = File::Spec->catfile($$spec{archdir}, $file);
- }
-
- return $spec;
-}
-
=item rscan_dir
Inherit the standard version but remove dots at end of name.
@@ -427,26 +403,15 @@ sub _detildefy {
my @hdirs = File::Spec::Unix->splitdir($hdir);
my @dirs = File::Spec::Unix->splitdir($dir);
- my $newdirs;
-
- # Two cases of tilde handling
- if ($arg =~ m#^~/#) {
-
- # Simple case, just merge together
- $newdirs = File::Spec::Unix->catdir(@hdirs, @dirs);
-
- } else {
-
- # Complex case, need to add an updir - No delimiters
- my @backup = File::Spec::Unix->splitdir(File::Spec::Unix->updir);
-
- $newdirs = File::Spec::Unix->catdir(@hdirs, @backup, @dirs);
+ unless ($arg =~ m#^~/#) {
+ # There is a home directory after the tilde, but it will already
+ # be present in in @hdirs so we need to remove it by from @dirs.
+ shift @dirs;
}
+ my $newdirs = File::Spec::Unix->catdir(@hdirs, @dirs);
- # Now put the two cases back together
$arg = File::Spec::Unix->catpath($hvol, $newdirs, $file);
-
}
return $arg;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/VOS.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/VOS.pm
index 2578e31b3be..19dfceeaf0e 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/VOS.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/VOS.pm
@@ -2,7 +2,7 @@ package Module::Build::Platform::VOS;
use strict;
use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4205';
$VERSION = eval $VERSION;
use Module::Build::Base;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Windows.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Windows.pm
index e35e28f707f..77441774507 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Windows.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Windows.pm
@@ -2,13 +2,12 @@ package Module::Build::Platform::Windows;
use strict;
use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4205';
$VERSION = eval $VERSION;
use Config;
use File::Basename;
use File::Spec;
-use IO::File;
use Module::Build::Base;
@@ -49,7 +48,7 @@ sub ACTION_realclean {
my $null_arg = (Win32::IsWinNT()) ? '""' : '';
my $cmd = qq(start $null_arg /min "\%comspec\%" /c del "$full_progname");
- my $fh = IO::File->new(">> $basename.bat")
+ open(my $fh, '>>', "$basename.bat")
or die "Can't create $basename.bat: $!";
print $fh $cmd;
close $fh ;
@@ -137,9 +136,9 @@ EOT
my $start = $Config{startperl};
$start = "#!perl" unless $start =~ /^#!.*perl/;
- my $in = IO::File->new("< $opts{in}") or die "Can't open $opts{in}: $!";
+ open(my $in, '<', "$opts{in}") or die "Can't open $opts{in}: $!";
my @file = <$in>;
- $in->close;
+ close($in);
foreach my $line ( @file ) {
$linenum++;
@@ -164,13 +163,13 @@ EOT
}
}
- my $out = IO::File->new("> $opts{out}") or die "Can't open $opts{out}: $!";
+ open(my $out, '>', "$opts{out}") or die "Can't open $opts{out}: $!";
print $out $head;
print $out $start, ( $opts{usewarnings} ? " -w" : "" ),
"\n#line ", ($headlines+1), "\n" unless $linedone;
print $out @file[$skiplines..$#file];
print $out $tail unless $taildone;
- $out->close;
+ close($out);
return $opts{out};
}
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/aix.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/aix.pm
index 3833ceb9761..c51e1002e6b 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/aix.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/aix.pm
@@ -2,7 +2,7 @@ package Module::Build::Platform::aix;
use strict;
use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4205';
$VERSION = eval $VERSION;
use Module::Build::Platform::Unix;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/cygwin.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/cygwin.pm
index 15d3e818412..19bd50db8bf 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/cygwin.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/cygwin.pm
@@ -2,7 +2,7 @@ package Module::Build::Platform::cygwin;
use strict;
use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4205';
$VERSION = eval $VERSION;
use Module::Build::Platform::Unix;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/darwin.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/darwin.pm
index 45d68fdcd0a..c7e690241c2 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/darwin.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/darwin.pm
@@ -2,7 +2,7 @@ package Module::Build::Platform::darwin;
use strict;
use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4205';
$VERSION = eval $VERSION;
use Module::Build::Platform::Unix;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/os2.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/os2.pm
index 52d6e173d87..5f9ad187db8 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/os2.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/os2.pm
@@ -2,7 +2,7 @@ package Module::Build::Platform::os2;
use strict;
use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4205';
$VERSION = eval $VERSION;
use Module::Build::Platform::Unix;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/PodParser.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/PodParser.pm
index 6605fd47272..c7e83a837d3 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/PodParser.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/PodParser.pm
@@ -2,7 +2,7 @@ package Module::Build::PodParser;
use strict;
use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4205';
$VERSION = eval $VERSION;
use vars qw(@ISA);
@@ -16,7 +16,7 @@ sub new {
unless ($self->{fh}) {
die "No 'file' or 'fh' parameter given" unless $self->{file};
- $self->{fh} = IO::File->new($self->{file}) or die "Couldn't open $self->{file}: $!";
+ open($self->{fh}, '<', $self->{file}) or die "Couldn't open $self->{file}: $!";
}
return $self;
@@ -29,7 +29,7 @@ sub parse_from_filehandle {
while (<$fh>) {
next unless /^=(?!cut)/ .. /^=cut/; # in POD
# Accept Name - abstract or C<Name> - abstract
- last if ($self->{abstract}) = /^ (?: [a-z0-9:]+ | [BCIF] < [a-z0-9:]+ > ) \s+ - \s+ (.*\S) /ix;
+ last if ($self->{abstract}) = /^ (?: [a-z_0-9:]+ | [BCIF] < [a-z_0-9:]+ > ) \s+ - \s+ (.*\S) /ix;
}
my @author;