diff options
author | David Golden <dagolden@cpan.org> | 2009-11-19 08:04:04 -0500 |
---|---|---|
committer | David Golden <dagolden@cpan.org> | 2009-11-19 08:05:33 -0500 |
commit | 08fc25adb28b667408639f0458cda3d8f55bac70 (patch) | |
tree | e19864cd663a07354d11804ca790a22f569b037e /cpan | |
parent | 1fc7262d227d94438986ab803a17938da27ab057 (diff) | |
download | perl-08fc25adb28b667408639f0458cda3d8f55bac70.tar.gz |
Updated Module::Build to 0.35_09
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.
Diffstat (limited to 'cpan')
35 files changed, 281 insertions, 253 deletions
diff --git a/cpan/Module-Build/Changes b/cpan/Module-Build/Changes index f0f8d1b46d..bfc585f3cd 100644 --- a/cpan/Module-Build/Changes +++ b/cpan/Module-Build/Changes @@ -1,5 +1,30 @@ 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: diff --git a/cpan/Module-Build/lib/Module/Build.pm b/cpan/Module-Build/lib/Module/Build.pm index efae7f9abb..e8bd9b6306 100644 --- a/cpan/Module-Build/lib/Module/Build.pm +++ b/cpan/Module-Build/lib/Module/Build.pm @@ -15,7 +15,7 @@ use Module::Build::Base; 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 @@ -167,22 +167,22 @@ This illustrates initial configuration and the running of three '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 @@ -318,7 +318,7 @@ tarball of the files listed in F<MANIFEST> and compress the tarball using 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 @@ -559,7 +559,7 @@ for a bug report. [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. @@ -684,7 +684,7 @@ argument. [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. @@ -692,7 +692,7 @@ 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. diff --git a/cpan/Module-Build/lib/Module/Build/API.pod b/cpan/Module-Build/lib/Module/Build/API.pod index 1f5d51f777..7d269f3cb0 100644 --- a/cpan/Module-Build/lib/Module/Build/API.pod +++ b/cpan/Module-Build/lib/Module/Build/API.pod @@ -769,7 +769,7 @@ distribution-level share directory. Alternatively, C<share_dir> can be set to 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 => { diff --git a/cpan/Module-Build/lib/Module/Build/Base.pm b/cpan/Module-Build/lib/Module/Build/Base.pm index abeea2ef0a..5894ce51b3 100644 --- a/cpan/Module-Build/lib/Module/Build/Base.pm +++ b/cpan/Module-Build/lib/Module/Build/Base.pm @@ -4,7 +4,7 @@ package Module::Build::Base; use strict; use vars qw($VERSION); -$VERSION = '0.35_08'; +$VERSION = '0.35_09'; $VERSION = eval $VERSION; BEGIN { require 5.00503 } @@ -74,7 +74,9 @@ sub resume { 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 @@ -4314,6 +4316,7 @@ sub find_packages_in_files { 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 ); @@ -4798,8 +4801,6 @@ sub cbuilder { 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( diff --git a/cpan/Module-Build/lib/Module/Build/Bundling.pod b/cpan/Module-Build/lib/Module/Build/Bundling.pod index 0a60d8f70d..5e7b9f9807 100644 --- a/cpan/Module-Build/lib/Module/Build/Bundling.pod +++ b/cpan/Module-Build/lib/Module/Build/Bundling.pod @@ -5,7 +5,6 @@ Module::Build::Bundling - How to bundle Module::Build with a distribution =head1 SYNOPSIS # Build.PL - use lib '.'; use inc::latest 'Module::Build'; Module::Build->new( @@ -50,7 +49,6 @@ fields): A "bundling" Build.PL replaces the initial "use" line with a nearly transparent replacement: - use lib '.'; use inc::latest 'Module::Build'; Module::Build->new( @@ -58,11 +56,6 @@ transparent replacement: 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>. diff --git a/cpan/Module-Build/lib/Module/Build/Compat.pm b/cpan/Module-Build/lib/Module/Build/Compat.pm index ebe1b129cf..c8a3670333 100644 --- a/cpan/Module-Build/lib/Module/Build/Compat.pm +++ b/cpan/Module-Build/lib/Module/Build/Compat.pm @@ -2,7 +2,7 @@ package Module::Build::Compat; use strict; use vars qw($VERSION); -$VERSION = '0.35_08'; +$VERSION = '0.35_09'; use File::Basename (); use File::Spec; @@ -18,7 +18,7 @@ my %convert_installdirs = ( VENDOR => 'vendor', ); -my %makefile_to_build = +my %makefile_to_build = ( TEST_VERBOSE => 'verbose', VERBINST => 'verbose', @@ -89,18 +89,18 @@ sub _merge_prereq { } 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. @@ -120,7 +120,7 @@ HERE 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} ) { @@ -160,41 +160,41 @@ EOF } 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); @@ -202,27 +202,27 @@ EOF 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) { @@ -232,7 +232,7 @@ EOF local $Data::Dumper::Terse = 1; my $args = Data::Dumper::Dumper(\%MM_Args); $args =~ s/\{(.*)\}/($1)/s; - + print $fh <<"EOF"; use ExtUtils::MakeMaker; WriteMakefile @@ -250,7 +250,7 @@ sub _test_globs { sub subclass_dir { my ($self, $build) = @_; - + return (Module::Build::ModuleInfo->find_module_dir_by_name(ref $build) || File::Spec->catdir($build->config_dir, 'lib')); } @@ -265,7 +265,7 @@ sub makefile_to_build_args { my @out; foreach my $arg (@_) { next if $arg eq ''; - + my ($key, $val) = ($arg =~ /^(\w+)=(.+)/ ? ($1, $2) : die "Malformed argument '$arg'"); @@ -320,7 +320,7 @@ sub makefile_to_build_macros { } } } - push @out, (config => \%config) if %config; + push @out, (config => \%config) if %config; return @out; } @@ -379,19 +379,19 @@ $action : force_do_it $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; } diff --git a/cpan/Module-Build/lib/Module/Build/Config.pm b/cpan/Module-Build/lib/Module/Build/Config.pm index b833e2b183..49b5881dc1 100644 --- a/cpan/Module-Build/lib/Module/Build/Config.pm +++ b/cpan/Module-Build/lib/Module/Build/Config.pm @@ -2,7 +2,7 @@ package Module::Build::Config; use strict; use vars qw($VERSION); -$VERSION = '0.35_08'; +$VERSION = '0.35_09'; $VERSION = eval $VERSION; use Config; diff --git a/cpan/Module-Build/lib/Module/Build/Cookbook.pm b/cpan/Module-Build/lib/Module/Build/Cookbook.pm index 42054d1744..a5182aeaf5 100644 --- a/cpan/Module-Build/lib/Module/Build/Cookbook.pm +++ b/cpan/Module-Build/lib/Module/Build/Cookbook.pm @@ -1,7 +1,7 @@ package Module::Build::Cookbook; use strict; use vars qw($VERSION); -$VERSION = '0.35_08'; +$VERSION = '0.35_09'; =head1 NAME @@ -487,7 +487,7 @@ Next, add this to the top of your F<Build.PL>. # 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. diff --git a/cpan/Module-Build/lib/Module/Build/Dumper.pm b/cpan/Module-Build/lib/Module/Build/Dumper.pm index 6f8ff7a616..12d63d581a 100644 --- a/cpan/Module-Build/lib/Module/Build/Dumper.pm +++ b/cpan/Module-Build/lib/Module/Build/Dumper.pm @@ -1,7 +1,7 @@ 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: diff --git a/cpan/Module-Build/lib/Module/Build/ModuleInfo.pm b/cpan/Module-Build/lib/Module/Build/ModuleInfo.pm index 12ffa1d711..90e4bb43c2 100644 --- a/cpan/Module-Build/lib/Module/Build/ModuleInfo.pm +++ b/cpan/Module-Build/lib/Module/Build/ModuleInfo.pm @@ -8,7 +8,7 @@ package Module::Build::ModuleInfo; use strict; use vars qw($VERSION); -$VERSION = '0.35_08'; +$VERSION = '0.35_09'; $VERSION = eval $VERSION; use File::Spec; @@ -23,7 +23,7 @@ my $PKG_REGEXP = qr{ # match a package declaration \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; @@ -235,7 +235,7 @@ sub _parse_fh { $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 @@ -326,7 +326,7 @@ sub _evaluate_version_line { (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 @@ -340,7 +340,7 @@ sub _evaluate_version_line { # 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; diff --git a/cpan/Module-Build/lib/Module/Build/Notes.pm b/cpan/Module-Build/lib/Module/Build/Notes.pm index a0506c64dc..9b48f4c077 100644 --- a/cpan/Module-Build/lib/Module/Build/Notes.pm +++ b/cpan/Module-Build/lib/Module/Build/Notes.pm @@ -4,7 +4,7 @@ package Module::Build::Notes; use strict; use vars qw($VERSION); -$VERSION = '0.35_08'; +$VERSION = '0.35_09'; $VERSION = eval $VERSION; use Data::Dumper; use IO::File; @@ -33,10 +33,10 @@ sub restore { 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); @@ -61,7 +61,7 @@ sub read { 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}}} @@ -79,7 +79,7 @@ sub _same { sub write { my ($self, $href) = @_; $href ||= {}; - + @{$self->{new}}{ keys %$href } = values %$href; # Merge # Do some optimization to avoid unnecessary writes @@ -88,17 +88,17 @@ sub write { 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; @@ -106,7 +106,7 @@ sub write { 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); } @@ -126,7 +126,7 @@ sub write_config_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"; @@ -218,18 +218,18 @@ sub write { 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); @@ -251,10 +251,10 @@ NOTES_NAME - Configuration for MODULE_NAME 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 diff --git a/cpan/Module-Build/lib/Module/Build/PPMMaker.pm b/cpan/Module-Build/lib/Module/Build/PPMMaker.pm index 74a5a73b07..8567626cdd 100644 --- a/cpan/Module-Build/lib/Module/Build/PPMMaker.pm +++ b/cpan/Module-Build/lib/Module/Build/PPMMaker.pm @@ -3,7 +3,7 @@ package Module::Build::PPMMaker; 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 @@ -137,7 +137,7 @@ sub _varchname { # Copied from PPM.pm '<' => '<', ); my $rx = join '|', keys %escapes; - + sub _simple_xml_escape { $_[1] =~ s/($rx)/$escapes{$1}/go; } diff --git a/cpan/Module-Build/lib/Module/Build/Platform/Amiga.pm b/cpan/Module-Build/lib/Module/Build/Platform/Amiga.pm index b31a9635ec..1b796d42c0 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/Amiga.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/Amiga.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::Amiga; use strict; use vars qw($VERSION); -$VERSION = '0.35_08'; +$VERSION = '0.35_09'; $VERSION = eval $VERSION; use Module::Build::Base; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/Default.pm b/cpan/Module-Build/lib/Module/Build/Platform/Default.pm index b0e83a3d73..6c9391621d 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/Default.pm +++ b/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.35_08'; +$VERSION = '0.35_09'; $VERSION = eval $VERSION; use Module::Build::Base; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/EBCDIC.pm b/cpan/Module-Build/lib/Module/Build/Platform/EBCDIC.pm index 4365b12b31..25fb528d9d 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/EBCDIC.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/EBCDIC.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::EBCDIC; use strict; use vars qw($VERSION); -$VERSION = '0.35_08'; +$VERSION = '0.35_09'; $VERSION = eval $VERSION; use Module::Build::Base; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/MPEiX.pm b/cpan/Module-Build/lib/Module/Build/Platform/MPEiX.pm index c7353783dd..3d44c520d0 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/MPEiX.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/MPEiX.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::MPEiX; use strict; use vars qw($VERSION); -$VERSION = '0.35_08'; +$VERSION = '0.35_09'; $VERSION = eval $VERSION; use Module::Build::Base; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/MacOS.pm b/cpan/Module-Build/lib/Module/Build/Platform/MacOS.pm index 2c74942857..8a35afb658 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/MacOS.pm +++ b/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.35_08'; +$VERSION = '0.35_09'; $VERSION = eval $VERSION; use Module::Build::Base; use vars qw(@ISA); @@ -15,17 +15,17 @@ sub have_forkpipe { 0 } 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; } @@ -42,7 +42,7 @@ sub dispatch { 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; @@ -53,17 +53,17 @@ sub dispatch { 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(@_); } @@ -82,10 +82,10 @@ sub ACTION_realclean { 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) = @_; @@ -94,7 +94,7 @@ sub ACTION_install { return File::Find::find($code, @dirs); }; - + return $self->SUPER::ACTION_install(@_); } diff --git a/cpan/Module-Build/lib/Module/Build/Platform/RiscOS.pm b/cpan/Module-Build/lib/Module/Build/Platform/RiscOS.pm index 9deb097963..cad70baabf 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/RiscOS.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/RiscOS.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::RiscOS; use strict; use vars qw($VERSION); -$VERSION = '0.35_08'; +$VERSION = '0.35_09'; $VERSION = eval $VERSION; use Module::Build::Base; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/Unix.pm b/cpan/Module-Build/lib/Module/Build/Platform/Unix.pm index 43f585fd4f..3e7d79ab97 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/Unix.pm +++ b/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.35_08'; +$VERSION = '0.35_09'; $VERSION = eval $VERSION; use Module::Build::Base; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/VMS.pm b/cpan/Module-Build/lib/Module/Build/Platform/VMS.pm index 13d350d8ff..a17c8f46e9 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/VMS.pm +++ b/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.35_08'; +$VERSION = '0.35_09'; $VERSION = eval $VERSION; use Module::Build::Base; @@ -131,22 +131,22 @@ sub _quote_args { # 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); } @@ -261,7 +261,7 @@ sub oneliner { =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 @@ -306,7 +306,7 @@ sub rscan_dir { =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 @@ -321,7 +321,7 @@ sub dist_dir { =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 @@ -423,7 +423,7 @@ sub _detildefy { $newdirs = File::Spec::Unix->catdir(@hdirs, @backup, @dirs); } - + # Now put the two cases back together $arg = File::Spec::Unix->catpath($hvol, $newdirs, $file); @@ -502,7 +502,7 @@ sub _unix_rpt { $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; } @@ -515,7 +515,7 @@ sub _efs { $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; } diff --git a/cpan/Module-Build/lib/Module/Build/Platform/VOS.pm b/cpan/Module-Build/lib/Module/Build/Platform/VOS.pm index 2061b2cacb..02b2dcc5c9 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/VOS.pm +++ b/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.35_08'; +$VERSION = '0.35_09'; $VERSION = eval $VERSION; use Module::Build::Base; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/Windows.pm b/cpan/Module-Build/lib/Module/Build/Platform/Windows.pm index fcaef5a409..d5602c5b20 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/Windows.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/Windows.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::Windows; use strict; use vars qw($VERSION); -$VERSION = '0.35_08'; +$VERSION = '0.35_09'; $VERSION = eval $VERSION; use Config; @@ -207,22 +207,22 @@ sub split_like_shell { # 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++; @@ -249,10 +249,10 @@ sub split_like_shell { } else { $arg .= $ch; } - + $i++; } - + push( @argv, $arg ) if defined( $arg ) && length( $arg ); return @argv; } diff --git a/cpan/Module-Build/lib/Module/Build/Platform/aix.pm b/cpan/Module-Build/lib/Module/Build/Platform/aix.pm index 7ba3c322b6..a5db1c5711 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/aix.pm +++ b/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.35_08'; +$VERSION = '0.35_09'; $VERSION = eval $VERSION; use Module::Build::Platform::Unix; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/cygwin.pm b/cpan/Module-Build/lib/Module/Build/Platform/cygwin.pm index 8b882ed293..c176c3954f 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/cygwin.pm +++ b/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.35_08'; +$VERSION = '0.35_09'; $VERSION = eval $VERSION; use Module::Build::Platform::Unix; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/darwin.pm b/cpan/Module-Build/lib/Module/Build/Platform/darwin.pm index 145933d478..d9a82788a4 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/darwin.pm +++ b/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.35_08'; +$VERSION = '0.35_09'; $VERSION = eval $VERSION; use Module::Build::Platform::Unix; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/os2.pm b/cpan/Module-Build/lib/Module/Build/Platform/os2.pm index b6615c82c3..194dd8523f 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/os2.pm +++ b/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.35_08'; +$VERSION = '0.35_09'; $VERSION = eval $VERSION; use Module::Build::Platform::Unix; diff --git a/cpan/Module-Build/lib/Module/Build/PodParser.pm b/cpan/Module-Build/lib/Module/Build/PodParser.pm index 7a94e772ed..bb34b2b0b3 100644 --- a/cpan/Module-Build/lib/Module/Build/PodParser.pm +++ b/cpan/Module-Build/lib/Module/Build/PodParser.pm @@ -2,7 +2,7 @@ package Module::Build::PodParser; use strict; use vars qw($VERSION); -$VERSION = '0.35_08'; +$VERSION = '0.35_09'; $VERSION = eval $VERSION; use vars qw(@ISA); @@ -33,13 +33,13 @@ sub new { 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 ... /^=/; @@ -48,16 +48,16 @@ sub _myparse_from_filehandle { } 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}; @@ -66,7 +66,7 @@ sub get_abstract { sub get_author { my $self = shift; return $self->{author} if defined $self->{author}; - + $self->parse_from_filehandle($self->{fh}); return $self->{author} || []; diff --git a/cpan/Module-Build/lib/Module/Build/Version.pm b/cpan/Module-Build/lib/Module/Build/Version.pm index 4a1b961fbd..0664d432ab 100644 --- a/cpan/Module-Build/lib/Module/Build/Version.pm +++ b/cpan/Module-Build/lib/Module/Build/Version.pm @@ -81,7 +81,7 @@ sub import { map { $args{$_} = 1 } @_ } else { # no parameters at all on use line - args = + %args = ( qv => 1, 'UNIVERSAL::VERSION' => 1, @@ -89,9 +89,9 @@ sub import { } my $callpkg = caller(); - + if (exists($args{declare})) { - *{$callpkg."::declare"} = + *{$callpkg."::declare"} = sub {return $class->declare(shift) } unless defined(&{$callpkg.'::declare'}); } @@ -155,7 +155,7 @@ sub new { 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} } ]; @@ -193,7 +193,7 @@ sub new $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 @@ -215,7 +215,7 @@ sub new } $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 '.' ) { @@ -300,7 +300,7 @@ sub new $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; @@ -320,7 +320,7 @@ sub new $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; @@ -335,15 +335,15 @@ sub new # 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; } @@ -400,7 +400,7 @@ sub new *parse = \&new; -sub numify +sub numify { my ($self) = @_; unless (_verify($self)) { @@ -441,7 +441,7 @@ sub numify return $string; } -sub normal +sub normal { my ($self) = @_; unless (_verify($self)) { @@ -484,9 +484,9 @@ sub stringify 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; } @@ -524,8 +524,8 @@ sub vcmp } # tiebreaker for alpha with identical terms - if ( $retval == 0 - && $l == $r + if ( $retval == 0 + && $l == $r && $left->{version}[$m] == $right->{version}[$m] && ( $lalpha || $ralpha ) ) { @@ -557,7 +557,7 @@ sub vcmp } } - return $retval; + return $retval; } sub vbool { @@ -565,8 +565,8 @@ 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"); } @@ -644,7 +644,7 @@ sub _VERSION { 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"; @@ -662,14 +662,14 @@ sub _VERSION { 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) diff --git a/cpan/Module-Build/lib/Module/Build/YAML.pm b/cpan/Module-Build/lib/Module/Build/YAML.pm index 2da91f2256..af06f35f80 100644 --- a/cpan/Module-Build/lib/Module/Build/YAML.pm +++ b/cpan/Module-Build/lib/Module/Build/YAML.pm @@ -15,7 +15,7 @@ BEGIN { # Class structure require 5.004; - + $Module::Build::YAML::VERSION = '1.40'; # Error storage @@ -561,7 +561,7 @@ sub LoadFile { 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]; } } diff --git a/cpan/Module-Build/lib/inc/latest.pm b/cpan/Module-Build/lib/inc/latest.pm index 9d4a38006b..d63dff8fac 100644 --- a/cpan/Module-Build/lib/inc/latest.pm +++ b/cpan/Module-Build/lib/inc/latest.pm @@ -1,7 +1,7 @@ package inc::latest; use strict; use vars qw($VERSION); -$VERSION = '0.35_08'; +$VERSION = '0.35_09'; $VERSION = eval $VERSION; use Carp; @@ -33,7 +33,7 @@ sub import { 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; @@ -77,7 +77,7 @@ HERE 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"); @@ -132,7 +132,7 @@ inc::latest - use modules bundled in inc/ if they are newer than installed ones 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 diff --git a/cpan/Module-Build/lib/inc/latest/private.pm b/cpan/Module-Build/lib/inc/latest/private.pm index 285514bc38..58ad0bc9ee 100644 --- a/cpan/Module-Build/lib/inc/latest/private.pm +++ b/cpan/Module-Build/lib/inc/latest/private.pm @@ -1,7 +1,7 @@ package inc::latest::private; use strict; use vars qw($VERSION); -$VERSION = '0.35_08'; +$VERSION = '0.35_09'; $VERSION = eval $VERSION; use File::Spec; @@ -21,7 +21,7 @@ sub import { # 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 @@ -66,7 +66,7 @@ sub _search_bundled { 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; diff --git a/cpan/Module-Build/t/bundle_inc.t b/cpan/Module-Build/t/bundle_inc.t index edb1aa94cd..837ccfbd31 100644 --- a/cpan/Module-Build/t/bundle_inc.t +++ b/cpan/Module-Build/t/bundle_inc.t @@ -74,45 +74,57 @@ ok( -e File::Spec->catfile( $dist_inc, qw/inc_Module-Build Module Build Base.pm/ ); # 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'; @@ -122,32 +134,32 @@ Module::Build->new( )->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'; @@ -157,25 +169,25 @@ Module::Build->new( )->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 { diff --git a/cpan/Module-Build/t/lib/MBTest.pm b/cpan/Module-Build/t/lib/MBTest.pm index 8a5acd257a..11d02dec14 100644 --- a/cpan/Module-Build/t/lib/MBTest.pm +++ b/cpan/Module-Build/t/lib/MBTest.pm @@ -93,7 +93,7 @@ __PACKAGE__->export(scalar caller, @extra_exports); ######################################################################## # always return to the current directory -{ +{ my $cwd = File::Spec->rel2abs(Cwd::cwd); sub original_cwd { return $cwd } @@ -188,7 +188,6 @@ sub find_in_path { return; } -# returns ($have_c_compiler, $C_support_feature); sub check_compiler { return (1,1) if $ENV{PERL_CORE}; @@ -214,7 +213,7 @@ sub check_compiler { ); $tmp_exec = 0 == system( $exe ); } - return ($have_c_compiler, $mb->feature('C_support'), $tmp_exec); + return ($have_c_compiler, $tmp_exec); } sub have_module { diff --git a/cpan/Module-Build/t/ppm.t b/cpan/Module-Build/t/ppm.t index 4d69c9767a..acbd56d1f5 100644 --- a/cpan/Module-Build/t/ppm.t +++ b/cpan/Module-Build/t/ppm.t @@ -10,12 +10,12 @@ blib_load('Module::Build::ConfigData'); 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} ) { @@ -27,11 +27,11 @@ my $HTML_support = Module::Build::ConfigData->feature('HTML_support'); } 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', <<'---' ); diff --git a/cpan/Module-Build/t/xs.t b/cpan/Module-Build/t/xs.t index 9471c1ab95..84f82d9a60 100644 --- a/cpan/Module-Build/t/xs.t +++ b/cpan/Module-Build/t/xs.t @@ -10,12 +10,10 @@ my $tmp; 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} ) { @@ -65,7 +63,7 @@ is $@, ''; } { - # Try again in a subprocess + # Try again in a subprocess eval {$mb->dispatch('clean')}; is $@, ''; |