From: Rafael Garcia-Suarez Date: Tue, 12 Sep 2006 14:49:21 +0000 (+0000) Subject: Upgrade to MakeMaker 6.30_04 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=58d3253823637a1fee2c1c8064022162bc9d6374;p=p5sagit%2Fp5-mst-13.2.git Upgrade to MakeMaker 6.30_04 p4raw-id: //depot/perl@28825 --- diff --git a/MANIFEST b/MANIFEST index 45f4a72..d2a854e 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1613,6 +1613,7 @@ lib/ExtUtils/README MakeMaker README lib/ExtUtils/t/00compile.t See if MakeMaker modules compile lib/ExtUtils/t/backwards.t Check MakeMaker's backwards compatibility lib/ExtUtils/t/basic.t See if MakeMaker can build a module +lib/ExtUtils/t/build_man.t Set if MakeMaker builds manpages lib/ExtUtils/t/bytes.t Test ExtUtils::MakeMaker::bytes lib/ExtUtils/t/Command.t See if ExtUtils::Command works (Win32 only) lib/ExtUtils/t/config.t Test ExtUtils::MakeMaker::Config @@ -1645,6 +1646,7 @@ lib/ExtUtils/t/Packlist.t See if Packlist works lib/ExtUtils/t/parse_version.t See if parse_version works lib/ExtUtils/t/PL_FILES.t Test PL_FILES in MakeMaker lib/ExtUtils/t/postamble.t See if postamble works +lib/ExtUtils/t/pm.t See if Makemaker can handle PM lib/ExtUtils/t/prefixify.t See if MakeMaker can apply a PREFIX lib/ExtUtils/t/prereq_print.t See if PREREQ_PRINT works lib/ExtUtils/t/problems.t How MakeMaker reacts to build problems diff --git a/lib/ExtUtils/Changes b/lib/ExtUtils/Changes index 5b5c8fa..165aa16 100644 --- a/lib/ExtUtils/Changes +++ b/lib/ExtUtils/Changes @@ -1,3 +1,35 @@ +6.30_04 Mon Sep 11 16:14:06 EDT 2006 + - EXTRA_META has been undocumented as I don't like the way the + interface works but I don't want to hold up 6.31. It will be + replaced with something better next version. + - Added explaination of distclean behavior and instructions on how to + blow away anything not in the MANIFEST to the FAQ. + * 6.30_01 broke overrides of PM. MakeMaker would add to a user + suplied PM rather than simply accepting it. + * Document INSTALL_BASE. + * Added "How do I install a module into my home directory?" to the FAQ + * Added "How do I get MakeMaker and Module::Build to install to the + same place?" + - Moving ExtUtils::Mksymlists and ExtUtils::Mkbootstrap back into + lib/ because no independent distribution has taken them over. + +6.30_03 Fri Sep 1 17:03:11 EDT 2006 + - Minor fix to Command.t for Win32. + +6.30_02 Fri Sep 1 15:03:55 EDT 2006 + - Updated to ExtUtils::Install 1.41 + * Won't scan for and build man pages when MAN3PODS is deliberately set + empty. + - Minor VMS fixes. [bleadperl@26813] + - VMS->one_liner must quote "--" argument. [bleadperl@27613] + * Split INSTALLSCRIPT into INSTALLSCRIPT, INSTALLSITESCRIPT and + INSTALLVENDORSCRIPT so it now honors INSTALLDIRS. [bleadperl@26536] + - Minor fix to work with Pod::man 2.04. [bleadperl@26457] + - $Revision was broken. + - Updated our internal version of Test::More to catch a few warnings. + - ExtUtils::Command::test_f() test was broken. + - Clarified that test_f() exits. + 6.30_01 Tue Aug 16 23:53:27 PDT 2005 * Fixed compiling modules using an uninstalled Perl on Win32 by using the proper perl header location for Windows (which is different from diff --git a/lib/ExtUtils/MM_Any.pm b/lib/ExtUtils/MM_Any.pm index 6235ac9..a4f6027 100644 --- a/lib/ExtUtils/MM_Any.pm +++ b/lib/ExtUtils/MM_Any.pm @@ -753,7 +753,7 @@ MAKE_FRAG $meta .= <; + url: http://module-build.sourceforge.net/META-spec-new.html version: 1.1 YAML diff --git a/lib/ExtUtils/MM_NW5.pm b/lib/ExtUtils/MM_NW5.pm index 0ce4f32..830c5c4 100644 --- a/lib/ExtUtils/MM_NW5.pm +++ b/lib/ExtUtils/MM_NW5.pm @@ -23,7 +23,7 @@ use ExtUtils::MakeMaker::Config; use File::Basename; use vars qw(@ISA $VERSION); -$VERSION = '2.08_01'; +$VERSION = '2.08_02'; require ExtUtils::MM_Win32; @ISA = qw(ExtUtils::MM_Win32); diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm index 37b4533..ba3be67 100644 --- a/lib/ExtUtils/MM_Unix.pm +++ b/lib/ExtUtils/MM_Unix.pm @@ -18,8 +18,7 @@ use vars qw($VERSION @ISA use ExtUtils::MakeMaker qw($Verbose neatvalue); -# $VERSION needs to stay numeric to avoid test warnings -$VERSION = '1.5003'; +$VERSION = '1.50_04'; require ExtUtils::MM_Any; @ISA = qw(ExtUtils::MM_Any); @@ -1305,12 +1304,14 @@ sub init_MANPODS { # Set up names of manual pages to generate from pods foreach my $man (qw(MAN1 MAN3)) { - unless ($self->{"${man}PODS"}) { - $self->{"${man}PODS"} = {}; - unless ($self->{"INSTALL${man}DIR"} =~ /^(none|\s*)$/) { - my $init = "init_${man}PODS"; - $self->$init(); - } + if ( $self->{"${man}PODS"} + or $self->{"INSTALL${man}DIR"} =~ /^(none|\s*)$/ + ) { + $self->{"${man}PODS"} ||= {}; + } + else { + my $init_method = "init_${man}PODS"; + $self->$init_method(); } } } @@ -1415,8 +1416,6 @@ Initializes PMLIBDIRS and PM from PMLIBDIRS. sub init_PM { my $self = shift; - my $pm = $self->{PM}; - # Some larger extensions often wish to install a number of *.pm/pl # files into the library in various locations. @@ -1468,6 +1467,8 @@ sub init_PM { @{$self->{PMLIBPARENTDIRS}} = ('lib'); } + return if $self->{PM} and $self->{ARGS}{PM}; + if (@{$self->{PMLIBDIRS}}){ print "Searching PMLIBDIRS: @{$self->{PMLIBDIRS}}\n" if ($Verbose >= 2); @@ -1497,7 +1498,7 @@ sub init_PM { $inst = $self->libscan($inst); print "libscan($path) => '$inst'\n" if ($Verbose >= 2); return unless $inst; - $pm->{$path} = $inst; + $self->{PM}{$path} = $inst; }, @{$self->{PMLIBDIRS}}); } } diff --git a/lib/ExtUtils/MM_VMS.pm b/lib/ExtUtils/MM_VMS.pm index 7514c61..5968f74 100644 --- a/lib/ExtUtils/MM_VMS.pm +++ b/lib/ExtUtils/MM_VMS.pm @@ -18,7 +18,7 @@ use File::Basename; # $Revision can't be on the same line or SVN/K gets confused use vars qw($Revision $VERSION @ISA); -$VERSION = '5.73_03'; +$VERSION = '5.73_02'; require ExtUtils::MM_Any; require ExtUtils::MM_Unix; @@ -1732,7 +1732,7 @@ sub oneliner { # Switches must be quoted else they will be lowercased. $switches = join ' ', map { qq{"$_"} } @$switches; - return qq{\$(ABSPERLRUN) $switches -e $cmd \"--\"}; + return qq{\$(ABSPERLRUN) $switches -e $cmd "--"}; } diff --git a/lib/ExtUtils/MM_Win95.pm b/lib/ExtUtils/MM_Win95.pm index 7f20ab9..ebc55e5 100644 --- a/lib/ExtUtils/MM_Win95.pm +++ b/lib/ExtUtils/MM_Win95.pm @@ -1,7 +1,7 @@ package ExtUtils::MM_Win95; use vars qw($VERSION @ISA); -$VERSION = '0.04_01'; +$VERSION = '0.04_02'; require ExtUtils::MM_Win32; @ISA = qw(ExtUtils::MM_Win32); diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm index 3e7da37..0d18766 100644 --- a/lib/ExtUtils/MakeMaker.pm +++ b/lib/ExtUtils/MakeMaker.pm @@ -1,4 +1,4 @@ -# $Id: /local/svn.schwern.org/CPAN/ExtUtils-MakeMaker/trunk/lib/ExtUtils/MakeMaker.pm 2539 2005-08-17T06:53:55.009300Z schwern $ +# $Id: /local/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm 18035 2006-09-11T20:18:19.209066Z schwern $ package ExtUtils::MakeMaker; BEGIN {require 5.005_03;} @@ -21,8 +21,8 @@ use vars qw( use vars qw($Revision); use strict; -$VERSION = '6.30_02'; -$Revision = (q$Revision: 2539 $) =~ /Revision:\s+(\S+)/; +$VERSION = '6.30_04'; +($Revision) = q$Revision: 18035 $ =~ /Revision:\s+(\S+)/; @ISA = qw(Exporter); @EXPORT = qw(&WriteMakefile &writeMakefile $Verbose &prompt); @@ -1030,7 +1030,7 @@ The generated Makefile enables the user of the extension to invoke The Makefile to be produced may be altered by adding arguments of the form C. E.g. - perl Makefile.PL PREFIX=~ + perl Makefile.PL INSTALL_BASE=~ Other interesting targets in the generated Makefile are @@ -1118,17 +1118,48 @@ C variable. make install UNINST=1 +=head2 INSTALL_BASE + +INSTALL_BASE can be passed into Makefile.PL to change where your +module will be installed. INSTALL_BASE is more like what everyone +else calls "prefix" than PREFIX is. + +To have everything installed in your home directory, do the following. + + perl Makefile.PL INSTALL_BASE=~ + +Like PREFIX, it sets several INSTALL* attributes at once. Unlike +PREFIX it is easy to predict where the module will end up. The +installation pattern looks like this: + + INSTALLARCHLIB INSTALL_BASE/lib/perl5/$Config{archname} + INSTALLPRIVLIB INSTALL_BASE/lib/perl5 + INSTALLBIN INSTALL_BASE/bin + INSTALLSCRIPT INSTALL_BASE/bin + INSTALLMAN1DIR INSTALL_BASE/man/man1 + INSTALLMAN3DIR INSTALL_BASE/man/man3 + +INSTALL_BASE in MakeMaker and C<--install_base> in Module::Build (as +of 0.28) install to the same location. If you want MakeMaker and +Module::Build to install to the same location simply set INSTALL_BASE +and C<--install_base> to the same location. + +INSTALL_BASE was added in 6.31. + + =head2 PREFIX and LIB attribute PREFIX and LIB can be used to set several INSTALL* attributes in one -go. The quickest way to install a module in a non-standard place might -be +go. Here's an example for installing into your home directory. perl Makefile.PL PREFIX=~ This will install all files in the module under your home directory, with man pages and libraries going into an appropriate place (usually -~/man and ~/lib). +~/man and ~/lib). How the exact location is determined is complicated +and depends on how your Perl was configured. INSTALL_BASE works more +like what other build systems call "prefix" than PREFIX and we +recommend you use that instead. Another way to specify many INSTALL directories with a single parameter is LIB. @@ -1460,10 +1491,6 @@ If your executables start with something like #!perl or 'Makefile.PL' was invoked with so the programs will be sure to run properly even if perl is not in /usr/bin/perl. -=item EXTRA_META - -Extra text to be appended to the generated META.yml. - =item FIRST_MAKEFILE The name of the Makefile to be produced. This is used for the second @@ -2135,7 +2162,7 @@ MakeMaker object. The following lines will be parsed o.k.: $VERSION = '1.00'; *VERSION = \'1.01'; - $VERSION = (q$Revision: 2539 $) =~ /(\d+)/g; + $VERSION = (q$Revision: 18035 $) =~ /(\d+)/g; $FOO::VERSION = '1.10'; *FOO::VERSION = \'1.11'; our $VERSION = 1.2.3; # new for perl5.6.0 diff --git a/lib/ExtUtils/MakeMaker/FAQ.pod b/lib/ExtUtils/MakeMaker/FAQ.pod index 6d17ff5..09583d0 100644 --- a/lib/ExtUtils/MakeMaker/FAQ.pod +++ b/lib/ExtUtils/MakeMaker/FAQ.pod @@ -1,7 +1,7 @@ package ExtUtils::MakeMaker::FAQ; use vars qw($VERSION); -$VERSION = '1.11_01'; +$VERSION = '1.11_04'; 1; __END__ @@ -19,6 +19,49 @@ FAQs, tricks and tips for C. =over 4 +=item How do I install a module into my home directory? + +If you're not the Perl administrator you probably don't have +permission to install a module to its default location. Then you +should install it for your own use into your home directory like so: + + perl Makefile.PL INSTALL_BASE=~ + +This will put modules into F<~/lib/perl5>, man pages into F<~/man> and +programs into F<~/bin>. + +To ensure your Perl programs can see these newly installed modules, +set your C environment variable to F<~/lib/perl5> or tell +each of your programs to look in that directory with the following: + + use lib "$ENV{HOME}/lib/perl5"; + + +=item How do I get MakeMaker and Module::Build to install to the same place? + +Module::Build, as of 0.28, supports two ways to install to the same +location as MakeMaker. + +1) Use INSTALL_BASE / C<--install_base> + +MakeMaker (as of 6.31) and Module::Build (as of 0.28) both can install +to the same locations using the "install_base" concept. See +L for details. To get MM and MB to +install to the same location simply set INSTALL_BASE in MM and +C<--install_base> in MB to the same location. + + perl Makefile.PL INSTALL_BASE=/whatever + perl Build.PL --install_base /whatever + +2) Use PREFIX / C<--prefix> + +Module::Build 0.28 added support for C<--prefix> which works like +MakeMaker's PREFIX. + + perl Makefile.PL PREFIX=/whatever + perl Build.PL --prefix /whatever + + =item How do I keep from installing man pages? Recent versions of MakeMaker will only install man pages on Unix like @@ -39,17 +82,21 @@ Two ways. One is to build the module normally... perl Makefile.PL make + make test ...and then set the PERL5LIB environment variable to point at the blib/lib and blib/arch directories. The other is to install the module in a temporary location. - perl Makefile.PL PREFIX=~/tmp LIB=~/tmp/lib/perl + perl Makefile.PL INSTALL_BASE=~/tmp + make + make test + make install -And then set PERL5LIB to F<~/tmp/lib/perl>. This works well when you have -multiple modules to work with. It also ensures that the module goes -through its full installation process which may modify it. +And then set PERL5LIB to F<~/tmp/lib/perl5>. This works well when you +have multiple modules to work with. It also ensures that the module +goes through its full installation process which may modify it. =back @@ -153,6 +200,54 @@ automatically generated as part of the 'distdir' target (and thus To shut off its generation, pass the C flag to C. + +=item How do I delete everything not in my F? + +Some folks are surpried that C does not delete +everything not listed in their MANIFEST (thus making a clean +distribution) but only tells them what they need to delete. This is +done because it is considered too dangerous. While developing your +module you might write a new file, not add it to the MANIFEST, then +run a C and be sad because your new work was deleted. + +If you really want to do this, you can use +C to read the MANIFEST and File::Find +to delete the files. But you have to be careful. Here's a script to +do that. Use at your own risk. Have fun blowing holes in your foot. + + #!/usr/bin/perl -w + + use strict; + + use File::Spec; + use File::Find; + use ExtUtils::Manifest qw(maniread); + + my %manifest = map {( $_ => 1 )} + grep { File::Spec->canonpath($_) } + keys %{ maniread() }; + + if( !keys %manifest ) { + print "No files found in MANIFEST. Stopping.\n"; + exit; + } + + find({ + wanted => sub { + my $path = File::Spec->canonpath($_); + + return unless -f $path; + return if exists $manifest{ $path }; + + print "unlink $path\n"; + unlink $path; + }, + no_chdir => 1 + }, + "." + ); + + =back =head2 XS @@ -282,7 +377,7 @@ The following four files sum up all the details discussed so far. And of course a very basic test: - test.pl: + t/cool.t: -------- use Test; BEGIN { plan tests => 1 }; diff --git a/lib/ExtUtils/t/Command.t b/lib/ExtUtils/t/Command.t index 22eabe5..275b73a 100644 --- a/lib/ExtUtils/t/Command.t +++ b/lib/ExtUtils/t/Command.t @@ -29,8 +29,8 @@ BEGIN { BEGIN { # bad neighbor, but test_f() uses exit() - *CORE::GLOBAL::exit = ''; # quiet 'only once' warning. - *CORE::GLOBAL::exit = sub { return @_ }; + *CORE::GLOBAL::exit = ''; # quiet 'only once' warning. + *CORE::GLOBAL::exit = sub { return $_[0] }; use_ok( 'ExtUtils::Command' ); } @@ -53,19 +53,16 @@ BEGIN { is( scalar( $$out =~ s/use_ok\( 'ExtUtils::Command'//g), 2, 'concatenation worked' ); - # the truth value here is reversed -- Perl true is C false + # the truth value here is reversed -- Perl true is shell false @ARGV = ( $Testfile ); ok( test_f(), 'testing non-existent file' ); - @ARGV = ( $Testfile ); - cmp_ok( ! test_f(), '==', defined (-f $Testfile), 'testing non-existent file' ); - # these are destructive, have to keep setting @ARGV @ARGV = ( $Testfile ); touch(); @ARGV = ( $Testfile ); - ok( test_f(), 'now creating that file' ); + ok( !test_f(), 'now creating that file' ); is_deeply( \@ARGV, [$Testfile], 'test_f preserves @ARGV' ); @ARGV = ( $Testfile ); @@ -108,7 +105,7 @@ BEGIN { $^O eq 'NetWare' || $^O eq 'dos' || $^O eq 'cygwin' || $^O eq 'MacOS' ) { - skip( "different file permission semantics on $^O", 3); + skip( "different file permission semantics on $^O", 4); } # change a file to execute-only @@ -162,22 +159,23 @@ BEGIN { is( ((stat('testdir'))[2] & 07777) & 0700, 0100, 'change a dir to execute-only' ); - # change a dir to read-only - @ARGV = ( '0400', 'testdir' ); + # change a dir to write-only + @ARGV = ( '0200', 'testdir' ); ExtUtils::Command::chmod(); is( ((stat('testdir'))[2] & 07777) & 0700, - ($^O eq 'vos' ? 0500 : 0400), 'change a dir to read-only' ); + ($^O eq 'vos' ? 0700 : 0200), 'change a dir to write-only' ); - # change a dir to write-only - @ARGV = ( '0200', 'testdir' ); + # change a dir to read-only + @ARGV = ( '0400', 'testdir' ); ExtUtils::Command::chmod(); is( ((stat('testdir'))[2] & 07777) & 0700, - ($^O eq 'vos' ? 0700 : 0200), 'change a dir to write-only' ); + ($^O eq 'vos' ? 0500 : 0400), 'change a dir to read-only' ); @ARGV = ('testdir'); rm_rf; + ok( ! -e 'testdir', 'rm_rf can delete a read-only dir' ); } diff --git a/lib/ExtUtils/t/MM_Win32.t b/lib/ExtUtils/t/MM_Win32.t index dbfa55a..866c135 100644 --- a/lib/ExtUtils/t/MM_Win32.t +++ b/lib/ExtUtils/t/MM_Win32.t @@ -37,7 +37,7 @@ my $MM = bless { MAKEFILE => 'Makefile', RM_RF => 'rm -rf', MV => 'mv', - MAKE => $Config{make}, + MAKE => $Config{make} }, 'MM'; diff --git a/lib/ExtUtils/t/Manifest.t b/lib/ExtUtils/t/Manifest.t index 47e555b..b90c233 100644 --- a/lib/ExtUtils/t/Manifest.t +++ b/lib/ExtUtils/t/Manifest.t @@ -46,7 +46,7 @@ sub read_manifest { } sub catch_warning { - my $warn; + my $warn = ''; local $SIG{__WARN__} = sub { $warn .= $_[0] }; return join('', $_[0]->() ), $warn; } @@ -72,7 +72,7 @@ ok( chdir( 'mantest' ), 'chdir() to mantest' ); ok( add_file('foo'), 'add a temporary file' ); # there shouldn't be a MANIFEST there -my ($res, $warn) = catch_warning( \&mkmanifest ); +my ($res, $warn) = catch_warning( \&mkmanifest ); # Canonize the order. $warn = join("", map { "$_|" } sort { lc($a) cmp lc($b) } split /\r?\n/, $warn); @@ -97,10 +97,10 @@ like( $warn, qr/^Not in MANIFEST: bar/, 'warning that bar has been added' ); is( $res, 'bar', 'bar reported as new' ); # now quiet the warning that bar was added and test again -($res, $warn) = do { local $ExtUtils::Manifest::Quiet = 1; - catch_warning( \&skipcheck ) +($res, $warn) = do { local $ExtUtils::Manifest::Quiet = 1; + catch_warning( \&skipcheck ) }; -ok( ! defined $warn, 'disabled warnings' ); +is( $warn, '', 'disabled warnings' ); # add a skip file with a rule to skip itself (and the nonexistent glob '*baz*') add_file( 'MANIFEST.SKIP', "baz\n.SKIP" ); @@ -111,7 +111,7 @@ like( $warn, qr/^Skipping MANIFEST\.SKIP/i, 'got skipping warning' ); my @skipped; catch_warning( sub { - @skipped = skipcheck() + @skipped = skipcheck(); }); is( join( ' ', @skipped ), 'MANIFEST.SKIP', 'listed skipped files' ); @@ -150,16 +150,8 @@ is_deeply( [sort map { lc } @copies], [sort map { lc } keys %$files] ); foreach my $orig (@copies) { my $copy = "copy/$orig"; ok( -r $copy, "$copy: must be readable" ); - - SKIP: { - skip " original was not writable", 1 unless -w $orig; - ok(-w $copy, " writable if original was" ); - } - - SKIP: { - skip " original was not executable", 1 unless -x $orig; - ok(-x $copy, " executable if original was" ); - } + is( -w $copy, -w $orig, " has orig write state" ); + is( -x $copy, -x $orig, " has orig executable state" ); } rmtree('copy'); @@ -207,8 +199,8 @@ add_file( 'MANIFEST.SKIP' => 'foo' ); add_file( 'MANIFEST' => "foobar\n" ); add_file( 'foobar' => '123' ); ($res, $warn) = catch_warning( \&manicheck ); -is( $res, '', 'MANIFEST overrides MANIFEST.SKIP' ); -is( $warn, undef, 'MANIFEST overrides MANIFEST.SKIP, no warnings' ); +is( $res, '', 'MANIFEST overrides MANIFEST.SKIP' ); +is( $warn, '', 'MANIFEST overrides MANIFEST.SKIP, no warnings' ); $files = maniread; ok( !$files->{wibble}, 'MANIFEST in good state' ); diff --git a/lib/ExtUtils/t/build_man.t b/lib/ExtUtils/t/build_man.t new file mode 100644 index 0000000..b7ae8bb --- /dev/null +++ b/lib/ExtUtils/t/build_man.t @@ -0,0 +1,78 @@ +#!/usr/bin/perl -w + +# Test if MakeMaker declines to build man pages under the right conditions. + +BEGIN { + if( $ENV{PERL_CORE} ) { + chdir 't' if -d 't'; + @INC = ('../lib', 'lib'); + } + else { + unshift @INC, 't/lib'; + } +} + +use strict; +use Test::More tests => 9; + +use TieOut; +use MakeMaker::Test::Utils; +use MakeMaker::Test::Setup::BFD; + +use ExtUtils::MakeMaker; + +chdir 't'; + +perl_lib(); + +ok( setup_recurs(), 'setup' ); +END { + ok( chdir File::Spec->updir ); + ok( teardown_recurs(), 'teardown' ); +} + +ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) || + diag("chdir failed: $!"); + +ok( my $stdout = tie *STDOUT, 'TieOut' ); + +{ + my $mm = WriteMakefile( + NAME => 'Big::Dummy', + VERSION_FROM => 'lib/Big/Dummy.pm', + ); + + ok( keys %{ $mm->{MAN3PODS} } ); +} + +{ + my $mm = WriteMakefile( + NAME => 'Big::Dummy', + VERSION_FROM => 'lib/Big/Dummy.pm', + INSTALLMAN3DIR => 'none' + ); + + ok( !keys %{ $mm->{MAN3PODS} } ); +} + + +{ + my $mm = WriteMakefile( + NAME => 'Big::Dummy', + VERSION_FROM => 'lib/Big/Dummy.pm', + MAN3PODS => {} + ); + + is_deeply( $mm->{MAN3PODS}, { } ); +} + + +{ + my $mm = WriteMakefile( + NAME => 'Big::Dummy', + VERSION_FROM => 'lib/Big/Dummy.pm', + MAN3PODS => { "Foo.pm" => "Foo.1" } + ); + + is_deeply( $mm->{MAN3PODS}, { "Foo.pm" => "Foo.1" } ); +} diff --git a/lib/ExtUtils/t/pm.t b/lib/ExtUtils/t/pm.t new file mode 100644 index 0000000..1f69527 --- /dev/null +++ b/lib/ExtUtils/t/pm.t @@ -0,0 +1,47 @@ +#!/usr/bin/perl -w + +# Test that MakeMaker honors user's PM override. + +BEGIN { + if( $ENV{PERL_CORE} ) { + chdir 't' if -d 't'; + @INC = ('../lib', 'lib'); + } + else { + unshift @INC, 't/lib'; + } +} + +use strict; +use Test::More tests => 6; + +use TieOut; +use MakeMaker::Test::Utils; +use MakeMaker::Test::Setup::BFD; + +use ExtUtils::MakeMaker; + +chdir 't'; + +perl_lib(); + +ok( setup_recurs(), 'setup' ); +END { + ok( chdir File::Spec->updir ); + ok( teardown_recurs(), 'teardown' ); +} + +ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) || + diag("chdir failed: $!"); + +ok( my $stdout = tie *STDOUT, 'TieOut' ); + +{ + my $mm = WriteMakefile( + NAME => 'Big::Dummy', + VERSION_FROM => 'lib/Big/Dummy.pm', + PM => { 'wibble' => 'woof' } + ); + + is_deeply( $mm->{PM}, { wibble => 'woof' } ); +} diff --git a/lib/ExtUtils/t/revision.t b/lib/ExtUtils/t/revision.t index 64a8a91..896b191 100644 --- a/lib/ExtUtils/t/revision.t +++ b/lib/ExtUtils/t/revision.t @@ -17,5 +17,7 @@ BEGIN { use_ok 'ExtUtils::MM_VMS'; } -like $ExtUtils::MakeMaker::Revision, qr/^(\d)+$/; -like $ExtUtils::MM_VMS::Revision, qr/^(\d)+$/; +# Why 1? Because a common mistake is for the regex to run in scalar context +# thus getting the count of captured elements (1) rather than the value of $1 +cmp_ok $ExtUtils::MakeMaker::Revision, '>', 1; +cmp_ok $ExtUtils::MM_VMS::Revision, '>', 1;