From: Jarkko Hietaniemi Date: Wed, 24 Apr 2002 05:16:09 +0000 (+0000) Subject: Upgrade to MakeMaker 5.91_02, from Michael Schwern. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=45bc4d3a962b143ae3b9e7c219b3e795d0c331ce;p=p5sagit%2Fp5-mst-13.2.git Upgrade to MakeMaker 5.91_02, from Michael Schwern. p4raw-id: //depot/perl@16125 --- diff --git a/MANIFEST b/MANIFEST index 218a4b8..433a728 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1025,11 +1025,9 @@ lib/ExtUtils/MM_Win32.pm MakeMaker methods for Win32 lib/ExtUtils/MM_Win95.pm MakeMaker methods for Win95 lib/ExtUtils/MY.pm MakeMaker user override class lib/ExtUtils/Packlist.pm Manipulates .packlist files +lib/ExtUtils/t/00setup_dummy.t Setup MakeMaker test module +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/Big-Fat-Dummy/Liar/lib/Big/Fat/Liar.pm MakeMaker dummy module -lib/ExtUtils/t/Big-Fat-Dummy/Liar/Makefile.PL MakeMaker dummy module -lib/ExtUtils/t/Big-Fat-Dummy/lib/Big/Fat/Dummy.pm MakeMaker dummy module -lib/ExtUtils/t/Big-Fat-Dummy/Makefile.PL MakeMaker dummy module lib/ExtUtils/t/Command.t See if ExtUtils::Command works (Win32 only) lib/ExtUtils/t/Constant.t See if ExtUtils::Constant works lib/ExtUtils/t/Embed.t See if ExtUtils::Embed and embedding works @@ -1047,10 +1045,10 @@ lib/ExtUtils/t/MM_VMS.t See if ExtUtils::MM_VMS works lib/ExtUtils/t/MM_Win32.t See if ExtUtils::MM_Win32 works lib/ExtUtils/t/Packlist.t See if Packlist works lib/ExtUtils/t/prefixify.t See if MakeMaker can apply a PREFIX -lib/ExtUtils/t/Problem-Module/Makefile.PL MakeMaker dummy module -lib/ExtUtils/t/Problem-Module/subdir/Makefile.PL MakeMaker dummy module lib/ExtUtils/t/problems.t How MakeMaker reacts to build problems lib/ExtUtils/t/testlib.t See if ExtUtils::testlib works +lib/ExtUtils/t/VERSION_FROM.t See if MakeMaker's VERSION_FROM works +lib/ExtUtils/t/zz_cleanup_dummy.t Cleanup MakeMaker test module lib/ExtUtils/testlib.pm Fixes up @INC to use just-built extension lib/ExtUtils/typemap Extension interface types lib/ExtUtils/xsubpp External subroutine preprocessor diff --git a/lib/ExtUtils/Changes b/lib/ExtUtils/Changes index cfbb0a0..7ae0d6c 100644 --- a/lib/ExtUtils/Changes +++ b/lib/ExtUtils/Changes @@ -1,3 +1,40 @@ +5.91_02 Wed Apr 24 01:29:56 EDT 2002 + - Adjustments to tests for inclusion in the core. + +5.91_01 Wed Apr 24 00:11:06 EDT 2002 + [[ API Changes ]] + * A failing Makefile.PL in a subdir will now kill the whole + makefile making process. + * "make install PREFIX=something" will no longer work. Sorry. + - Now supporting the usevendorprefix %Config setting + - Tests now guaranteed to run in alphabetical order. + - Allowing $VERSION = 0. + + [[ Bug Fixes ]] + - Missing prerequisite warning malformatted. + - INSTALL*MAN*DIR and INST_MAN*DIR weren't allowed on the command + line. + * For years now skipcheck() has been returning a different + value than what was documented. + - Partially reversing Ken's "speed up ExtUtils::Manifest" patch + from 5.51_01 so MANIFEST overrides MANIFEST.SKIP. + * Fixed PREFIXification so it works on Win32. + * Fixed PREFIXification so it works on VMS. + - Fixed INSTALLMAN*DIR=none on VMS. + * NetWare fixes (bleadperl@16076) + - Craig Berry fixed some macro corruption on VMS. + - Systems configured to not have man pages now honored thanks to + Paul Green + - Hack to allow 5.6.X versions of ExtUtils::Embed use MY implicitly. + - Moved use of glob out of MM_Unix so MacPerl could build + + [[ Test Changes ]] + - Shortening directory levels to accomodate old VMS's + - was using a slightly wrong prefix for the prefix tests + + [[ Doc Fixes ]] + - Documenting VERBINST + 5.90_01 Thu Apr 11 01:11:54 EDT 2002 [[ API Changes ]] * Implementation of the new PREFIX logic. diff --git a/lib/ExtUtils/Command/MM.pm b/lib/ExtUtils/Command/MM.pm index b57386c..616534a 100644 --- a/lib/ExtUtils/Command/MM.pm +++ b/lib/ExtUtils/Command/MM.pm @@ -39,6 +39,8 @@ Any $(FOO) used in the examples are make variables, not Perl. Runs the tests on @ARGV via Test::Harness passing through the $verbose flag. Any @test_libs will be unshifted onto the test's @INC. +@test_libs are run in alphabetical order. + =cut sub test_harness { @@ -49,7 +51,7 @@ sub test_harness { local @INC = @INC; unshift @INC, map { File::Spec->rel2abs($_) } @_; - Test::Harness::runtests(@ARGV); + Test::Harness::runtests(sort { lc $a cmp lc $b } @ARGV); } =back diff --git a/lib/ExtUtils/MM.pm b/lib/ExtUtils/MM.pm index 3e98c9a..2c23263 100644 --- a/lib/ExtUtils/MM.pm +++ b/lib/ExtUtils/MM.pm @@ -52,7 +52,7 @@ if( $^O eq 'MSWin32' ) { } $Is{UWIN} = 1 if $^O eq 'uwin'; $Is{Cygwin} = 1 if $^O eq 'cygwin'; -$Is{NW5} = 1 if $Config{'osname'} eq 'NetWare'; # intentional +$Is{NW5} = 1 if $Config{osname} eq 'NetWare'; # intentional $Is{BeOS} = 1 if $^O =~ /beos/i; # XXX should this be that loose? $Is{DOS} = 1 if $^O eq 'dos'; diff --git a/lib/ExtUtils/MM_Cygwin.pm b/lib/ExtUtils/MM_Cygwin.pm index 48e0995..59d89c2 100644 --- a/lib/ExtUtils/MM_Cygwin.pm +++ b/lib/ExtUtils/MM_Cygwin.pm @@ -19,7 +19,7 @@ sub cflags { my $base = $self->SUPER::cflags($libperl); foreach (split /\n/, $base) { - / *= */ and $self->{$`} = $'; + /^(\S*)\s*=\s*(\S*)$/ and $self->{$1} = $2; }; $self->{CCFLAGS} .= " -DUSEIMPORTLIB" if ($Config{useshrplib} eq 'true'); diff --git a/lib/ExtUtils/MM_NW5.pm b/lib/ExtUtils/MM_NW5.pm index 8b382f6..b9932e2 100644 --- a/lib/ExtUtils/MM_NW5.pm +++ b/lib/ExtUtils/MM_NW5.pm @@ -21,12 +21,6 @@ the semantics. use Config; use File::Basename; -#require Exporter; - -#use ExtUtils::MakeMaker; -#Exporter::import('ExtUtils::MakeMaker', -# qw( $Verbose &neatvalue)); - use vars qw(@ISA $VERSION); $VERSION = '2.01_01'; @@ -36,16 +30,14 @@ require ExtUtils::MM_Win32; use ExtUtils::MakeMaker qw( &neatvalue ); $ENV{EMXSHELL} = 'sh'; # to run `commands` -#unshift @MM::ISA, 'ExtUtils::MM_NW5'; -$BORLAND = 1 if $Config{'cc'} =~ /^bcc/i; -$GCC = 1 if $Config{'cc'} =~ /^gcc/i; -$DMAKE = 1 if $Config{'make'} =~ /^dmake/i; -$NMAKE = 1 if $Config{'make'} =~ /^nmake/i; +$BORLAND = 1 if $Config{'cc'} =~ /^bcc/i; +$GCC = 1 if $Config{'cc'} =~ /^gcc/i; +$DMAKE = 1 if $Config{'make'} =~ /^dmake/i; +$NMAKE = 1 if $Config{'make'} =~ /^nmake/i; $PERLMAKE = 1 if $Config{'make'} =~ /^pmake/i; - sub init_others { my ($self) = @_; @@ -73,15 +65,15 @@ sub init_others Initializes lots of constants and .SUFFIXES and .PHONY =cut -# NetWare override + sub const_cccmd { my($self,$libperl)=@_; return $self->{CONST_CCCMD} if $self->{CONST_CCCMD}; return '' unless $self->needs_linking(); - return $self->{CONST_CCCMD} = + return $self->{CONST_CCCMD} = q{CCCMD = $(CC) $(CCFLAGS) $(INC) $(OPTIMIZE) \\ $(PERLTYPE) $(MPOLLUTE) -o $@ \\ - -DVERSION=\"$(VERSION)\" -DXS_VERSION=\"$(XS_VERSION)\"}; + -DVERSION="$(VERSION)" -DXS_VERSION="$(XS_VERSION)"}; } sub constants { @@ -101,27 +93,26 @@ sub constants { PERL_ARCHLIB SITELIBEXP SITEARCHEXP LIBPERL_A MYEXTLIB FIRST_MAKEFILE MAKE_APERL_FILE PERLMAINCC PERL_SRC PERL_INC PERL FULLPERL LIBPTH BASE_IMPORT PERLRUN - FULLPERLRUN PERLRUNINST FULL_AR PERL_CORE FULLPERLRUNINST - NLM_VERSION MPKTOOL TOOLPATH - + FULLPERLRUN PERLRUNINST FULLPERLRUNINST + FULL_AR PERL_CORE NLM_VERSION MPKTOOL TOOLPATH + / ) { next unless defined $self->{$tmp}; push @m, "$tmp = $self->{$tmp}\n"; } - (my $boot = $self->{'NAME'}) =~ s/:/_/g; - $self->{'BOOT_SYMBOL'}=$boot; - push @m, "BOOT_SYMBOL = $self->{'BOOT_SYMBOL'}\n"; - - # If the final binary name is greater than 8 chars, - # truncate it here and rename it after creation - # otherwise, Watcom Linker fails - - if(length($self->{'BASEEXT'}) > 8) { - $self->{'NLM_SHORT_NAME'} = substr($self->{'BASEEXT'},0,8); - push @m, "NLM_SHORT_NAME = $self->{'NLM_SHORT_NAME'}\n"; - } - + (my $boot = $self->{'NAME'}) =~ s/:/_/g; + $self->{'BOOT_SYMBOL'}=$boot; + push @m, "BOOT_SYMBOL = $self->{'BOOT_SYMBOL'}\n"; + + # If the final binary name is greater than 8 chars, + # truncate it here and rename it after creation + # otherwise, Watcom Linker fails + if(length($self->{'BASEEXT'}) > 8) { + $self->{'NLM_SHORT_NAME'} = substr($self->{'BASEEXT'},0,8); + push @m, "NLM_SHORT_NAME = $self->{'NLM_SHORT_NAME'}\n"; + } + push @m, qq{ VERSION_MACRO = VERSION DEFINE_VERSION = -D\$(VERSION_MACRO)=\\\"\$(VERSION)\\\" @@ -129,30 +120,17 @@ XS_VERSION_MACRO = XS_VERSION XS_DEFINE_VERSION = -D\$(XS_VERSION_MACRO)=\\\"\$(XS_VERSION)\\\" }; - # Get the include path and replace the spaces with ; - # Copy this to makefile as INCLUDE = d:\...;d:\; - (my $inc = $Config{'incpath'}) =~ s/([ ]*)-I/;/g; - -=head - # Commented by Ananth since the below code was not adding the DBI path - # and compilation was failing due to non-availability of the correct path. 3 Jan 2002 - - # Get the additional include path and append to INCLUDE, keep it in - # INC will give problems during compilation, hence reset it after getting - # the value -## (my $add_inc = $self->{'INC'}) =~ s/ -I/;/g; - $self->{'INC'} = ''; - push @m, qq{ -INCLUDE = $inc;$add_inc; -}; -=cut + # Get the include path and replace the spaces with ; + # Copy this to makefile as INCLUDE = d:\...;d:\; + (my $inc = $Config{'incpath'}) =~ s/([ ]*)-I/;/g; -push @m, qq{ + push @m, qq{ INCLUDE = $inc; }; - # Set the path to CodeWarrior binaries which might not have been set in - # any other place - push @m, qq{ + + # Set the path to CodeWarrior binaries which might not have been set in + # any other place + push @m, qq{ PATH = \$(PATH);\$(TOOLPATH) }; @@ -269,6 +247,7 @@ PM_TO_BLIB = }.join(" \\\n\t", %{$self->{PM}}).q{ join('',@m); } + =item dynamic_lib (o) Defines how to produce the *.so (or equivalent) files. @@ -276,7 +255,7 @@ Defines how to produce the *.so (or equivalent) files. =cut sub dynamic_lib { - my($self, %attribs) = @_; + my($self, %attribs) = @_; return '' unless $self->needs_linking(); #might be because of a subdir return '' unless $self->has_link_code; @@ -285,8 +264,8 @@ sub dynamic_lib { my($inst_dynamic_dep) = $attribs{INST_DYNAMIC_DEP} || ""; my($ldfrom) = '$(LDFROM)'; my(@m); - (my $boot = $self->{NAME}) =~ s/:/_/g; - my ($mpk); + (my $boot = $self->{NAME}) =~ s/:/_/g; + push(@m,' # This section creates the dynamically loadable $(INST_DYNAMIC) # from $(OBJECT) and possibly $(MYEXTLIB). @@ -295,97 +274,77 @@ INST_DYNAMIC_DEP = '.$inst_dynamic_dep.' $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) '); -# push(@m, -# q{ $(LD) -out:$@ $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) } -# .q{$(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) -def:$(EXPORT_LIST)}); - - # Create xdc data for an MT safe NLM in case of mpk build -# if ( scalar(keys %XS) == 0 ) { return; } - push(@m, - q{ @echo Export boot_$(BOOT_SYMBOL) > $(BASEEXT).def -}); - push(@m, - q{ @echo $(BASE_IMPORT) >> $(BASEEXT).def -}); - push(@m, - q{ @echo Import @$(PERL_INC)\perl.imp >> $(BASEEXT).def -}); - - if ( $self->{CCFLAGS} =~ m/ -DMPK_ON /) { - $mpk=1; - push @m, ' $(MPKTOOL) $(XDCFLAGS) $(BASEEXT).xdc -'; - push @m, ' @echo xdcdata $(BASEEXT).xdc >> $(BASEEXT).def -'; - } else { - $mpk=0; - } - - push(@m, - q{ $(LD) $(LDFLAGS) $(OBJECT:.obj=.obj) } - ); - - push(@m, - q{ -desc "Perl 5.7.3 Extension ($(BASEEXT)) XS_VERSION: $(XS_VERSION)" -nlmversion $(NLM_VERSION) } - ); - - # Taking care of long names like FileHandle, ByteLoader, SDBM_File etc - if($self->{NLM_SHORT_NAME}) { - # In case of nlms with names exceeding 8 chars, build nlm in the - # current dir, rename and move to auto\lib. If we create in auto\lib - # in the first place, we can't rename afterwards. - push(@m, - q{ -o $(NLM_SHORT_NAME).$(DLEXT)} - ); - } else { - push(@m, - q{ -o $(INST_AUTODIR)\\$(BASEEXT).$(DLEXT)} - ); - } - - -# if ($mpk) { -# push (@m, -# q{ Option XDCDATA=$(BASEEXT).xdc } -# ); -# } - - # Add additional lib files if any (SDBM_File) - if($self->{MYEXTLIB}) { - push(@m, - q{ $(MYEXTLIB) } - ); - } - -#For now lets comment all the Watcom lib calls -#q{ LibPath $(LIBPTH) Library plib3s.lib Library math3s.lib Library clib3s.lib Library emu387.lib Library $(PERL_ARCHIVE) Library $(PERL_INC)\Main.lib} - - - push(@m, - q{ $(PERL_INC)\Main.lib} - .q{ -commandfile $(BASEEXT).def } - ); - - # If it is having a short name, rename it - if($self->{NLM_SHORT_NAME}) { - push @m, ' + + my ($mpk); + # Create xdc data for an MT safe NLM in case of mpk build + push(@m, + q{@echo Export boot_$(BOOT_SYMBOL) > $(BASEEXT).def + }); + push(@m, + q{@echo $(BASE_IMPORT) >> $(BASEEXT).def + }); + push(@m, + q{@echo Import @$(PERL_INC)\perl.imp >> $(BASEEXT).def + }); + + + if ( $self->{CCFLAGS} =~ m/ -DMPK_ON /) { + $mpk=1; + push @m, qq{\t\$(MPKTOOL) \$(XDCFLAGS) \$(BASEEXT).xdc\n}, + qq{\t\@echo xdcdata $(BASEEXT).xdc >> $(BASEEXT).def\n}; + } else { + $mpk=0; + } + + push(@m, + q{$(LD) $(LDFLAGS) $(OBJECT:.obj=.obj) } + ); + + push(@m, + qq{\t-desc "Perl 5.7.3 Extension (\$(BASEEXT)) XS_VERSION: \$(XS_VERSION)" -nlmversion \$(NLM_VERSION) } + ); + + # Taking care of long names like FileHandle, ByteLoader, SDBM_File etc + if($self->{NLM_SHORT_NAME}) { + # In case of nlms with names exceeding 8 chars, build nlm in the + # current dir, rename and move to auto\lib. If we create in auto\lib + # in the first place, we can't rename afterwards. + push(@m, + q{ -o $(NLM_SHORT_NAME).$(DLEXT)} + ); + } else { + push(@m, + q{ -o $(INST_AUTODIR)\\$(BASEEXT).$(DLEXT)} + ); + } + + # Add additional lib files if any (SDBM_File) + if($self->{MYEXTLIB}) { + push(@m, + q{ $(MYEXTLIB) } + ); + } + + push(@m, + q{ $(PERL_INC)\Main.lib}. + q{ -commandfile $(BASEEXT).def } + ); + + # If it is having a short name, rename it + if($self->{NLM_SHORT_NAME}) { + push @m, ' if exist $(INST_AUTODIR)\\$(BASEEXT).$(DLEXT) del $(INST_AUTODIR)\\$(BASEEXT).$(DLEXT)'; - push @m, ' + push @m, ' rename $(NLM_SHORT_NAME).$(DLEXT) $(BASEEXT).$(DLEXT)'; - push @m, ' + push @m, ' move $(BASEEXT).$(DLEXT) $(INST_AUTODIR)'; - } + } push @m, ' $(CHMOD) 755 $@ '; push @m, $self->dir_target('$(INST_ARCHAUTODIR)'); -# } else { -# push @m, ' -# @$(NOOP) -#'; -# } join('',@m); } @@ -397,3 +356,4 @@ __END__ =cut + diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm index 4604d39..836d347 100644 --- a/lib/ExtUtils/MM_Unix.pm +++ b/lib/ExtUtils/MM_Unix.pm @@ -5,40 +5,31 @@ require 5.005_03; # Maybe further back, dunno use strict; use Exporter (); -use Carp (); +use Carp; use Config; use File::Basename qw(basename dirname fileparse); use File::Spec; use DirHandle; use strict; use vars qw($VERSION @ISA - $Is_Mac $Is_OS2 $Is_VMS $Is_Win32 $Is_Dos $Is_VOS $Is_NetWare + $Is_Mac $Is_OS2 $Is_VMS $Is_Win32 $Is_Dos $Is_VOS $Verbose %pm %static $Xsubpp_Version %Config_Override ); use ExtUtils::MakeMaker qw($Verbose neatvalue); -$VERSION = '1.30_01'; +$VERSION = '1.31_01'; require ExtUtils::MM_Any; @ISA = qw(ExtUtils::MM_Any); $Is_OS2 = $^O eq 'os2'; $Is_Mac = $^O eq 'MacOS'; -$Is_Win32 = $^O eq 'MSWin32'; +$Is_Win32 = $^O eq 'MSWin32' || $Config{osname} eq 'NetWare'; $Is_Dos = $^O eq 'dos'; $Is_VOS = $^O eq 'vos'; -+$Is_NetWare = $Config{'osname'} eq 'NetWare'; # Config{'osname'} intentional -if ($Is_NetWare) { - $^O = 'NetWare'; - $Is_Win32 = 0; -} - -if ($Is_VMS = $^O eq 'VMS') { - require VMS::Filespec; - import VMS::Filespec qw( &vmsify ); -} +$Is_VMS = $^O eq 'VMS'; =head1 NAME @@ -1107,6 +1098,20 @@ in these dirs: 0; # false and not empty } +=item find_tests + + my $test = $mm->find_tests; + +Returns a string suitable for feeding to the shell to return all +tests in t/*.t. + +=cut + +sub find_tests { + my($self) = shift; + return 't/*.t'; +} + =back =head2 Methods to actually produce chunks of text for the Makefile @@ -1131,7 +1136,7 @@ sub fixin { # stolen from the pink Camel book, more or less for my $file (@files) { local(*FIXIN); local(*FIXOUT); - open(FIXIN, $file) or Carp::croak "Can't process '$file': $!"; + open(FIXIN, $file) or croak "Can't process '$file': $!"; local $/ = "\n"; chomp(my $line = ); next unless $line =~ s/^\s*\#!\s*//; # Not a shbang file. @@ -1562,7 +1567,7 @@ sub init_main { if ($self->{PERL_SRC}){ $self->{PERL_LIB} ||= File::Spec->catdir("$self->{PERL_SRC}","lib"); $self->{PERL_ARCHLIB} = $self->{PERL_LIB}; - $self->{PERL_INC} = ($Is_Win32 || $Is_NetWare) ? File::Spec->catdir($self->{PERL_LIB},"CORE") : $self->{PERL_SRC}; + $self->{PERL_INC} = ($Is_Win32) ? File::Spec->catdir($self->{PERL_LIB},"CORE") : $self->{PERL_SRC}; # catch a situation that has occurred a few times in the past: unless ( @@ -1575,8 +1580,6 @@ sub init_main { $Is_Mac or $Is_Win32 - or - $Is_NetWare ){ warn qq{ You cannot build extensions below the perl source tree after executing @@ -1698,8 +1701,11 @@ usually solves this kind of problem. # Determine VERSION and VERSION_FROM ($self->{DISTNAME}=$self->{NAME}) =~ s#(::)#-#g unless $self->{DISTNAME}; if ($self->{VERSION_FROM}){ - $self->{VERSION} = $self->parse_version($self->{VERSION_FROM}) or - Carp::carp "WARNING: Setting VERSION via file '$self->{VERSION_FROM}' failed\n" + $self->{VERSION} = $self->parse_version($self->{VERSION_FROM}); + if( $self->{VERSION} eq 'undef' ) { + carp "WARNING: Setting VERSION via file ". + "'$self->{VERSION_FROM}' failed\n"; + } } # strip blanks @@ -1707,8 +1713,6 @@ usually solves this kind of problem. $self->{VERSION} =~ s/^\s+//; $self->{VERSION} =~ s/\s+$//; } - - $self->{VERSION} ||= "0.10"; ($self->{VERSION_SYM} = $self->{VERSION}) =~ s/\W/_/g; $self->{DISTVNAME} = "$self->{DISTNAME}-$self->{VERSION}"; @@ -1849,46 +1853,28 @@ INSTALLDIRS) and PREFIX. sub init_INSTALL { my($self) = shift; - # The user who requests an installation directory explicitly - # should not have to tell us an architecture installation directory - # as well. We look if a directory exists that is named after the - # architecture. If not we take it as a sign that it should be the - # same as the requested installation directory. Otherwise we take - # the found one. - # We do the same thing twice: for privlib/archlib and for sitelib/sitearch - for my $libpair ({l=>"privlib", a=>"archlib"}, - {l=>"sitelib", a=>"sitearch"}) - { - my $lib = "install$libpair->{l}"; - my $Lib = uc $lib; - my $Arch = uc "install$libpair->{a}"; - if( $self->{$Lib} && ! $self->{$Arch} ){ - my($ilib) = $Config{$lib}; - $ilib = VMS::Filespec::unixify($ilib) if $Is_VMS; - - $self->prefixify($Arch,$ilib,$self->{$Lib}); - - unless (-d $self->{$Arch}) { - print STDOUT "Directory $self->{$Arch} not found\n" - if $Verbose; - $self->{$Arch} = $self->{$Lib}; - } - print STDOUT "Defaulting $Arch to $self->{$Arch}\n" if $Verbose; - } - } + $self->init_lib2arch; # There are no Config.pm defaults for these. $Config_Override{installsiteman1dir} = - "$Config{siteprefixexp}/man/man\$(MAN1EXT)"; + File::Spec->catdir($Config{siteprefixexp}, 'man', 'man$(MAN1EXT)'); $Config_Override{installsiteman3dir} = - "$Config{siteprefixexp}/man/man\$(MAN3EXT)"; - $Config_Override{installvendorman1dir} = - "$Config{vendorprefixexp}/man/man\$(MAN1EXT)"; - $Config_Override{installvendorman3dir} = - "$Config{vendorprefixexp}/man/man\$(MAN3EXT)"; - - my $iprefix = $Config{installprefixexp} || ''; - my $vprefix = $Config{vendorprefixexp} || $iprefix; + File::Spec->catdir($Config{siteprefixexp}, 'man', 'man$(MAN3EXT)'); + + if( $Config{usevendorprefix} ) { + $Config_Override{installvendorman1dir} = + File::Spec->catdir($Config{vendorprefixexp}, 'man', 'man$(MAN1EXT)'); + $Config_Override{installvendorman3dir} = + File::Spec->catdir($Config{vendorprefixexp}, 'man', 'man$(MAN3EXT)'); + } + else { + $Config_Override{installvendorman1dir} = ''; + $Config_Override{installvendorman3dir} = ''; + } + + my $iprefix = $Config{installprefixexp} || $Config{installprefix} || + $Config{prefixexp} || $Config{prefix} || ''; + my $vprefix = $Config{usevendorprefix} ? $Config{vendorprefixexp} : ''; my $sprefix = $Config{siteprefixexp} || ''; my $u_prefix = $self->{PREFIX} || ''; @@ -1911,47 +1897,54 @@ sub init_INSTALL { $manstyle = $self->{LIBSTYLE} eq 'lib/perl5' ? 'lib/perl5' : ''; } + # Some systems, like VOS, set installman*dir to '' if they can't + # read man pages. + for my $num (1, 3) { + $self->{'INSTALLMAN'.$num.'DIR'} ||= 'none' + unless $Config{'installman'.$num.'dir'}; + } + my %bin_layouts = ( bin => { s => $iprefix, - r => '$(PREFIX)', + r => $u_prefix, d => 'bin' }, vendorbin => { s => $vprefix, - r => '$(VENDORPREFIX)', + r => $u_vprefix, d => 'bin' }, sitebin => { s => $sprefix, - r => '$(SITEPREFIX)', + r => $u_sprefix, d => 'bin' }, script => { s => $iprefix, - r => '$(PREFIX)', + r => $u_prefix, d => 'bin' }, ); my %man_layouts = ( man1dir => { s => $iprefix, - r => '$(PREFIX)', + r => $u_prefix, d => 'man/man$(MAN1EXT)', style => $manstyle, }, siteman1dir => { s => $sprefix, - r => '$(SITEPREFIX)', + r => $u_sprefix, d => 'man/man$(MAN1EXT)', style => $manstyle, }, vendorman1dir => { s => $vprefix, - r => '$(VENDORPREFIX)', + r => $u_vprefix, d => 'man/man$(MAN1EXT)', style => $manstyle, }, man3dir => { s => $iprefix, - r => '$(PREFIX)', + r => $u_prefix, d => 'man/man$(MAN3EXT)', style => $manstyle, }, siteman3dir => { s => $sprefix, - r => '$(SITEPREFIX)', + r => $u_sprefix, d => 'man/man$(MAN3EXT)', style => $manstyle, }, vendorman3dir => { s => $vprefix, - r => '$(VENDORPREFIX)', + r => $u_vprefix, d => 'man/man$(MAN3EXT)', style => $manstyle, }, ); @@ -1959,28 +1952,28 @@ sub init_INSTALL { my %lib_layouts = ( privlib => { s => $iprefix, - r => '$(PREFIX)', + r => $u_prefix, d => '', style => $libstyle, }, vendorlib => { s => $vprefix, - r => '$(VENDORPREFIX)', + r => $u_vprefix, d => '', style => $libstyle, }, sitelib => { s => $sprefix, - r => '$(SITEPREFIX)', + r => $u_sprefix, d => 'site_perl', style => $libstyle, }, archlib => { s => $iprefix, - r => '$(PREFIX)', + r => $u_prefix, d => "$version/$arch", style => $libstyle }, vendorarch => { s => $vprefix, - r => '$(VENDORPREFIX)', + r => $u_vprefix, d => "$version/$arch", style => $libstyle }, sitearch => { s => $sprefix, - r => '$(SITEPREFIX)', + r => $u_sprefix, d => "site_perl/$version/$arch", style => $libstyle }, ); @@ -2025,11 +2018,51 @@ sub init_INSTALL { if $Verbose >= 2; } - $self->{PREFIX} ||= $iprefix; - return 1; } +=begin _protected + +=item init_lib2arch + + $mm->init_lib2arch + +=end _protected + +=cut + +sub init_lib2arch { + my($self) = shift; + + # The user who requests an installation directory explicitly + # should not have to tell us an architecture installation directory + # as well. We look if a directory exists that is named after the + # architecture. If not we take it as a sign that it should be the + # same as the requested installation directory. Otherwise we take + # the found one. + for my $libpair ({l=>"privlib", a=>"archlib"}, + {l=>"sitelib", a=>"sitearch"}, + {l=>"vendorlib", a=>"vendorarch"}, + ) + { + my $lib = "install$libpair->{l}"; + my $Lib = uc $lib; + my $Arch = uc "install$libpair->{a}"; + if( $self->{$Lib} && ! $self->{$Arch} ){ + my($ilib) = $Config{$lib}; + + $self->prefixify($Arch,$ilib,$self->{$Lib}); + + unless (-d $self->{$Arch}) { + print STDOUT "Directory $self->{$Arch} not found\n" + if $Verbose; + $self->{$Arch} = $self->{$Lib}; + } + print STDOUT "Defaulting $Arch to $self->{$Arch}\n" if $Verbose; + } + } +} + =item init_PERL @@ -2262,7 +2295,7 @@ sub installbin { push(@m, qq{ EXE_FILES = @{$self->{EXE_FILES}} -} . (($Is_Win32 || $Is_NetWare) +} . ($Is_Win32 ? q{FIXIN = pl2bat.bat } : q{FIXIN = $(PERLRUN) "-MExtUtils::MY" \ -e "MY->fixin(shift)" @@ -2752,7 +2785,8 @@ sub needs_linking { my($self) = shift; my($child,$caller); $caller = (caller(0))[3]; - Carp::confess("Needs_linking called too early") if $caller =~ /^ExtUtils::MakeMaker::/; + confess("Needs_linking called too early") if + $caller =~ /^ExtUtils::MakeMaker::/; return $self->{NEEDS_LINKING} if defined $self->{NEEDS_LINKING}; if ($self->has_link_code or $self->{MAKEAPERL}){ $self->{NEEDS_LINKING} = 1; @@ -2845,10 +2879,11 @@ sub parse_version { no warnings; $result = eval($eval); warn "Could not eval '$eval' in $parsefile: $@" if $@; - $result = "undef" unless defined $result; last; } close FH; + + $result = "undef" unless defined $result; return $result; } @@ -3092,8 +3127,8 @@ sub ppd { if ($self->{ABSTRACT_FROM}){ $self->{ABSTRACT} = $self->parse_abstract($self->{ABSTRACT_FROM}) or - Carp::carp "WARNING: Setting ABSTRACT via file ". - "'$self->{ABSTRACT_FROM}' failed\n"; + carp "WARNING: Setting ABSTRACT via file ". + "'$self->{ABSTRACT_FROM}' failed\n"; } my ($pack_ver) = join ",", (split (/\./, $self->{VERSION}), (0)x4)[0..3]; @@ -3182,15 +3217,12 @@ sub prefixify { my($self,$var,$sprefix,$rprefix,$default) = @_; my $path = $self->{uc $var} || - $Config_Override{lc $var} || $Config{lc $var}; - - print STDERR " prefixify $var=$path\n" if $Verbose >= 2; - print STDERR " from $sprefix to $rprefix\n" - if $Verbose >= 2; + $Config_Override{lc $var} || $Config{lc $var} || ''; - $path = VMS::Filespec::unixpath($path) if $Is_VMS; + print STDERR " prefixify $var => $path\n" if $Verbose >= 2; + print STDERR " from $sprefix to $rprefix\n" if $Verbose >= 2; - unless( $path =~ s,^\Q$sprefix\E(?=/|\z),$rprefix,s ) { + unless( $path =~ s{^\Q$sprefix\E\b}{$rprefix}s ) { print STDERR " cannot prefix, using default.\n" if $Verbose >= 2; print STDERR " no default!\n" if !$default && $Verbose >= 2; @@ -3513,7 +3545,7 @@ sub test { my($self, %attribs) = @_; my $tests = $attribs{TESTS} || ''; if (!$tests && -d 't') { - $tests = $Is_Win32 ? join(' ', ) : 't/*.t'; + $tests = $self->find_tests; } # note: 'test.pl' name is also hardcoded in init_dirscan() my(@m); diff --git a/lib/ExtUtils/MM_VMS.pm b/lib/ExtUtils/MM_VMS.pm index be012ea..787fda6 100644 --- a/lib/ExtUtils/MM_VMS.pm +++ b/lib/ExtUtils/MM_VMS.pm @@ -431,6 +431,7 @@ sub constants { PERL_LIB PERL_ARCHLIB PERL_INC PERL_SRC FULLEXT ] ) { next unless defined $self->{$macro}; + next if $macro =~ /MAN/ && $self->{$macro} eq 'none'; $self->{$macro} = $self->fixpath($self->{$macro},1); } $self->{PERL_VMS} = File::Spec->catdir($self->{PERL_SRC},q(VMS)) @@ -744,10 +745,13 @@ sub pm_to_blib { pm_to_blib : pm_to_blib.ts $(NOECHO) $(NOOP) +}; + + push @m, <<'MAKE_FRAG', # As always, keep under DCL's 255-char limit pm_to_blib.ts : $(TO_INST_PM) - $(NOECHO) $(PERL) -e "print '},shift(@files),q{ },shift(@files),q{'" >.MM_tmp -}; + $(NOECHO) $(RM_F) .MM_tmp +MAKE_FRAG $line = ''; # avoid uninitialized var warning while ($from = shift(@files),$to = shift(@files)) { @@ -1853,6 +1857,15 @@ $(MAKEFILE) : Makefile.PL $(CONFIGDEP) join('',@m); } +=item find_tests (override) + +=cut + +sub find_tests { + my $self = shift; + return -d 't' ? 't/*.t' : ''; +} + =item test (override) Use VMS commands for handling subdirectories. @@ -1861,7 +1874,7 @@ Use VMS commands for handling subdirectories. sub test { my($self, %attribs) = @_; - my($tests) = $attribs{TESTS} || ( -d 't' ? 't/*.t' : ''); + my($tests) = $attribs{TESTS} || $self->find_tests; my(@m); push @m," TEST_VERBOSE = 0 @@ -2173,17 +2186,103 @@ part of a filespec. =cut sub nicetext { - my($self,$text) = @_; + return $text if $text =~ m/^\w+\s*=/; # leave macro defs alone $text =~ s/([^\s:])(:+\s)/$1 $2/gs; $text; } -1; +=item prefixify (override) + +prefixifying on VMS is simple. Each should simply be: + + perl_root:[some.dir] + +which can just be converted to: + + volume:[your.prefix.some.dir] + +otherwise you get the default layout. + +In effect, your search prefix is ignored and $Config{vms_prefix} is +used instead. + +=cut + +sub prefixify { + my($self, $var, $sprefix, $rprefix, $default) = @_; + $default = VMS::Filespec::vmsify($default) + unless $default =~ /\[.*\]/; + + (my $var_no_install = $var) =~ s/^install//; + my $path = $self->{uc $var} || $Config{lc $var} || + $Config{lc $var_no_install}; + + if( !$path ) { + print STDERR " no Config found for $var.\n" if $Verbose >= 2; + $path = $self->_prefixify_default($rprefix, $default); + } + elsif( $sprefix eq $rprefix ) { + print STDERR " no new prefix.\n" if $Verbose >= 2; + } + else { + + print STDERR " prefixify $var => $path\n" if $Verbose >= 2; + print STDERR " from $sprefix to $rprefix\n" if $Verbose >= 2; + + my($path_vol, $path_dirs) = File::Spec->splitpath( $path ); + if( $path_vol eq $Config{vms_prefix}.':' ) { + print STDERR " $Config{vms_prefix}: seen\n" if $Verbose >= 2; + + $path_dirs =~ s{^\[}{\[.} unless $path_dirs =~ m{^\[\.}; + $path = $self->_catprefix($rprefix, $path_dirs); + } + else { + $path = $self->_prefixify_default($rprefix, $default); + } + } + + print " now $path\n" if $Verbose >= 2; + return $self->{uc $var} = $path; +} + + +sub _prefixify_default { + my($self, $rprefix, $default) = @_; + + print STDERR " cannot prefix, using default.\n" if $Verbose >= 2; + + if( !$default ) { + print STDERR "No default!\n" if $Verbose >= 1; + return; + } + if( !$rprefix ) { + print STDERR "No replacement prefix!\n" if $Verbose >= 1; + return ''; + } + + return $self->_catprefix($rprefix, $default); +} + +sub _catprefix { + my($self, $rprefix, $default) = @_; + + my($rvol, $rdirs) = File::Spec->splitpath($rprefix); + if( $rvol ) { + return File::Spec->catpath($rvol, + File::Spec->catdir($rdirs, $default), + '' + ) + } + else { + return File::Spec->catdir($rdirs, $default); + } +} + =back =cut -__END__ +1; diff --git a/lib/ExtUtils/MM_Win32.pm b/lib/ExtUtils/MM_Win32.pm index 1ee5fec..8e3ae45 100644 --- a/lib/ExtUtils/MM_Win32.pm +++ b/lib/ExtUtils/MM_Win32.pm @@ -140,6 +140,14 @@ in these dirs: 0; # false and not empty } + +# This code was taken out of MM_Unix to avoid loading File::Glob +# unless necessary. +sub find_tests { + return join(' ', ); +} + + sub init_others { my ($self) = @_; @@ -482,6 +490,7 @@ sub export_list return "$self->{BASEEXT}.def"; } + =item perl_script Takes one argument, a file name, and returns the file name, if the diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm index e7b9571..3614050 100644 --- a/lib/ExtUtils/MakeMaker.pm +++ b/lib/ExtUtils/MakeMaker.pm @@ -2,10 +2,10 @@ BEGIN {require 5.004;} package ExtUtils::MakeMaker; -$VERSION = "5.90_01"; +$VERSION = "5.91_02"; $Version_OK = "5.49"; # Makefiles older than $Version_OK will die # (Will be checked from MakeMaker version 4.13 onwards) -($Revision = substr(q$Revision: 1.37 $, 10)) =~ s/\s+$//; +($Revision = substr(q$Revision: 1.44 $, 10)) =~ s/\s+$//; require Exporter; use Config; @@ -34,6 +34,10 @@ full_setup(); require ExtUtils::MM; # Things like CPAN assume loading ExtUtils::MakeMaker # will give them MM. +require ExtUtils::MY; # XXX pre-5.8 versions of ExtUtils::Embed expect + # loading ExtUtils::MakeMaker will give them MY. + # This will go when Embed is it's own CPAN module. + sub WriteMakefile { Carp::croak "WriteMakefile: Need even number of args" if @_ % 2; @@ -100,7 +104,7 @@ sub eval_in_x { # } else { # warn "WARNING from evaluation of $dir/Makefile.PL: $@"; # } - warn "WARNING from evaluation of $dir/Makefile.PL: $@"; + die "ERROR from evaluation of $dir/Makefile.PL: $@"; } } @@ -117,12 +121,16 @@ sub full_setup { EXCLUDE_EXT EXE_FILES FIRST_MAKEFILE FULLPERL FULLPERLRUN FULLPERLRUNINST FUNCLIST H IMPORTS - INST_ARCHLIB INST_SCRIPT INST_BIN INST_LIB + INST_ARCHLIB INST_SCRIPT INST_BIN INST_LIB INST_MAN1DIR INST_MAN3DIR INSTALLDIRS PREFIX SITEPREFIX VENDORPREFIX INSTALLPRIVLIB INSTALLSITELIB INSTALLVENDORLIB INSTALLARCHLIB INSTALLSITEARCH INSTALLVENDORARCH - INSTALLBIN INSTALLSITEBIN INSTALLVENDORBIN INSTALLSCRIPT + INSTALLBIN INSTALLSITEBIN INSTALLVENDORBIN + INSTALLMAN1DIR INSTALLMAN3DIR + INSTALLSITEMAN1DIR INSTALLSITEMAN3DIR + INSTALLVENDORMAN1DIR INSTALLVENDORMAN3DIR + INSTALLSCRIPT PERL_LIB PERL_ARCHLIB SITELIBEXP SITEARCHEXP INC INCLUDE_EXT LDFROM LIB LIBPERL_A LIBS @@ -281,7 +289,7 @@ sub new { unless $self->{PREREQ_FATAL}; $unsatisfied{$prereq} = 'not installed'; } elsif ($pr_version < $self->{PREREQ_PM}->{$prereq} ){ - warn "Warning: prerequisite %s %s not found. We have %s.\n", + warn sprintf "Warning: prerequisite %s %s not found. We have %s.\n", $prereq, $self->{PREREQ_PM}{$prereq}, ($pr_version || 'unknown version') unless $self->{PREREQ_FATAL}; @@ -712,21 +720,16 @@ sub skipcheck { sub flush { my $self = shift; my($chunk); -# use FileHandle (); -# my $fh = new FileHandle; local *FH; print STDOUT "Writing $self->{MAKEFILE} for $self->{NAME}\n"; unlink($self->{MAKEFILE}, "MakeMaker.tmp", $Is_VMS ? 'Descrip.MMS' : ''); -# $fh->open(">MakeMaker.tmp") or die "Unable to open MakeMaker.tmp: $!"; open(FH,">MakeMaker.tmp") or die "Unable to open MakeMaker.tmp: $!"; for $chunk (@{$self->{RESULT}}) { -# print $fh "$chunk\n"; print FH "$chunk\n"; } -# $fh->close; close FH; my($finalname) = $self->{MAKEFILE}; rename("MakeMaker.tmp", $finalname); @@ -884,8 +887,8 @@ set of perl C<-I> options. MakeMaker also checks for any files matching glob("t/*.t"). It will add commands to the test target of the generated Makefile that execute -all matching files via the L module with the C<-I> -switches set correctly. +all matching files in alphabetical order via the L +module with the C<-I> switches set correctly. =head2 make testdb @@ -1783,6 +1786,10 @@ Like PREFIX, but only for the vendor install locations. Defaults to PREFIX (if set) or $Config{vendorprefixexp} +=item VERBINST + +If true, make install will be verbose + =item VERSION Your version number for distributing the package. This defaults to @@ -1804,7 +1811,7 @@ MakeMaker object. The following lines will be parsed o.k.: $VERSION = '1.00'; *VERSION = \'1.01'; - ( $VERSION ) = '$Revision: 1.37 $ ' =~ /\$Revision:\s+([^\s]+)/; + ( $VERSION ) = '$Revision: 1.43 $ ' =~ /\$Revision:\s+([^\s]+)/; $FOO::VERSION = '1.10'; *FOO::VERSION = \'1.11'; our $VERSION = 1.2.3; # new for perl5.6.0 diff --git a/lib/ExtUtils/Manifest.pm b/lib/ExtUtils/Manifest.pm index fa5a0b4..d8aa478 100644 --- a/lib/ExtUtils/Manifest.pm +++ b/lib/ExtUtils/Manifest.pm @@ -79,13 +79,12 @@ sub clean_up_filename { sub manifind { my $p = shift || {}; - my $skip = _maniskip(warn => $p->{warn_on_skip}); my $found = {}; my $wanted = sub { my $name = clean_up_filename($File::Find::name); warn "Debug: diskfile $name\n" if $Debug; - return if $skip->($name) or -d $name; + return if -d $name; if( $Is_VMS ) { $name =~ s#(.*)\.$#\L$1#; @@ -99,8 +98,6 @@ sub manifind { # Also, it's okay to use / here, because MANIFEST files use Unix-style # paths. find({wanted => $wanted, - preprocess => - sub {grep {!$skip->( clean_up_filename("$File::Find::dir/$_") )} @_}, no_chdir => 1, }, $Is_MacOS ? ":" : "."); @@ -109,62 +106,80 @@ sub manifind { } sub fullcheck { - _manicheck({check_files => 1, check_MANIFEST => 1}); + return [_check_files()], [_check_manifest()]; } sub manicheck { - return @{(_manicheck({check_files => 1}))[0]}; + return _check_files(); } sub filecheck { - return @{(_manicheck({check_MANIFEST => 1}))[1]}; + return _check_manifest(); } sub skipcheck { - _manicheck({check_MANIFEST => 1, warn_on_skip => 1}); + my($p) = @_; + my $found = manifind(); + my $matches = _maniskip(); + + my @skipped = (); + foreach my $file (sort keys %$found){ + if (&$matches($file)){ + warn "Skipping $file\n"; + push @skipped, $file; + next; + } + } + + return @skipped; } -sub _manicheck { - my($p) = @_; - my $read = maniread(); - my $found = manifind($p); - my $file; +sub _check_files { + my $p = shift; my $dosnames=(defined(&Dos::UseLFN) && Dos::UseLFN()==0); - my(@missfile,@missentry); - if ($p->{check_files}){ - foreach $file (sort keys %$read){ - warn "Debug: manicheck checking from $MANIFEST $file\n" if $Debug; - if ($dosnames){ - $file = lc $file; - $file =~ s=(\.(\w|-)+)=substr ($1,0,4)=ge; - $file =~ s=((\w|-)+)=substr ($1,0,8)=ge; - } - unless ( exists $found->{$file} ) { - warn "No such file: $file\n" unless $Quiet; - push @missfile, $file; - } - } + my $read = maniread() || {}; + my $found = manifind($p); + + my(@missfile) = (); + foreach my $file (sort keys %$read){ + warn "Debug: manicheck checking from $MANIFEST $file\n" if $Debug; + if ($dosnames){ + $file = lc $file; + $file =~ s=(\.(\w|-)+)=substr ($1,0,4)=ge; + $file =~ s=((\w|-)+)=substr ($1,0,8)=ge; + } + unless ( exists $found->{$file} ) { + warn "No such file: $file\n" unless $Quiet; + push @missfile, $file; + } } - if ($p->{check_MANIFEST}){ - $read ||= {}; - my $matches = _maniskip(); - foreach $file (sort keys %$found){ - if (&$matches($file)){ - warn "Skipping $file\n" if $p->{warn_on_skip}; - next; - } - warn "Debug: manicheck checking from disk $file\n" if $Debug; - unless ( exists $read->{$file} ) { - my $canon = $Is_MacOS ? "\t" . _unmacify($file) : ''; - warn "Not in $MANIFEST: $file$canon\n" unless $Quiet; - push @missentry, $file; - } - } + + return @missfile; +} + + +sub _check_manifest { + my($p) = @_; + my $read = maniread() || {}; + my $found = manifind($p); + my $skip = _maniskip(); + + my @missentry = (); + foreach my $file (sort keys %$found){ + next if $skip->($file); + warn "Debug: manicheck checking from disk $file\n" if $Debug; + unless ( exists $read->{$file} ) { + my $canon = $Is_MacOS ? "\t" . _unmacify($file) : ''; + warn "Not in $MANIFEST: $file$canon\n" unless $Quiet; + push @missentry, $file; + } } - (\@missfile,\@missentry); + + return @missentry; } + sub maniread { my ($mfile) = @_; $mfile ||= $MANIFEST; @@ -206,10 +221,8 @@ sub maniread { # returns an anonymous sub that decides if an argument matches sub _maniskip { - my (%args) = @_; - my @skip ; - my $mfile ||= "$MANIFEST.SKIP"; + my $mfile = "$MANIFEST.SKIP"; local *M; open M, $mfile or open M, $DEFAULT_MSKIP or return sub {0}; while (){ @@ -225,10 +238,7 @@ sub _maniskip { # any of them contain alternations my $regex = join '|', map "(?:$_)", @skip; - return ($args{warn} - ? sub { $_[0] =~ qr{$opts$regex} && warn "Skipping $_[0]\n" } - : sub { $_[0] =~ qr{$opts$regex} } - ); + return sub { $_[0] =~ qr{$opts$regex} }; } sub manicopy { @@ -294,7 +304,8 @@ sub cp { copy($srcFile,$dstFile); utime $access, $mod + ($Is_VMS ? 1 : 0), $dstFile; # chmod a+rX-w,go-w - chmod( 0444 | ( $perm & 0111 ? 0111 : 0 ), $dstFile ) unless ($^O eq 'MacOS'); + chmod( 0444 | ( $perm & 0111 ? 0111 : 0 ), $dstFile ) + unless ($^O eq 'MacOS'); } sub ln { @@ -496,9 +507,11 @@ All diagnostic output is sent to C. =item C I -is reported if a file is found, that is missing in the C -file which is excluded by a regular expression in the file -C. +is reported if a file is found which is not in C. + +=item C I + +is reported if a file is skipped due to an entry in C. =item C I diff --git a/lib/ExtUtils/t/00setup_dummy.t b/lib/ExtUtils/t/00setup_dummy.t new file mode 100644 index 0000000..fae48de --- /dev/null +++ b/lib/ExtUtils/t/00setup_dummy.t @@ -0,0 +1,90 @@ +#!/usr/bin/perl -w + +BEGIN { + if( $ENV{PERL_CORE} ) { + @INC = ('../lib', 'lib'); + } + else { + unshift @INC, 't/lib'; + } +} +chdir 't'; + +use strict; +use Test::More tests => 7; +use File::Path; +use File::Basename; + +my %Files = ( + 'Big-Dummy/lib/Big/Dummy.pm' => <<'END', +package Big::Dummy; + +$VERSION = 0.01; + +1; +END + + 'Big-Dummy/Makefile.PL' => <<'END', +use ExtUtils::MakeMaker; + +printf "Current package is: %s\n", __PACKAGE__; + +WriteMakefile( + NAME => 'Big::Dummy', + VERSION_FROM => 'lib/Big/Dummy.pm', + PREREQ_PM => {}, +); +END + + 'Big-Dummy/Liar/lib/Big/Liar.pm' => <<'END', +package Big::Liar; + +$VERSION = 0.01; + +1; +END + + 'Big-Dummy/Liar/Makefile.PL' => <<'END', +use ExtUtils::MakeMaker; + +my $mm = WriteMakefile( + NAME => 'Big::Liar', + VERSION_FROM => 'lib/Big/Liar.pm', + _KEEP_AFTER_FLUSH => 1 + ); + +print "Big::Liar's vars\n"; +foreach my $key (qw(INST_LIB INST_ARCHLIB)) { + print "$key = $mm->{$key}\n"; +} +END + + 'Problem-Module/Makefile.PL' => <<'END', +use ExtUtils::MakeMaker; + +WriteMakefile( + NAME => 'Problem::Module', +); +END + + 'Problem-Module/subdir/Makefile.PL' => <<'END', +printf "\@INC %s .\n", (grep { $_ eq '.' } @INC) ? "has" : "doesn't have"; + +warn "I think I'm going to be sick\n"; +die "YYYAaaaakkk\n"; +END + + ); + +while(my($file, $text) = each %Files) { + my $dir = dirname($file); + mkpath $dir; + open(FILE, ">$file"); + print FILE $text; + close FILE; + + ok( -e $file, "$file created" ); +} + + +pass("Setup done"); diff --git a/lib/ExtUtils/t/Big-Fat-Dummy/Liar/Makefile.PL b/lib/ExtUtils/t/Big-Fat-Dummy/Liar/Makefile.PL deleted file mode 100644 index c6478dd..0000000 --- a/lib/ExtUtils/t/Big-Fat-Dummy/Liar/Makefile.PL +++ /dev/null @@ -1,12 +0,0 @@ -use ExtUtils::MakeMaker; - -my $mm = WriteMakefile( - NAME => 'Big::Fat::Liar', - VERSION_FROM => 'lib/Big/Fat/Liar.pm', - _KEEP_AFTER_FLUSH => 1 - ); - -print "Big::Fat::Liar's vars\n"; -foreach my $key (qw(INST_LIB INST_ARCHLIB)) { - print "$key = $mm->{$key}\n"; -} diff --git a/lib/ExtUtils/t/Big-Fat-Dummy/Liar/lib/Big/Fat/Liar.pm b/lib/ExtUtils/t/Big-Fat-Dummy/Liar/lib/Big/Fat/Liar.pm deleted file mode 100644 index 11e6fc6..0000000 --- a/lib/ExtUtils/t/Big-Fat-Dummy/Liar/lib/Big/Fat/Liar.pm +++ /dev/null @@ -1,5 +0,0 @@ -package Big::Fat::Liar; - -$VERSION = 0.01; - -1; diff --git a/lib/ExtUtils/t/Big-Fat-Dummy/Makefile.PL b/lib/ExtUtils/t/Big-Fat-Dummy/Makefile.PL deleted file mode 100644 index 27ba6b5..0000000 --- a/lib/ExtUtils/t/Big-Fat-Dummy/Makefile.PL +++ /dev/null @@ -1,9 +0,0 @@ -use ExtUtils::MakeMaker; - -printf "Current package is: %s\n", __PACKAGE__; - -WriteMakefile( - NAME => 'Big::Fat::Dummy', - VERSION_FROM => 'lib/Big/Fat/Dummy.pm', - PREREQ_PM => {}, -); diff --git a/lib/ExtUtils/t/Big-Fat-Dummy/lib/Big/Fat/Dummy.pm b/lib/ExtUtils/t/Big-Fat-Dummy/lib/Big/Fat/Dummy.pm deleted file mode 100644 index 925d553..0000000 --- a/lib/ExtUtils/t/Big-Fat-Dummy/lib/Big/Fat/Dummy.pm +++ /dev/null @@ -1,5 +0,0 @@ -package Big::Fat::Dummy; - -$VERSION = 0.01; - -1; diff --git a/lib/ExtUtils/t/INST.t b/lib/ExtUtils/t/INST.t index c6ed62f..e16be0a 100644 --- a/lib/ExtUtils/t/INST.t +++ b/lib/ExtUtils/t/INST.t @@ -16,14 +16,14 @@ BEGIN { } use strict; -use Test::More tests => 17; +use Test::More tests => 23; use MakeMaker::Test::Utils; use ExtUtils::MakeMaker; use File::Spec; use TieOut; use Config; -$ENV{PERL_CORE} ? chdir '../lib/ExtUtils/t' : chdir 't'; +chdir 't'; perl_lib; @@ -33,33 +33,33 @@ my $Makefile = makefile_name; my $Curdir = File::Spec->curdir; my $Updir = File::Spec->updir; -ok( chdir 'Big-Fat-Dummy', "chdir'd to Big-Fat-Dummy" ) || +ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) || diag("chdir failed: $!"); my $stdout = tie *STDOUT, 'TieOut' or die; my $mm = WriteMakefile( - NAME => 'Big::Fat::Dummy', - VERSION_FROM => 'lib/Big/Fat/Dummy.pm', + NAME => 'Big::Dummy', + VERSION_FROM => 'lib/Big/Dummy.pm', PREREQ_PM => {}, PERL_CORE => $ENV{PERL_CORE}, ); like( $stdout->read, qr{ - Writing\ $Makefile\ for\ Big::Fat::Liar\n - Big::Fat::Liar's\ vars\n + Writing\ $Makefile\ for\ Big::Liar\n + Big::Liar's\ vars\n INST_LIB\ =\ \S+\n INST_ARCHLIB\ =\ \S+\n - Writing\ $Makefile\ for\ Big::Fat::Dummy\n + Writing\ $Makefile\ for\ Big::Dummy\n }x ); undef $stdout; untie *STDOUT; isa_ok( $mm, 'ExtUtils::MakeMaker' ); -is( $mm->{NAME}, 'Big::Fat::Dummy', 'NAME' ); +is( $mm->{NAME}, 'Big::Dummy', 'NAME' ); is( $mm->{VERSION}, 0.01, 'VERSION' ); my $config_prefix = $^O eq 'VMS' - ? VMS::Filespec::unixify($Config{installprefixexp}) + ? $Config{installprefixexp} || $Config{prefix} : $Config{installprefixexp}; is( $mm->{PREFIX}, $config_prefix, 'PREFIX' ); @@ -67,7 +67,7 @@ is( !!$mm->{PERL_CORE}, !!$ENV{PERL_CORE}, 'PERL_CORE' ); my($perl_src, $mm_perl_src); if( $ENV{PERL_CORE} ) { - $perl_src = File::Spec->catdir($Updir, $Updir, $Updir, $Updir); + $perl_src = File::Spec->catdir($Updir, $Updir); $perl_src = File::Spec->canonpath($perl_src); $mm_perl_src = File::Spec->canonpath($mm->{PERL_SRC}); } @@ -109,3 +109,34 @@ is( $mm->{INST_LIB}, # INSTALL* is( $mm->{INSTALLDIRS}, 'site', 'INSTALLDIRS' ); + + + +# Make sure the INSTALL*MAN*DIR variables work. We forgot them +# at one point. +$stdout = tie *STDOUT, 'TieOut' or die; +$mm = WriteMakefile( + NAME => 'Big::Dummy', + VERSION_FROM => 'lib/Big/Dummy.pm', + PERL_CORE => $ENV{PERL_CORE}, + INSTALLMAN1DIR => 'none', + INSTALLSITEMAN3DIR => 'none', + INSTALLVENDORMAN1DIR => 'none', + INST_MAN1DIR => 'none', +); +like( $stdout->read, qr{ + Writing\ $Makefile\ for\ Big::Liar\n + Big::Liar's\ vars\n + INST_LIB\ =\ \S+\n + INST_ARCHLIB\ =\ \S+\n + Writing\ $Makefile\ for\ Big::Dummy\n +}x ); +undef $stdout; +untie *STDOUT; + +isa_ok( $mm, 'ExtUtils::MakeMaker' ); + +is ( $mm->{INSTALLMAN1DIR}, 'none' ); +is ( $mm->{INSTALLSITEMAN3DIR}, 'none' ); +is ( $mm->{INSTALLVENDORMAN1DIR}, 'none' ); +is ( $mm->{INST_MAN1DIR}, 'none' ); diff --git a/lib/ExtUtils/t/INST_PREFIX.t b/lib/ExtUtils/t/INST_PREFIX.t index bb3b1b7..8af8c30 100644 --- a/lib/ExtUtils/t/INST_PREFIX.t +++ b/lib/ExtUtils/t/INST_PREFIX.t @@ -16,14 +16,16 @@ BEGIN { } use strict; -use Test::More tests => 24; +use Test::More tests => 26; use MakeMaker::Test::Utils; use ExtUtils::MakeMaker; use File::Spec; use TieOut; use Config; -$ENV{PERL_CORE} ? chdir '../lib/ExtUtils/t' : chdir 't'; +my $Is_VMS = $^O eq 'VMS'; + +chdir 't'; perl_lib; @@ -33,39 +35,40 @@ my $Makefile = makefile_name; my $Curdir = File::Spec->curdir; my $Updir = File::Spec->updir; -ok( chdir 'Big-Fat-Dummy', "chdir'd to Big-Fat-Dummy" ) || +ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) || diag("chdir failed: $!"); +my $PREFIX = File::Spec->catdir('foo', 'bar'); my $stdout = tie *STDOUT, 'TieOut' or die; my $mm = WriteMakefile( - NAME => 'Big::Fat::Dummy', - VERSION_FROM => 'lib/Big/Fat/Dummy.pm', + NAME => 'Big::Dummy', + VERSION_FROM => 'lib/Big/Dummy.pm', PREREQ_PM => {}, PERL_CORE => $ENV{PERL_CORE}, - PREFIX => 'foo/bar', + PREFIX => $PREFIX, ); like( $stdout->read, qr{ - Writing\ $Makefile\ for\ Big::Fat::Liar\n - Big::Fat::Liar's\ vars\n + Writing\ $Makefile\ for\ Big::Liar\n + Big::Liar's\ vars\n INST_LIB\ =\ \S+\n INST_ARCHLIB\ =\ \S+\n - Writing\ $Makefile\ for\ Big::Fat::Dummy\n + Writing\ $Makefile\ for\ Big::Dummy\n }x ); undef $stdout; untie *STDOUT; isa_ok( $mm, 'ExtUtils::MakeMaker' ); -is( $mm->{NAME}, 'Big::Fat::Dummy', 'NAME' ); +is( $mm->{NAME}, 'Big::Dummy', 'NAME' ); is( $mm->{VERSION}, 0.01, 'VERSION' ); -is( $mm->{PREFIX}, 'foo/bar', 'PREFIX' ); +is( $mm->{PREFIX}, $PREFIX, 'PREFIX' ); is( !!$mm->{PERL_CORE}, !!$ENV{PERL_CORE}, 'PERL_CORE' ); my($perl_src, $mm_perl_src); if( $ENV{PERL_CORE} ) { - $perl_src = File::Spec->catdir($Updir, $Updir, $Updir, $Updir); + $perl_src = File::Spec->catdir($Updir, $Updir); $perl_src = File::Spec->canonpath($perl_src); $mm_perl_src = File::Spec->canonpath($mm->{PERL_SRC}); } @@ -85,15 +88,47 @@ my @Vend_Install = qw(vendorarch vendorlib vendorbin vendorman1dir vendorman3dir); foreach my $var (@Perl_Install) { - like( $mm->{uc "install$var"}, qr/^\$\(PREFIX\)/, "PREFIX + $var" ); + my $prefix = $Is_VMS ? '[.foo.bar' : File::Spec->catdir(qw(foo bar)); + + # support for man page skipping + $prefix = 'none' if $var =~ /man/ && !$Config{"install$var"}; + like( $mm->{uc "install$var"}, qr/^\Q$prefix\E/, "PREFIX + $var" ); } foreach my $var (@Site_Install) { - like( $mm->{uc "install$var"}, qr/^\$\(SITEPREFIX\)/, + my $prefix = $Is_VMS ? '[.foo.bar' : File::Spec->catdir(qw(foo bar)); + + like( $mm->{uc "install$var"}, qr/^\Q$prefix\E/, "SITEPREFIX + $var" ); } foreach my $var (@Vend_Install) { - like( $mm->{uc "install$var"}, qr/^\$\(VENDORPREFIX\)/, + my $prefix = $Is_VMS ? '[.foo.bar' : File::Spec->catdir(qw(foo bar)); + + like( $mm->{uc "install$var"}, qr/^\Q$prefix\E/, "VENDORPREFIX + $var" ); } + + +# Check that when installman*dir isn't set in Config no man pages +# are generated. +{ + undef *ExtUtils::MM_Unix::Config; + %ExtUtils::MM_Unix::Config = %Config; + $ExtUtils::MM_Unix::Config{installman1dir} = ''; + $ExtUtils::MM_Unix::Config{installman3dir} = ''; + + my $wibble = File::Spec->catdir(qw(wibble and such)); + my $stdout = tie *STDOUT, 'TieOut' or die; + my $mm = WriteMakefile( + NAME => 'Big::Dummy', + VERSION_FROM => 'lib/Big/Dummy.pm', + PREREQ_PM => {}, + PERL_CORE => $ENV{PERL_CORE}, + PREFIX => $PREFIX, + INSTALLMAN1DIR=> $wibble, + ); + + is( $mm->{INSTALLMAN1DIR}, $wibble ); + is( $mm->{INSTALLMAN3DIR}, 'none' ); +} diff --git a/lib/ExtUtils/t/MM_Unix.t b/lib/ExtUtils/t/MM_Unix.t index 92083f0..b2e4173 100644 --- a/lib/ExtUtils/t/MM_Unix.t +++ b/lib/ExtUtils/t/MM_Unix.t @@ -18,7 +18,7 @@ BEGIN { plan skip_all => 'Non-Unix platform'; } else { - plan tests => 108; + plan tests => 112; } } @@ -185,8 +185,25 @@ is ($t->nicetext('LOTR'),'LOTR','nicetext'); my $self_name = $ENV{PERL_CORE} ? '../lib/ExtUtils/t/MM_Unix.t' : 'MM_Unix.t'; -is ($t->parse_version($self_name),'0.02', - 'parse_version on ourself'); +is( $t->parse_version($self_name), '0.02', 'parse_version on ourself'); + +my %versions = ( + '$VERSION = 0.0' => 0.0, + '$VERSION = -1.0' => -1.0, + '$VERSION = undef' => 'undef', + '$wibble = 1.0' => 'undef', + ); + +while( my($code, $expect) = each %versions ) { + open(FILE, ">VERSION.tmp") || die $!; + print FILE "$code\n"; + close FILE; + + is( $t->parse_version('VERSION.tmp'), $expect, $code ); + + unlink "VERSION.tmp"; +} + ############################################################################### # perl_script (on unix any ordinary, readable file) diff --git a/lib/ExtUtils/t/Manifest.t b/lib/ExtUtils/t/Manifest.t index 4929c43..8c0246f 100644 --- a/lib/ExtUtils/t/Manifest.t +++ b/lib/ExtUtils/t/Manifest.t @@ -14,7 +14,7 @@ chdir 't'; use strict; # these files help the test run -use Test::More tests => 32; +use Test::More tests => 33; use Cwd; # these files are needed for the module itself @@ -103,15 +103,12 @@ add_file( 'MANIFEST.SKIP', "baz\n.SKIP" ); ($res, $warn) = catch_warning( \&skipcheck ); like( $warn, qr/^Skipping MANIFEST\.SKIP/i, 'got skipping warning' ); -# I'm not sure why this should be... shouldn't $missing be the only one? -my ($found, $missing ); +my @skipped; catch_warning( sub { - ( $found, $missing ) = skipcheck() + @skipped = skipcheck() }); -# nothing new should be found, bar should be skipped -is( @$found, 0, 'no output here' ); -is( join( ' ', @$missing ), 'bar', 'listed skipped files' ); +is( join( ' ', @skipped ), 'MANIFEST.SKIP', 'listed skipped files' ); { local $ExtUtils::Manifest::Quiet = 1; @@ -165,7 +162,17 @@ add_file( 'MANIFEST.SKIP' => "^moretest/q\n" ); # This'll skip moretest/quux ($res, $warn) = catch_warning( \&skipcheck ); -like( $warn, qr{^Skipping moretest/quux}i, 'got skipping warning again' ); +like( $warn, qr{^Skipping moretest/quux$}i, 'got skipping warning again' ); + + +# There was a bug where entries in MANIFEST would be blotted out +# by MANIFEST.SKIP rules. +add_file( 'MANIFEST.SKIP' => 'foo' ); +add_file( 'MANIFEST' => 'foobar' ); +add_file( 'foobar' => '123' ); +($res, $warn) = catch_warning( \&manicheck ); +is( $res, '', 'MANIFEST overrides MANIFEST.SKIP' ); +is( $warn, undef, 'MANIFEST overrides MANIFEST.SKIP, no warnings' ); END { diff --git a/lib/ExtUtils/t/Problem-Module/Makefile.PL b/lib/ExtUtils/t/Problem-Module/Makefile.PL deleted file mode 100644 index fa14ba0..0000000 --- a/lib/ExtUtils/t/Problem-Module/Makefile.PL +++ /dev/null @@ -1,5 +0,0 @@ -use ExtUtils::MakeMaker; - -WriteMakefile( - NAME => 'Problem::Module', -); diff --git a/lib/ExtUtils/t/Problem-Module/subdir/Makefile.PL b/lib/ExtUtils/t/Problem-Module/subdir/Makefile.PL deleted file mode 100644 index 3863bf0..0000000 --- a/lib/ExtUtils/t/Problem-Module/subdir/Makefile.PL +++ /dev/null @@ -1,4 +0,0 @@ -printf "\@INC %s .\n", (grep { $_ eq '.' } @INC) ? "has" : "doesn't have"; - -warn "I think I'm going to be sick\n"; -die "YYYAaaaakkk\n"; diff --git a/lib/ExtUtils/t/VERSION_FROM.t b/lib/ExtUtils/t/VERSION_FROM.t new file mode 100644 index 0000000..4f3655f --- /dev/null +++ b/lib/ExtUtils/t/VERSION_FROM.t @@ -0,0 +1,37 @@ +BEGIN { + if( $ENV{PERL_CORE} ) { + chdir 't' if -d 't'; + @INC = ('../lib', 'lib'); + } + else { + unshift @INC, 't/lib'; + } +} + +chdir 't'; + +use strict; +use Test::More tests => 1; +use MakeMaker::Test::Utils; +use ExtUtils::MakeMaker; +use TieOut; +use File::Path; + +perl_lib(); + +mkdir 'Odd-Version'; +END { chdir File::Spec->updir; rmtree 'Odd-Version' } +chdir 'Odd-Version'; + +open(MPL, ">Version") || die $!; +print MPL "\$VERSION = 0\n"; +close MPL; +END { unlink 'Version' } + +my $stdout = tie *STDOUT, 'TieOut' or die; +my $mm = WriteMakefile( + NAME => 'Version', + VERSION_FROM => 'Version' +); + +is( $mm->{VERSION}, 0, 'VERSION_FROM when $VERSION = 0' ); diff --git a/lib/ExtUtils/t/backwards.t b/lib/ExtUtils/t/backwards.t new file mode 100644 index 0000000..95b1e16 --- /dev/null +++ b/lib/ExtUtils/t/backwards.t @@ -0,0 +1,25 @@ +#!/usr/bin/perl -w + +# This is a test for all the odd little backwards compatible things +# MakeMaker has to support. And we do mean backwards. + +BEGIN { + if( $ENV{PERL_CORE} ) { + chdir 't' if -d 't'; + @INC = ('../lib', 'lib'); + } + else { + unshift @INC, 't/lib'; + } +} + +use strict; +use Test::More tests => 2; + +require ExtUtils::MakeMaker; + +# CPAN.pm wants MM. +can_ok('MM', 'new'); + +# Pre 5.8 ExtUtils::Embed wants MY. +can_ok('MY', 'catdir'); diff --git a/lib/ExtUtils/t/basic.t b/lib/ExtUtils/t/basic.t index 2ef04c8..ff9b859 100644 --- a/lib/ExtUtils/t/basic.t +++ b/lib/ExtUtils/t/basic.t @@ -21,7 +21,7 @@ use TieOut; my $perl = which_perl(); -$ENV{PERL_CORE} ? chdir '../lib/ExtUtils/t' : chdir 't'; +chdir 't'; perl_lib; @@ -29,7 +29,7 @@ my $Touch_Time = calibrate_mtime(); $| = 1; -ok( chdir 'Big-Fat-Dummy', "chdir'd to Big-Fat-Dummy" ) || +ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) || diag("chdir failed: $!"); @@ -40,7 +40,7 @@ open(TEST, ">t/compile.t") or die "Can't open t/compile.t: $!"; print TEST <<'COMPILE_T'; print "1..2\n"; -print eval "use Big::Fat::Dummy; 1;" ? "ok 1\n" : "not ok 1\n"; +print eval "use Big::Dummy; 1;" ? "ok 1\n" : "not ok 1\n"; print "ok 2 - TEST_VERBOSE\n"; COMPILE_T close TEST; @@ -50,8 +50,8 @@ open(TEST, ">Liar/t/sanity.t") or die "Can't open Liar/t/sanity.t: $!"; print TEST <<'SANITY_T'; print "1..3\n"; -print eval "use Big::Fat::Dummy; 1;" ? "ok 1\n" : "not ok 1\n"; -print eval "use Big::Fat::Liar; 1;" ? "ok 2\n" : "not ok 2\n"; +print eval "use Big::Dummy; 1;" ? "ok 1\n" : "not ok 1\n"; +print eval "use Big::Liar; 1;" ? "ok 2\n" : "not ok 2\n"; print "ok 3 - TEST_VERBOSE\n"; SANITY_T close TEST; @@ -64,7 +64,7 @@ cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) || diag(@mpl_out); my $makefile = makefile_name(); -ok( grep(/^Writing $makefile for Big::Fat::Dummy/, +ok( grep(/^Writing $makefile for Big::Dummy/, @mpl_out) == 1, 'Makefile.PL output looks right'); @@ -103,8 +103,7 @@ like( $test_out, qr/ok \d+ - TEST_VERBOSE/, 'TEST_VERBOSE' ); like( $test_out, qr/All tests successful/, ' successful' ); is( $?, 0 ); -my $kill_err = $^O eq 'MSWin32' ? '2>&1' : ''; # avoid nmake spew -my $dist_test_out = `$make disttest $kill_err`; +my $dist_test_out = `$make disttest`; is( $?, 0, 'disttest' ) || diag($dist_test_out); @@ -114,7 +113,7 @@ is( $?, 0, 'disttest' ) || diag($dist_test_out); cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) || diag(@mpl_out); -ok( grep(/^Writing $makefile for Big::Fat::Dummy/, +ok( grep(/^Writing $makefile for Big::Dummy/, @mpl_out) == 1, 'init_dirscan skipped distdir') || diag(@mpl_out); diff --git a/lib/ExtUtils/t/hints.t b/lib/ExtUtils/t/hints.t index 23315ed..e979cd7 100644 --- a/lib/ExtUtils/t/hints.t +++ b/lib/ExtUtils/t/hints.t @@ -9,7 +9,7 @@ BEGIN { unshift @INC, 't/lib/'; } } -$ENV{PERL_CORE} ? chdir '../lib/ExtUtils/t' : chdir 't'; +chdir 't'; use Test::More tests => 3; diff --git a/lib/ExtUtils/t/prefixify.t b/lib/ExtUtils/t/prefixify.t index 3e22606..0f92a4a 100644 --- a/lib/ExtUtils/t/prefixify.t +++ b/lib/ExtUtils/t/prefixify.t @@ -11,7 +11,14 @@ BEGIN { } use strict; -use Test::More tests => 1; +use Test::More; + +if( $^O eq 'VMS' ) { + plan skip_all => 'prefixify works differently on VMS'; +} +else { + plan tests => 2; +} use File::Spec; use ExtUtils::MM; @@ -22,3 +29,12 @@ $mm->prefixify('installbin', 'wibble', 'something', $default); is( $mm->{INSTALLBIN}, File::Spec->catdir('something', $default), 'prefixify w/defaults'); + +{ + undef *ExtUtils::MM_Unix::Config; + $ExtUtils::MM_Unix::Config{wibble} = 'C:\opt\perl\wibble'; + $mm->prefixify('wibble', 'C:\opt\perl', 'C:\yarrow'); + + is( $mm->{WIBBLE}, 'C:\yarrow\wibble', 'prefixify Win32 paths' ); + { package ExtUtils::MM_Unix; Config->import } +} diff --git a/lib/ExtUtils/t/problems.t b/lib/ExtUtils/t/problems.t index 08f3f74..e9162d2 100644 --- a/lib/ExtUtils/t/problems.t +++ b/lib/ExtUtils/t/problems.t @@ -9,7 +9,7 @@ BEGIN { unshift @INC, 't/lib'; } } -$ENV{PERL_CORE} ? chdir '../lib/ExtUtils/t' : chdir 't'; +chdir 't'; use strict; use Test::More tests => 3; @@ -24,16 +24,16 @@ ok( chdir 'Problem-Module', "chdir'd to Problem-Module" ) || # Make sure when Makefile.PL's break, they issue a warning. # Also make sure Makefile.PL's in subdirs still have '.' in @INC. -my $stdout; -$stdout = tie *STDOUT, 'TieOut' or die; { + my $stdout = tie *STDOUT, 'TieOut' or die; + my $warning = ''; local $SIG{__WARN__} = sub { $warning = join '', @_ }; - $MM->eval_in_subdirs; + eval { $MM->eval_in_subdirs; }; is( $stdout->read, qq{\@INC has .\n}, 'cwd in @INC' ); - like( $warning, - qr{^WARNING from evaluation of .*subdir.*Makefile.PL: YYYAaaaakkk}, + like( $@, + qr{^ERROR from evaluation of .*subdir.*Makefile.PL: YYYAaaaakkk}, 'Makefile.PL death in subdir warns' ); untie *STDOUT; diff --git a/lib/ExtUtils/t/zz_cleanup_dummy.t b/lib/ExtUtils/t/zz_cleanup_dummy.t new file mode 100644 index 0000000..6973844 --- /dev/null +++ b/lib/ExtUtils/t/zz_cleanup_dummy.t @@ -0,0 +1,21 @@ +#!/usr/bin/perl -w + +BEGIN { + if( $ENV{PERL_CORE} ) { + @INC = ('../lib', 'lib'); + } + else { + unshift @INC, 't/lib'; + } +} +chdir 't'; + + +use strict; +use Test::More tests => 2; +use File::Path; + +rmtree('Big-Dummy'); +ok(!-d 'Big-Dummy', 'Big-Dummy cleaned up'); +rmtree('Problem-Module'); +ok(!-d 'Problem-Module', 'Problem-Module cleaned up');