'Module::Build' =>
{
'MAINTAINER' => 'kwilliams',
- 'DISTRIBUTION' => 'DAGOLDEN/Module-Build-0.35_08.tar.gz',
+ 'DISTRIBUTION' => 'DAGOLDEN/Module-Build-0.35_09.tar.gz',
'FILES' => q[cpan/Module-Build],
'EXCLUDED' => [ qw{ t/par.t t/signature.t },
qr!^contrib/!, qr!^devtools! ],
Revision history for Perl extension Module::Build.
+0.35_09 - Thu Nov 19 01:30:42 EST 2009
+
+ Bug fixes:
+
+ - The DB package should not be included in 'provides' in META files
+ [David Golden]
+
+ - Fixed t/xs.t build failures in bleadperl for noexec temp directories
+ [Nicholas Clark]
+
+ - Adjusted order of @INC in resume() (fixes par.t, ppm.t, xs.t fails):
+ @INC = @new_additions_to_inc, @saved_additions_to_inc, @default_inc
+ [David Golden]
+
+ - Skip bundle_inc.t tests if bundled Module::Build for test can't be
+ tweaked (Works around test crashes on Win2) [David Golden]
+
+ Other:
+
+ - 'C_support' is no longer an optional feature. Modern ExtUtils::CBuilder
+ and ExtUtils::ParseXS added to the 'requires' list. This ensures that
+ upgrading Module::Build will upgrade this critical modules.
+ ExtUtils::CBuilder no longer requires a compiler, so it is "safe" to
+ require.
+
0.35_08 - Mon Nov 16 22:38:28 EST 2009
Bug fixes:
use vars qw($VERSION @ISA);
@ISA = qw(Module::Build::Base);
-$VERSION = '0.35_08';
+$VERSION = '0.35_09';
$VERSION = eval $VERSION;
# Okay, this is the brute-force method of finding out what kind of
'actions'. In this case the actions run are 'build' (the default
action), 'test', and 'install'. Other actions defined so far include:
- build manifest
- clean manpages
- code pardist
- config_data ppd
- diff ppmdist
- dist prereq_data
+ build manifest
+ clean manpages
+ code pardist
+ config_data ppd
+ diff ppmdist
+ dist prereq_data
distcheck prereq_report
distclean pure_install
- distdir realclean
- distmeta retest
- distsign skipcheck
- disttest test
- docs testall
- fakeinstall testcover
- help testdb
- html testpod
+ distdir realclean
+ distmeta retest
+ distsign skipcheck
+ disttest test
+ docs testall
+ fakeinstall testcover
+ help testdb
+ html testpod
install testpodcoverage
installdeps versioninstall
GZIP compression.
By default, this action will use the C<Archive::Tar> module. However, you can
-force it to use binary "tar" and "gzip" executables by supplying an explicit
+force it to use binary "tar" and "gzip" executables by supplying an explicit
C<tar> (and optional C<gzip>) parameter:
./Build dist --tar C:\path\to\tar.exe --gzip C:\path\to\zip.exe
[version 0.28]
This action is identical to the C<install> action. In the future,
-though, when C<install> starts writing to the file
+though, when C<install> starts writing to the file
F<$(INSTALLARCHLIB)/perllocal.pod>, C<pure_install> won't, and that
will be the only difference between them.
[version 0.25]
-This checks all the files described in the C<docs> action and
+This checks all the files described in the C<docs> action and
produces C<Test::Harness>-style output. If you are a module author,
this is useful to run before creating a new release.
[version 0.28]
-This checks the pod coverage of the distribution and
+This checks the pod coverage of the distribution and
produces C<Test::Harness>-style output. If you are a module author,
this is useful to run before creating a new release.
a directory name or an arrayref of directory names containing files to be
installed in the distribution-level share directory.
-If C<share_dir> is a hashref, it may have C<dist> or C<module> keys
+If C<share_dir> is a hashref, it may have C<dist> or C<module> keys
providing full flexibility in defining share directories to install.
share_dir => {
use strict;
use vars qw($VERSION);
-$VERSION = '0.35_08';
+$VERSION = '0.35_09';
$VERSION = eval $VERSION;
BEGIN { require 5.00503 }
my $self = $package->_construct(@_);
$self->read_config;
- unshift @INC, @{ $self->{properties}{_added_to_INC} || [] };
+ my @added_earlier = @{ $self->{properties}{_added_to_INC} || [] };
+
+ @INC = ($self->_added_to_INC, @added_earlier, $self->_default_INC);
# If someone called Module::Build->current() or
# Module::Build->new_from_context() and the correct class to use is
foreach my $package ( $pm_info->packages_inside ) {
next if $package eq 'main'; # main can appear numerous times, ignore
+ next if $package eq 'DB'; # special debugging package, ignore
next if grep /^_/, split( /::/, $package ); # private package, ignore
my $version = $pm_info->version( $package );
my $self = shift;
my $s = $self->{stash};
return $s->{_cbuilder} if $s->{_cbuilder};
- die "Module::Build is not configured with C_support"
- unless $self->_mb_feature('C_support');
require ExtUtils::CBuilder;
return $s->{_cbuilder} = ExtUtils::CBuilder->new(
=head1 SYNOPSIS
# Build.PL
- use lib '.';
use inc::latest 'Module::Build';
Module::Build->new(
A "bundling" Build.PL replaces the initial "use" line with a nearly
transparent replacement:
- use lib '.';
use inc::latest 'Module::Build';
Module::Build->new(
license => 'perl',
)->create_build_script;
-The inital C<lib> line ensures that the top-level distribution directory is
-added to C<@INC> so that C<inc::latest> loads from C<./inc/latest.pm>. You
-SHOULD NOT add 'inc' to C<@INC> (unless you have other special reasons for
-doing so) -- that's not how C<inc::latest> works.
-
For I<authors>, when "Build dist" is run, Module::Build will be
automatically bundled into C<inc> according to the rules for
L<inc::latest>.
use strict;
use vars qw($VERSION);
-$VERSION = '0.35_08';
+$VERSION = '0.35_09';
use File::Basename ();
use File::Spec;
VENDOR => 'vendor',
);
-my %makefile_to_build =
+my %makefile_to_build =
(
TEST_VERBOSE => 'verbose',
VERBINST => 'verbose',
}
return %$merge;
}
-
-
+
+
sub create_makefile_pl {
my ($package, $type, $build, %args) = @_;
-
+
die "Don't know how to build Makefile.PL of type '$type'"
unless $type =~ /^(small|passthrough|traditional)$/;
if ($type eq 'passthrough') {
$build->log_warn(<<"HERE");
-
-IMPORTANT NOTE: The '$type' style of Makefile.PL is deprecated and
+
+IMPORTANT NOTE: The '$type' style of Makefile.PL is deprecated and
may be removed in a future version of Module::Build in favor of the
'configure_requires' property. See Module::Build::Compat
documentation for details.
print {$fh} "# Note: this file was auto-generated by ", __PACKAGE__, " version $VERSION\n";
- # Minimum perl version should be specified as "require 5.XXXXXX" in
+ # Minimum perl version should be specified as "require 5.XXXXXX" in
# Makefile.PL
my $requires = $build->requires;
if ( my $minimum_perl = $requires->{perl} ) {
} elsif ($type eq 'passthrough') {
printf {$fh} <<'EOF', $subclass_load, ref($build), ref($build);
-
+
unless (eval "use Module::Build::Compat 0.02; 1" ) {
print "This module requires Module::Build to install itself.\n";
-
+
require ExtUtils::MakeMaker;
my $yn = ExtUtils::MakeMaker::prompt
(' Install Module::Build now from CPAN?', 'y');
-
+
unless ($yn =~ /^y/i) {
die " *** Cannot install without Module::Build. Exiting ...\n";
}
-
+
require Cwd;
require File::Spec;
require CPAN;
-
+
# Save this 'cause CPAN will chdir all over the place.
my $cwd = Cwd::cwd();
-
+
CPAN::Shell->install('Module::Build::Compat');
CPAN::Shell->expand("Module", "Module::Build::Compat")->uptodate
or die "Couldn't install Module::Build, giving up.\n";
-
+
chdir $cwd or die "Cannot chdir() back to $cwd: $!";
}
eval "use Module::Build::Compat 0.02; 1" or die $@;
%s
Module::Build::Compat->run_build_pl(args => \@ARGV);
- my $build_script = 'Build';
+ my $build_script = 'Build';
$build_script .= '.com' if $^O eq 'VMS';
exit(0) unless(-e $build_script); # cpantesters convention
require %s;
Module::Build::Compat->write_makefile(build_class => '%s');
EOF
-
+
} elsif ($type eq 'traditional') {
my (%MM_Args, %prereq);
tie %MM_Args, 'Tie::IxHash'; # Don't care if it fails here
tie %prereq, 'Tie::IxHash'; # Don't care if it fails here
}
-
+
my %name = ($build->module_name
? (NAME => $build->module_name)
: (DISTNAME => $build->dist_name));
-
+
my %version = ($build->dist_version_from
? (VERSION_FROM => $build->dist_version_from)
: (VERSION => $build->dist_version)
);
%MM_Args = (%name, %version);
-
+
%prereq = _merge_prereq( $build->requires, $build->build_requires );
%prereq = map {$_, $prereq{$_}} sort keys %prereq;
-
+
delete $prereq{perl};
$MM_Args{PREREQ_PM} = \%prereq;
-
+
$MM_Args{INSTALLDIRS} = $build->installdirs eq 'core' ? 'perl' : $build->installdirs;
-
+
$MM_Args{EXE_FILES} = [ sort keys %{$build->script_files} ] if $build->script_files;
-
+
$MM_Args{PL_FILES} = $build->PL_files || {};
if ($build->recursive_test_files) {
local $Data::Dumper::Terse = 1;
my $args = Data::Dumper::Dumper(\%MM_Args);
$args =~ s/\{(.*)\}/($1)/s;
-
+
print $fh <<"EOF";
use ExtUtils::MakeMaker;
WriteMakefile
sub subclass_dir {
my ($self, $build) = @_;
-
+
return (Module::Build::ModuleInfo->find_module_dir_by_name(ref $build)
|| File::Spec->catdir($build->config_dir, 'lib'));
}
my @out;
foreach my $arg (@_) {
next if $arg eq '';
-
+
my ($key, $val) = ($arg =~ /^(\w+)=(.+)/ ? ($1, $2) :
die "Malformed argument '$arg'");
}
}
}
- push @out, (config => \%config) if %config;
+ push @out, (config => \%config) if %config;
return @out;
}
$perl $Build $action
EOF
}
-
+
if ($self->_is_vms_mms) {
# Roll our own .EXPORT as MMS/MMK don't honor that directive.
- $maketext .= "\n.FIRST\n\t\@ $noop\n";
+ $maketext .= "\n.FIRST\n\t\@ $noop\n";
for my $macro (keys %macro_to_build) {
$maketext .= ".IFDEF $macro\n\tDEFINE $macro \"\$($macro)\"\n.ENDIF\n";
}
- $maketext .= "\n";
+ $maketext .= "\n";
}
else {
$maketext .= "\n.EXPORT : " . join(' ', keys %macro_to_build) . "\n\n";
}
-
+
return $maketext;
}
use strict;
use vars qw($VERSION);
-$VERSION = '0.35_08';
+$VERSION = '0.35_09';
$VERSION = eval $VERSION;
use Config;
package Module::Build::Cookbook;
use strict;
use vars qw($VERSION);
-$VERSION = '0.35_08';
+$VERSION = '0.35_09';
=head1 NAME
# Find out what version of Module::Build is installed or fail quietly.
# This should be cross-platform.
- my $Installed_MB =
+ my $Installed_MB =
`$^X -e "eval q{require Module::Build; print Module::Build->VERSION} or exit 1";
# some operating systems put a newline at the end of every print.
package Module::Build::Dumper;
use strict;
use vars qw($VERSION);
-$VERSION = '0.35_08';
+$VERSION = '0.35_09';
# This is just a split-out of a wrapper function to do Data::Dumper
# stuff "the right way". See:
use strict;
use vars qw($VERSION);
-$VERSION = '0.35_08';
+$VERSION = '0.35_09';
$VERSION = eval $VERSION;
use File::Spec;
\s+ # whitespace
([\w:]+) # a package name
\s* # optional whitespace
- ($V_NUM_REGEXP)? # optional version number
+ ($V_NUM_REGEXP)? # optional version number
\s* # optional whitesapce
; # semicolon line terminator
}x;
$need_vers = 0 if $vers_pkg eq $pkg;
unless ( defined $vers{$vers_pkg} && length $vers{$vers_pkg} ) {
- $vers{$vers_pkg} =
+ $vers{$vers_pkg} =
$self->_evaluate_version_line( $vers_sig, $vers_fullname, $line );
} else {
# Warn unless the user is using the "$VERSION = eval
(ref($vsub) eq 'CODE') or
die "failed to build version sub for $self->{filename}";
my $result = eval { $vsub->() };
- die "Could not get version from $self->{filename} by executing:\n$eval\n\nThe fatal error was: $@\n"
+ die "Could not get version from $self->{filename} by executing:\n$eval\n\nThe fatal error was: $@\n"
if $@;
# Activestate apparently creates custom versions like '1.23_45_01', which
# Bless it into our own version class
eval { $result = Module::Build::Version->new($result) };
- die "Version '$result' from $self->{filename} does not appear to be valid:\n$eval\n\nThe fatal error was: $@\n"
+ die "Version '$result' from $self->{filename} does not appear to be valid:\n$eval\n\nThe fatal error was: $@\n"
if $@;
return $result;
use strict;
use vars qw($VERSION);
-$VERSION = '0.35_08';
+$VERSION = '0.35_09';
$VERSION = eval $VERSION;
use Data::Dumper;
use IO::File;
sub access {
my $self = shift;
return $self->read() unless @_;
-
+
my $key = shift;
return $self->read($key) unless @_;
-
+
my $value = shift;
$self->write({ $key => $value });
return $self->read($key);
return $self->{new}{$key} if exists $self->{new}{$key};
return $self->{disk}{$key};
}
-
+
# Return all data
my $out = (keys %{$self->{new}}
? {%{$self->{disk}}, %{$self->{new}}}
sub write {
my ($self, $href) = @_;
$href ||= {};
-
+
@{$self->{new}}{ keys %$href } = values %$href; # Merge
# Do some optimization to avoid unnecessary writes
next if ref $self->{disk}{$key} or !exists $self->{disk}{$key};
delete $self->{new}{$key} if $self->_same($self->{new}{$key}, $self->{disk}{$key});
}
-
+
if (my $file = $self->{file}) {
my ($vol, $dir, $base) = File::Spec->splitpath($file);
$dir = File::Spec->catpath($vol, $dir, '');
return unless -e $dir && -d $dir; # The user needs to arrange for this
return if -e $file and !keys %{ $self->{new} }; # Nothing to do
-
- @{$self->{disk}}{ keys %{$self->{new}} } = values %{$self->{new}}; # Merge
+
+ @{$self->{disk}}{ keys %{$self->{new}} } = values %{$self->{new}}; # Merge
$self->_dump($file, $self->{disk});
-
+
$self->{new} = {};
}
return $self->read;
sub _dump {
my ($self, $file, $data) = @_;
-
+
my $fh = IO::File->new("> $file") or die "Can't create '$file': $!";
print {$fh} Module::Build::Dumper->_data_dump($data);
}
# strip out private POD markers we use to keep pod from being
# 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}': $!";
print {$fh} $template;
print {$fh} "\n__DATA__\n";
sub feature {
my ($package, $key) = @_;
return $features->{$key} if exists $features->{$key};
-
+
my $info = $auto_features->{$key} or return 0;
-
+
# Under perl 5.005, each(%$foo) isn't working correctly when $foo
# was reanimated with Data::Dumper and eval(). Not sure why, but
# copying to a new hash seems to solve it.
my %info = %$info;
-
+
require Module::Build; # XXX should get rid of this
while (my ($type, $prereqs) = each %info) {
next if $type eq 'description' || $type eq 'recommends';
-
+
my %p = %$prereqs; # Ditto here.
while (my ($modname, $spec) = each %p) {
my $status = Module::Build->check_installed_status($modname, $spec);
use NOTES_NAME;
$value = NOTES_NAME->config('foo');
$value = NOTES_NAME->feature('bar');
-
+
@names = NOTES_NAME->config_names;
@names = NOTES_NAME->feature_names;
-
+
NOTES_NAME->set_config(foo => $new_value);
NOTES_NAME->set_feature(bar => $new_value);
NOTES_NAME->write; # Save changes
use strict;
use Config;
use vars qw($VERSION);
-$VERSION = '0.35_08';
+$VERSION = '0.35_09';
$VERSION = eval $VERSION;
# This code is mostly borrowed from ExtUtils::MM_Unix 6.10_03, with a
'<' => '<',
);
my $rx = join '|', keys %escapes;
-
+
sub _simple_xml_escape {
$_[1] =~ s/($rx)/$escapes{$1}/go;
}
use strict;
use vars qw($VERSION);
-$VERSION = '0.35_08';
+$VERSION = '0.35_09';
$VERSION = eval $VERSION;
use Module::Build::Base;
use strict;
use vars qw($VERSION);
-$VERSION = '0.35_08';
+$VERSION = '0.35_09';
$VERSION = eval $VERSION;
use Module::Build::Base;
use strict;
use vars qw($VERSION);
-$VERSION = '0.35_08';
+$VERSION = '0.35_09';
$VERSION = eval $VERSION;
use Module::Build::Base;
use strict;
use vars qw($VERSION);
-$VERSION = '0.35_08';
+$VERSION = '0.35_09';
$VERSION = eval $VERSION;
use Module::Build::Base;
use strict;
use vars qw($VERSION);
-$VERSION = '0.35_08';
+$VERSION = '0.35_09';
$VERSION = eval $VERSION;
use Module::Build::Base;
use vars qw(@ISA);
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
-
+
# $Config{sitelib} and $Config{sitearch} are, unfortunately, missing.
foreach ('sitelib', 'sitearch') {
$self->config($_ => $self->config("install$_"))
unless $self->config($_);
}
-
+
# For some reason $Config{startperl} is filled with a bunch of crap.
(my $sp = $self->config('startperl')) =~ s/.*Exit \{Status\}\s//;
$self->config(startperl => $sp);
-
+
return $self;
}
if( !@_ and !@ARGV ) {
require MacPerl;
-
+
# What comes first in the action list.
my @action_list = qw(build test install);
my %actions = map {+($_, 1)} $self->known_actions;
foreach (@action_list) {
$_ .= ' *' if $toolserver{$_};
}
-
+
my $cmd = MacPerl::Pick("What build command? ('*' requires ToolServer)", @action_list);
return unless defined $cmd;
$cmd =~ s/ \*$//;
$ARGV[0] = ($cmd);
-
+
my $args = MacPerl::Ask('Any extra arguments? (ie. verbose=1)', '');
return unless defined $args;
push @ARGV, $self->split_like_shell($args);
}
-
+
$self->SUPER::dispatch(@_);
}
sub ACTION_install {
my $self = shift;
-
+
return $self->SUPER::ACTION_install(@_)
if eval {ExtUtils::Install->VERSION('1.30'); 1};
-
+
local $^W = 0; # Avoid a 'redefine' warning
local *ExtUtils::Install::find = sub {
my ($code, @dirs) = @_;
return File::Find::find($code, @dirs);
};
-
+
return $self->SUPER::ACTION_install(@_);
}
use strict;
use vars qw($VERSION);
-$VERSION = '0.35_08';
+$VERSION = '0.35_09';
$VERSION = eval $VERSION;
use Module::Build::Base;
use strict;
use vars qw($VERSION);
-$VERSION = '0.35_08';
+$VERSION = '0.35_09';
$VERSION = eval $VERSION;
use Module::Build::Base;
use strict;
use vars qw($VERSION);
-$VERSION = '0.35_08';
+$VERSION = '0.35_09';
$VERSION = eval $VERSION;
use Module::Build::Base;
# or if we get a single arg that is an array reference, quote the
# elements of it and return the reference.
my ($self, @args) = @_;
- my $got_arrayref = (scalar(@args) == 1
- && UNIVERSAL::isa($args[0], 'ARRAY'))
- ? 1
+ my $got_arrayref = (scalar(@args) == 1
+ && UNIVERSAL::isa($args[0], 'ARRAY'))
+ ? 1
: 0;
# Do not quote qualifiers that begin with '/'.
- map { if (!/^\//) {
+ map { if (!/^\//) {
$_ =~ s/\"/""/g; # escape C<"> by doubling
$_ = q(").$_.q(");
}
}
- ($got_arrayref ? @{$args[0]}
+ ($got_arrayref ? @{$args[0]}
: @args
);
- return $got_arrayref ? $args[0]
+ return $got_arrayref ? $args[0]
: join(' ', @args);
}
=item _infer_xs_spec
-Inherit the standard version but tweak the library file name to be
+Inherit the standard version but tweak the library file name to be
something Dynaloader can find.
=cut
=item dist_dir
-Inherit the standard version but replace embedded dots with underscores because
+Inherit the standard version but replace embedded dots with underscores because
a dot is the directory delimiter on VMS.
=cut
=item man3page_name
-Inherit the standard version but chop the extra manpage delimiter off the front if
+Inherit the standard version but chop the extra manpage delimiter off the front if
there is one. The VMS version of splitdir('[.foo]') returns '', 'foo'.
=cut
$newdirs = File::Spec::Unix->catdir(@hdirs, @backup, @dirs);
}
-
+
# Now put the two cases back together
$arg = File::Spec::Unix->catpath($hvol, $newdirs, $file);
$unix_rpt = VMS::Feature::current("filename_unix_report");
} else {
my $env_unix_rpt = $ENV{'DECC$FILENAME_UNIX_REPORT'} || '';
- $unix_rpt = $env_unix_rpt =~ /^[ET1]/i;
+ $unix_rpt = $env_unix_rpt =~ /^[ET1]/i;
}
return $unix_rpt;
}
$efs = VMS::Feature::current("efs_charset");
} else {
my $env_efs = $ENV{'DECC$EFS_CHARSET'} || '';
- $efs = $env_efs =~ /^[ET1]/i;
+ $efs = $env_efs =~ /^[ET1]/i;
}
return $efs;
}
use strict;
use vars qw($VERSION);
-$VERSION = '0.35_08';
+$VERSION = '0.35_09';
$VERSION = eval $VERSION;
use Module::Build::Base;
use strict;
use vars qw($VERSION);
-$VERSION = '0.35_08';
+$VERSION = '0.35_09';
$VERSION = eval $VERSION;
use Config;
# into words. The algorithm below was bashed out by Randy and Ken
# (mostly Randy), and there are a lot of regression tests, so we
# should feel free to adjust if desired.
-
+
(my $self, local $_) = @_;
-
+
return @$_ if defined() && UNIVERSAL::isa($_, 'ARRAY');
-
+
my @argv;
return @argv unless defined() && length();
-
+
my $arg = '';
my( $i, $quote_mode ) = ( 0, 0 );
-
+
while ( $i < length() ) {
-
+
my $ch = substr( $_, $i , 1 );
my $next_ch = substr( $_, $i+1, 1 );
-
+
if ( $ch eq '\\' && $next_ch eq '"' ) {
$arg .= '"';
$i++;
} else {
$arg .= $ch;
}
-
+
$i++;
}
-
+
push( @argv, $arg ) if defined( $arg ) && length( $arg );
return @argv;
}
use strict;
use vars qw($VERSION);
-$VERSION = '0.35_08';
+$VERSION = '0.35_09';
$VERSION = eval $VERSION;
use Module::Build::Platform::Unix;
use strict;
use vars qw($VERSION);
-$VERSION = '0.35_08';
+$VERSION = '0.35_09';
$VERSION = eval $VERSION;
use Module::Build::Platform::Unix;
use strict;
use vars qw($VERSION);
-$VERSION = '0.35_08';
+$VERSION = '0.35_09';
$VERSION = eval $VERSION;
use Module::Build::Platform::Unix;
use strict;
use vars qw($VERSION);
-$VERSION = '0.35_08';
+$VERSION = '0.35_09';
$VERSION = eval $VERSION;
use Module::Build::Platform::Unix;
use strict;
use vars qw($VERSION);
-$VERSION = '0.35_08';
+$VERSION = '0.35_09';
$VERSION = eval $VERSION;
use vars qw(@ISA);
sub _myparse_from_filehandle {
my ($self, $fh) = @_;
-
+
local $_;
while (<$fh>) {
next unless /^=(?!cut)/ .. /^=cut/; # in POD
last if ($self->{abstract}) = /^ (?: [a-z:]+ \s+ - \s+ ) (.*\S) /ix;
}
-
+
my @author;
while (<$fh>) {
next unless /^=head1\s+AUTHORS?/i ... /^=/;
}
return unless @author;
s/^\s+|\s+$//g foreach @author;
-
+
$self->{author} = \@author;
-
+
return;
}
sub get_abstract {
my $self = shift;
return $self->{abstract} if defined $self->{abstract};
-
+
$self->parse_from_filehandle($self->{fh});
return $self->{abstract};
sub get_author {
my $self = shift;
return $self->{author} if defined $self->{author};
-
+
$self->parse_from_filehandle($self->{fh});
return $self->{author} || [];
map { $args{$_} = 1 } @_
}
else { # no parameters at all on use line
- args =
+ %args =
(
qv => 1,
'UNIVERSAL::VERSION' => 1,
}
my $callpkg = caller();
-
+
if (exists($args{declare})) {
- *{$callpkg."::declare"} =
+ *{$callpkg."::declare"} =
sub {return $class->declare(shift) }
unless defined(&{$callpkg.'::declare'});
}
{
my ($class, $value) = @_;
my $self = bless ({}, ref ($class) || $class);
-
+
if ( ref($value) && eval('$value->isa("version")') ) {
# Can copy the elements directly
$self->{version} = [ @{$value->{version} } ];
$value = sprintf("%.9f",$value);
$value =~ s/(0+)$//; # trim trailing zeros
}
-
+
# This is not very efficient, but it is morally equivalent
# to the XS code (as that is the reference implementation).
# See vutil/vutil.c for details
}
$start = $last = $pos = $s;
-
+
# pre-scan the input string to check for decimals/underbars
while ( substr($value,$pos,1) =~ /[._\d,]/ ) {
if ( substr($value,$pos,1) eq '.' ) {
$orev = $rev;
$rev += substr($value,$s,1) * $mult;
$mult /= 10;
- if ( abs($orev) > abs($rev)
+ if ( abs($orev) > abs($rev)
|| abs($rev) > abs($VERSION_MAX) ) {
if ( warnings::enabled("overflow") ) {
require Carp;
$orev = $rev;
$rev += substr($value,$end,1) * $mult;
$mult *= 10;
- if ( abs($orev) > abs($rev)
+ if ( abs($orev) > abs($rev)
|| abs($rev) > abs($VERSION_MAX) ) {
if ( warnings::enabled("overflow") ) {
require Carp;
# Append revision
push @{$self->{version}}, $rev;
- if ( substr($value,$pos,1) eq '.'
+ if ( substr($value,$pos,1) eq '.'
&& substr($value,$pos+1,1) =~ /\d/ ) {
$s = ++$pos;
}
- elsif ( substr($value,$pos,1) eq '_'
+ elsif ( substr($value,$pos,1) eq '_'
&& substr($value,$pos+1,1) =~ /\d/ ) {
$s = ++$pos;
}
- elsif ( substr($value,$pos,1) eq ','
+ elsif ( substr($value,$pos,1) eq ','
&& substr($value,$pos+1,1) =~ /\d/ ) {
$s = ++$pos;
}
*parse = \&new;
-sub numify
+sub numify
{
my ($self) = @_;
unless (_verify($self)) {
return $string;
}
-sub normal
+sub normal
{
my ($self) = @_;
unless (_verify($self)) {
require Carp;
Carp::croak("Invalid version object");
}
- return exists $self->{original}
- ? $self->{original}
- : exists $self->{qv}
+ return exists $self->{original}
+ ? $self->{original}
+ : exists $self->{qv}
? $self->normal
: $self->numify;
}
}
# tiebreaker for alpha with identical terms
- if ( $retval == 0
- && $l == $r
+ if ( $retval == 0
+ && $l == $r
&& $left->{version}[$m] == $right->{version}[$m]
&& ( $lalpha || $ralpha ) ) {
}
}
- return $retval;
+ return $retval;
}
sub vbool {
return vcmp($self,$self->new("0"),1);
}
-sub vnoop {
- require Carp;
+sub vnoop {
+ require Carp;
Carp::croak("operation not supported with version object");
}
if ( defined $req ) {
unless ( defined $version ) {
require Carp;
- my $msg = $] < 5.006
+ my $msg = $] < 5.006
? "$class version $req required--this is only version "
: "$class does not define \$$class\::VERSION"
."--version check failed";
if ( $req > $version ) {
require Carp;
if ( $req->is_qv ) {
- Carp::croak(
+ Carp::croak(
sprintf ("%s version %s required--".
"this is only version %s", $class,
$req->normal, $version->normal)
);
}
else {
- Carp::croak(
+ Carp::croak(
sprintf ("%s version %s required--".
"this is only version %s", $class,
$req->stringify, $version->stringify)
# Class structure
require 5.004;
-
+
$Module::Build::YAML::VERSION = '1.40';
# Error storage
if ( wantarray ) {
return @$self;
} else {
- # Return only the last document to match YAML.pm,
+ # Return only the last document to match YAML.pm,
return $self->[-1];
}
}
package inc::latest;
use strict;
use vars qw($VERSION);
-$VERSION = '0.35_08';
+$VERSION = '0.35_09';
$VERSION = eval $VERSION;
use Carp;
goto $import;
}
- # author mode - just record and load the modules
+ # author mode - just record and load the modules
push(@loaded_modules, $mod);
require inc::latest::private;
goto \&inc::latest::private::_load_module;
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");
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).
+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
package inc::latest::private;
use strict;
use vars qw($VERSION);
-$VERSION = '0.35_08';
+$VERSION = '0.35_09';
$VERSION = eval $VERSION;
use File::Spec;
# 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
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;
);
# Force bundled M::B to a higher version so it gets loaded
-
-my $fh = IO::File->new($mb_file, "+<") or die "Could not open $mb_file: $!";
-my $mb_code = do { local $/; <$fh> };
-$mb_code =~ s{\$VERSION\s+=\s+\S+}{\$VERSION = 9999;};
-$fh->seek(0,0);
-print {$fh} $mb_code;
-$fh->close;
-
-# test the bundling in dist_dir
-chdir $mb->dist_dir;
-
-stdout_of( sub { Module::Build->run_perl_script('Build.PL',[],[]) } );
-
-my $meta = IO::File->new('MYMETA.yml');
-ok( $meta, "found MYMETA.yml" );
-ok( scalar( grep { /generated_by:.*9999/ } <$meta> ),
- "dist_dir Build.PL loaded bundled Module::Build"
-);
-
-#--------------------------------------------------------------------------#
-# test identification of dependencies
-#--------------------------------------------------------------------------#
-
-$dist->chdir_in;
-
-$dist->add_file( 'mylib/Foo.pm', << 'HERE' );
+# This has failed on Win32 for no known reason, so we'll skip if
+# we can't edit the file.
+
+eval {
+ my $fh;
+ $fh = IO::File->new($mb_file, "<") or die "Could not read $mb_file: $!";
+ my $mb_code = do { local $/; <$fh> };
+ $mb_code =~ s{\$VERSION\s+=\s+\S+}{\$VERSION = 9999;};
+ $fh->close;
+ $fh = IO::File->new($mb_file, ">") or die "Could not write $mb_file: $!";
+ print {$fh} $mb_code;
+ $fh->close;
+};
+
+my $err = $@;
+diag $@ if $@;
+SKIP: {
+ skip "Couldn't adjust \$VERSION in bundled M::B for testing", 10
+ if $err;
+
+ # test the bundling in dist_dir
+ chdir $mb->dist_dir;
+
+ stdout_of( sub { Module::Build->run_perl_script('Build.PL',[],[]) } );
+
+ my $meta = IO::File->new('MYMETA.yml');
+ ok( $meta, "found MYMETA.yml" );
+ ok( scalar( grep { /generated_by:.*9999/ } <$meta> ),
+ "dist_dir Build.PL loaded bundled Module::Build"
+ );
+
+ #--------------------------------------------------------------------------#
+ # test identification of dependencies
+ #--------------------------------------------------------------------------#
+
+ $dist->chdir_in;
+
+ $dist->add_file( 'mylib/Foo.pm', << 'HERE' );
package Foo;
our $VERSION = 1;
1;
HERE
-$dist->add_file( 'mylib/Bar.pm', << 'HERE' );
+ $dist->add_file( 'mylib/Bar.pm', << 'HERE' );
package Bar;
use Foo;
our $VERSION = 42;
1;
HERE
-$dist->change_file( 'Build.PL', << "HERE" );
+ $dist->change_file( 'Build.PL', << "HERE" );
use inc::latest 'Module::Build';
use inc::latest 'Foo';
)->create_build_script;
HERE
-$dist->regen( clean => 1 );
+ $dist->regen( clean => 1 );
-make_packlist($_,'mylib') for qw/Foo Bar/;
+ make_packlist($_,'mylib') for qw/Foo Bar/;
-# get a Module::Build object and test with it
-my $abs_mylib = File::Spec->rel2abs('mylib');
+ # get a Module::Build object and test with it
+ my $abs_mylib = File::Spec->rel2abs('mylib');
-unshift @INC, $abs_mylib;
-$mb = $dist->new_from_context(); # quiet by default
-isa_ok( $mb, "Module::Build" );
-is_deeply( [sort @{$mb->bundle_inc}], [ 'Foo', 'Module::Build' ],
- "Module::Build and Foo are flagged for bundling"
-);
+ unshift @INC, $abs_mylib;
+ $mb = $dist->new_from_context(); # quiet by default
+ isa_ok( $mb, "Module::Build" );
+ is_deeply( [sort @{$mb->bundle_inc}], [ 'Foo', 'Module::Build' ],
+ "Module::Build and Foo are flagged for bundling"
+ );
-my $output = stdout_stderr_of( sub { $mb->dispatch('distdir') } );
+ my $output = stdout_stderr_of( sub { $mb->dispatch('distdir') } );
-ok( -e File::Spec->catfile( $dist_inc, 'latest.pm' ),
- "./inc/latest.pm created"
-);
+ ok( -e File::Spec->catfile( $dist_inc, 'latest.pm' ),
+ "./inc/latest.pm created"
+ );
-ok( -d File::Spec->catdir( $dist_inc, 'inc_Foo' ),
- "dist_dir/inc/inc_Foo created"
-);
+ ok( -d File::Spec->catdir( $dist_inc, 'inc_Foo' ),
+ "dist_dir/inc/inc_Foo created"
+ );
-$dist->change_file( 'Build.PL', << "HERE" );
+ $dist->change_file( 'Build.PL', << "HERE" );
use inc::latest 'Module::Build';
use inc::latest 'Bar';
)->create_build_script;
HERE
-$dist->regen( clean => 1 );
-make_packlist($_,'mylib') for qw/Foo Bar/;
+ $dist->regen( clean => 1 );
+ make_packlist($_,'mylib') for qw/Foo Bar/;
-$mb = $dist->new_from_context(); # quiet by default
-isa_ok( $mb, "Module::Build" );
-is_deeply( [sort @{$mb->bundle_inc}], [ 'Bar', 'Module::Build' ],
- "Module::Build and Bar are flagged for bundling"
-);
+ $mb = $dist->new_from_context(); # quiet by default
+ isa_ok( $mb, "Module::Build" );
+ is_deeply( [sort @{$mb->bundle_inc}], [ 'Bar', 'Module::Build' ],
+ "Module::Build and Bar are flagged for bundling"
+ );
-$output = stdout_stderr_of( sub { $mb->dispatch('distdir') } );
+ $output = stdout_stderr_of( sub { $mb->dispatch('distdir') } );
-ok( -e File::Spec->catfile( $dist_inc, 'latest.pm' ),
- "./inc/latest.pm created"
-);
-
-ok( -d File::Spec->catdir( $dist_inc, 'inc_Bar' ),
- "dist_dir/inc/inc_Bar created"
-);
+ ok( -e File::Spec->catfile( $dist_inc, 'latest.pm' ),
+ "./inc/latest.pm created"
+ );
+ ok( -d File::Spec->catdir( $dist_inc, 'inc_Bar' ),
+ "dist_dir/inc/inc_Bar created"
+ );
+}
sub make_packlist {
########################################################################
# always return to the current directory
-{
+{
my $cwd = File::Spec->rel2abs(Cwd::cwd);
sub original_cwd { return $cwd }
return;
}
-# returns ($have_c_compiler, $C_support_feature);
sub check_compiler {
return (1,1) if $ENV{PERL_CORE};
);
$tmp_exec = 0 == system( $exe );
}
- return ($have_c_compiler, $mb->feature('C_support'), $tmp_exec);
+ return ($have_c_compiler, $tmp_exec);
}
sub have_module {
my $manpage_support = Module::Build::ConfigData->feature('manpage_support');
my $HTML_support = Module::Build::ConfigData->feature('HTML_support');
+my $tmp;
+
{
- my ($have_c_compiler, $C_support_feature) = check_compiler();
- if (! $C_support_feature) {
- plan skip_all => 'C_support not enabled';
- } elsif ( ! $have_c_compiler ) {
- plan skip_all => 'C_support enabled, but no compiler found';
+ my ($have_c_compiler, $tmp_exec) = check_compiler();
+ if ( ! $have_c_compiler ) {
+ plan skip_all => 'No compiler found';
} elsif ( !$Config{usedl} ) {
plan skip_all => 'Perl not compiled for dynamic loading'
} elsif ( ! eval {require Archive::Tar} ) {
} else {
plan tests => 12;
}
+ require Cwd;
+ $tmp = MBTest->tmpdir( $tmp_exec ? () : (DIR => Cwd::cwd) );
}
-my $tmp = MBTest->tmpdir;
-
use DistGen;
my $dist = DistGen->new( dir => $tmp, xs => 1 );
$dist->add_file( 'hello', <<'---' );
blib_load('Module::Build');
{
- my ($have_c_compiler, $C_support_feature, $tmp_exec) = check_compiler();
+ my ($have_c_compiler, $tmp_exec) = check_compiler();
- if (! $C_support_feature) {
- plan skip_all => 'C_support not enabled';
- } elsif ( !$have_c_compiler ) {
- plan skip_all => 'C_support enabled, but no compiler found';
+ if ( !$have_c_compiler ) {
+ plan skip_all => 'No compiler found';
} elsif ( $^O eq 'VMS' ) {
plan skip_all => 'Child test output confuses harness';
} elsif ( !$Config{usedl} ) {
}
{
- # Try again in a subprocess
+ # Try again in a subprocess
eval {$mb->dispatch('clean')};
is $@, '';