From: Michael G. Schwern Date: Fri, 17 May 2002 17:17:54 +0000 (-0400) Subject: ExtUtils::MakeMaker 5.92_01 -> 5.94_02 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=57b1a898feef90fc19df54256136c678f3487b9a;p=p5sagit%2Fp5-mst-13.2.git ExtUtils::MakeMaker 5.92_01 -> 5.94_02 Message-ID: <20020517211754.GK13131@ool-18b93024.dyn.optonline.net> p4raw-id: //depot/perl@16663 --- diff --git a/lib/ExtUtils/Changes b/lib/ExtUtils/Changes index 36857bf..bd34720 100644 --- a/lib/ExtUtils/Changes +++ b/lib/ExtUtils/Changes @@ -1,3 +1,34 @@ +5.94_02 Fri May 17 17:16:04 EDT 2002 + - Fixing Manifest.t test for relative @INC when core testing. + +5.94_01 Fri May 17 14:53:54 EDT 2002 + - Small NetWare change from Novell. + - worked around 5.005_03's lack of a $Config{siteprefix} and + $Config{sitebin}. + - Small cross compilation changes (bleadperl 16582, 16548) + + [[ Test Fixes ]] + - Fixing ExtUtils::Command tests for VMS shell wildcard differences. + - Fixing ExtUtils::Installed tests so they don't go looking at already + installed installed lists. + +5.93_01 Mon May 6 00:54:39 EDT 2002 + - fixed basic.t for limited depth VMS systems + * MM_BeOS was totally hosed by a typo. + - Made the ExtUtils::Command docs clear about how things come + from @ARGV not @_. + - Quieted nmake banners in disttest + + * Backporting to 5.005_03 + - 'require 5.006' statements to 5.00503 + - Removing uses of File::Spec::Functions + - Adding MODE arg to mkdir() + - Changing uses of 'our' to 'use vars' + - Changing uses of 'no warnings' to 'local $SIG{__WARN__}' + - Changing 3-arg opens to 2-arg + - Changing 'open my $fh' to 'open FH' + - 5.005_03's File::Find doesn't have 'no_chdir' + 5.92_01 Mon Apr 29 23:09:38 EDT 2002 - Fixing case of modules with no .pm files on VMS. - LDLOADLIBS fix for NetBSD and easier overriding (bleadperl 16233) diff --git a/lib/ExtUtils/Command.pm b/lib/ExtUtils/Command.pm index 4b998b2..ac83415 100644 --- a/lib/ExtUtils/Command.pm +++ b/lib/ExtUtils/Command.pm @@ -1,15 +1,14 @@ package ExtUtils::Command; -use 5.006; +use 5.00503; use strict; -# use AutoLoader; use Carp; use File::Copy; use File::Compare; use File::Basename; use File::Path qw(rmtree); require Exporter; -our(@ISA, @EXPORT, $VERSION); +use vars qw(@ISA @EXPORT $VERSION); @ISA = qw(Exporter); @EXPORT = qw(cp rm_f rm_rf mv cat eqtime mkpath touch test_f); $VERSION = '1.03_01'; @@ -33,7 +32,17 @@ ExtUtils::Command - utilities to replace common UNIX commands in Makefiles etc. =head1 DESCRIPTION -The module is used to replace common UNIX commands. +The module is used to replace common UNIX commands. In all cases the +functions work from @ARGV rather than taking arguments. This makes +them easier to deal with in Makefiles. + + perl -MExtUtils::Command -e some_command some files to work on + +I + + perl -MExtUtils::Command -e 'some_command qw(some files to work on)' + +Filenames with * and ? will be glob expanded. =over 4 @@ -78,7 +87,8 @@ Removes directories - recursively (even if readonly) sub rm_rf { - rmtree([grep -e $_,expand_wildcards()],0,0); + expand_wildcards(); + rmtree([grep -e $_,@ARGV],0,0); } =item rm_f files.... @@ -89,7 +99,8 @@ Removes files (even if readonly) sub rm_f { - foreach (expand_wildcards()) + expand_wildcards(); + foreach (@ARGV) { next unless -f $_; next if unlink($_); @@ -165,7 +176,8 @@ Sets UNIX like permissions 'mode' on all the files. sub chmod { my $mode = shift(@ARGV); - chmod($mode,expand_wildcards()) || die "Cannot chmod ".join(' ',$mode,@ARGV).":$!"; + expand_wildcards(); + chmod($mode,@ARGV) || die "Cannot chmod ".join(' ',$mode,@ARGV).":$!"; } =item mkpath directory... @@ -176,7 +188,8 @@ Creates directory, including any parent directories. sub mkpath { - File::Path::mkpath([expand_wildcards()],0,0777); + expand_wildcards(); + File::Path::mkpath([@ARGV],0,0777); } =item test_f file diff --git a/lib/ExtUtils/Command/MM.pm b/lib/ExtUtils/Command/MM.pm index 616534a..9eb7d29 100644 --- a/lib/ExtUtils/Command/MM.pm +++ b/lib/ExtUtils/Command/MM.pm @@ -2,7 +2,7 @@ package ExtUtils::Command::MM; use strict; -require 5.006; +require 5.005_03; require Exporter; use vars qw($VERSION @ISA @EXPORT); @ISA = qw(Exporter); diff --git a/lib/ExtUtils/Install.pm b/lib/ExtUtils/Install.pm index 22a4bbf..b8fb4e3 100644 --- a/lib/ExtUtils/Install.pm +++ b/lib/ExtUtils/Install.pm @@ -1,7 +1,7 @@ package ExtUtils::Install; -use 5.006; -our(@ISA, @EXPORT, $VERSION); +use 5.00503; +use vars qw(@ISA @EXPORT $VERSION); $VERSION = 1.29; use Exporter; @@ -263,15 +263,15 @@ sub inc_uninstall { sub run_filter { my ($cmd, $src, $dest) = @_; - open(my $CMD, "|$cmd >$dest") || die "Cannot fork: $!"; - open(my $SRC, $src) || die "Cannot open $src: $!"; + open(CMD, "|$cmd >$dest") || die "Cannot fork: $!"; + open(SRC, $src) || die "Cannot open $src: $!"; my $buf; my $sz = 1024; - while (my $len = sysread($SRC, $buf, $sz)) { - syswrite($CMD, $buf, $len); + while (my $len = sysread(SRC, $buf, $sz)) { + syswrite(CMD, $buf, $len); } - close $SRC; - close $CMD or die "Filter command '$cmd' failed for $src"; + close SRC; + close CMD or die "Filter command '$cmd' failed for $src"; } sub pm_to_blib { diff --git a/lib/ExtUtils/Installed.pm b/lib/ExtUtils/Installed.pm index 8498f35..7edde47 100644 --- a/lib/ExtUtils/Installed.pm +++ b/lib/ExtUtils/Installed.pm @@ -1,6 +1,6 @@ package ExtUtils::Installed; -use 5.006; +use 5.00503; use strict; use Carp qw(); use ExtUtils::Packlist; @@ -11,7 +11,8 @@ use File::Basename; use File::Spec; require VMS::Filespec if $^O eq 'VMS'; -our $VERSION = '0.05'; +use vars qw($VERSION); +$VERSION = '0.05'; my $DOSISH = ($^O =~ /^(MSWin\d\d|os2|dos|mint)$/); diff --git a/lib/ExtUtils/Liblist.pm b/lib/ExtUtils/Liblist.pm index e9837f2..de79088 100644 --- a/lib/ExtUtils/Liblist.pm +++ b/lib/ExtUtils/Liblist.pm @@ -1,8 +1,7 @@ package ExtUtils::Liblist; use vars qw($VERSION); - -$VERSION = 1.0; +$VERSION = '1.00'; use File::Spec; require ExtUtils::Liblist::Kid; @@ -11,8 +10,9 @@ require ExtUtils::Liblist::Kid; sub lsdir { shift; my $rex = qr/$_[1]/; - opendir my $dir, $_[0]; - grep /$rex/, readdir $dir; + opendir DIR, $_[0]; + grep /$rex/, readdir DIR; + closedir DIR; } __END__ diff --git a/lib/ExtUtils/Liblist/Kid.pm b/lib/ExtUtils/Liblist/Kid.pm index b38e9b6..c990095 100644 --- a/lib/ExtUtils/Liblist/Kid.pm +++ b/lib/ExtUtils/Liblist/Kid.pm @@ -5,10 +5,11 @@ package ExtUtils::Liblist::Kid; # This kid package is to be used by MakeMaker. It will not work if # $self is not a Makemaker. -use 5.006; +use 5.00503; # Broken out of MakeMaker from version 4.11 -our $VERSION = 1.28_01; +use vars qw($VERSION); +$VERSION = 1.28_01; use Config; use Cwd 'cwd'; diff --git a/lib/ExtUtils/MM_BeOS.pm b/lib/ExtUtils/MM_BeOS.pm index 033a2d8..5d9b08b 100644 --- a/lib/ExtUtils/MM_BeOS.pm +++ b/lib/ExtUtils/MM_BeOS.pm @@ -25,7 +25,7 @@ require ExtUtils::MM_Unix; use vars qw(@ISA $VERSION); @ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix ); -$VERSION = 1.01_01; +$VERSION = 1.02_01; =item perl_archive diff --git a/lib/ExtUtils/MM_MacOS.pm b/lib/ExtUtils/MM_MacOS.pm index 4c8aae5..f32b5dc 100644 --- a/lib/ExtUtils/MM_MacOS.pm +++ b/lib/ExtUtils/MM_MacOS.pm @@ -11,8 +11,7 @@ require ExtUtils::MM_Unix; @ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix ); use vars qw($VERSION); - -$VERSION = 1.0; +$VERSION = '1.00'; use Config; use Cwd 'cwd'; diff --git a/lib/ExtUtils/MM_NW5.pm b/lib/ExtUtils/MM_NW5.pm index 97cee2e..cd08a72 100644 --- a/lib/ExtUtils/MM_NW5.pm +++ b/lib/ExtUtils/MM_NW5.pm @@ -23,7 +23,7 @@ use Config; use File::Basename; use vars qw(@ISA $VERSION); -$VERSION = '2.02_01'; +$VERSION = '2.04_01'; require ExtUtils::MM_Win32; @ISA = qw(ExtUtils::MM_Win32); @@ -72,7 +72,7 @@ sub const_cccmd { return $self->{CONST_CCCMD} = <<'MAKE_FRAG'; CCCMD = $(CC) $(CCFLAGS) $(INC) $(OPTIMIZE) \ $(PERLTYPE) $(MPOLLUTE) -o $@ \ - -DVERSION="$(VERSION)" -DXS_VERSION="$(XS_VERSION)" + -DVERSION=\"$(VERSION)\" -DXS_VERSION=\"$(XS_VERSION)\" MAKE_FRAG } @@ -259,7 +259,7 @@ END # If this extension has it's own library (eg SDBM_File) # then copy that to $(INST_STATIC) and add $(OBJECT) into it. $m .= <<'END' if $self->{MYEXTLIB}; - $self->{CP} $(MYEXTLIB) $\@ + $self->{CP} $(MYEXTLIB) $@ END my $ar_arg; @@ -284,6 +284,7 @@ END END + $m .= $self->dir_target('$(INST_ARCHAUTODIR)'); return $m; } diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm index 6e5016c..03dbd25 100644 --- a/lib/ExtUtils/MM_Unix.pm +++ b/lib/ExtUtils/MM_Unix.pm @@ -861,8 +861,8 @@ sub dist_test { push @m, q{ disttest : distdir cd $(DISTVNAME) && $(ABSPERLRUN) Makefile.PL - cd $(DISTVNAME) && $(MAKE) - cd $(DISTVNAME) && $(MAKE) test + cd $(DISTVNAME) && $(MAKE) $(PASTHRU) + cd $(DISTVNAME) && $(MAKE) test $(PASTHRU) }; join "", @m; } @@ -1566,13 +1566,19 @@ 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) ? File::Spec->catdir($self->{PERL_LIB},"CORE") : $self->{PERL_SRC}; - if (defined $::Cross::platform) { - $self->{PERL_ARCHLIB} = File::Spec->catdir("$self->{PERL_SRC}","xlib",$::Cross::platform); - $self->{PERL_INC} = File::Spec->catdir("$self->{PERL_SRC}","xlib",$::Cross::platform, $Is_Win32?("CORE"):()); - } + if (defined $Cross::platform) { + $self->{PERL_ARCHLIB} = + File::Spec->catdir("$self->{PERL_SRC}","xlib",$Cross::platform); + $self->{PERL_INC} = + File::Spec->catdir("$self->{PERL_SRC}","xlib",$Cross::platform, + $Is_Win32?("CORE"):()); + } + else { + $self->{PERL_ARCHLIB} = $self->{PERL_LIB}; + $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 ( @@ -1608,7 +1614,6 @@ from the perl source tree. $self->{PERL_INC} = File::Spec->catdir("$self->{PERL_ARCHLIB}","CORE"); # wild guess for now my $perl_h; - no warnings 'uninitialized' ; if (not -f ($perl_h = File::Spec->catfile($self->{PERL_INC},"perl.h")) and not $old){ # Maybe somebody tries to build an extension with an @@ -1823,10 +1828,14 @@ sub init_INST { # you to build directly into, say $Config{privlibexp}. unless ($self->{INST_LIB}){ if ($self->{PERL_CORE}) { - $self->{INST_LIB} = $self->{INST_ARCHLIB} = $self->{PERL_LIB}; - if (defined $::Cross::platform) { - $self->{INST_LIB} = $self->{INST_ARCHLIB} = File::Spec->catdir($self->{PERL_LIB},"..","xlib",$::Cross::platform); - } + if (defined $Cross::platform) { + $self->{INST_LIB} = $self->{INST_ARCHLIB} = + File::Spec->catdir($self->{PERL_LIB},"..","xlib", + $Cross::platform); + } + else { + $self->{INST_LIB} = $self->{INST_ARCHLIB} = $self->{PERL_LIB}; + } } else { $self->{INST_LIB} = File::Spec->catdir($Curdir,"blib","lib"); } @@ -1863,12 +1872,6 @@ sub init_INSTALL { $self->init_lib2arch; - # There are no Config.pm defaults for these. - $Config_Override{installsiteman1dir} = - File::Spec->catdir($Config{siteprefixexp}, 'man', 'man$(MAN1EXT)'); - $Config_Override{installsiteman3dir} = - File::Spec->catdir($Config{siteprefixexp}, 'man', 'man$(MAN3EXT)'); - if( $Config{usevendorprefix} ) { $Config_Override{installvendorman1dir} = File::Spec->catdir($Config{vendorprefixexp}, 'man', 'man$(MAN1EXT)'); @@ -1885,6 +1888,26 @@ sub init_INSTALL { my $vprefix = $Config{usevendorprefix} ? $Config{vendorprefixexp} : ''; my $sprefix = $Config{siteprefixexp} || ''; + # 5.005_03 doesn't have a siteprefix. + $sprefix = $iprefix unless $sprefix; + + # There are often no Config.pm defaults for these, but we can make + # it up. + unless( $Config{installsiteman1dir} ) { + $Config_Override{installsiteman1dir} = + File::Spec->catdir($sprefix, 'man', 'man$(MAN1EXT)'); + } + + unless( $Config{installsiteman3dir} ) { + $Config_Override{installsiteman3dir} = + File::Spec->catdir($sprefix, 'man', 'man$(MAN3EXT)'); + } + + unless( $Config{installsitebin} ) { + $Config_Override{installsitebin} = + File::Spec->catdir($sprefix, 'bin'); + } + my $u_prefix = $self->{PREFIX} || ''; my $u_sprefix = $self->{SITEPREFIX} || $u_prefix; my $u_vprefix = $self->{VENDORPREFIX} || $u_prefix; @@ -2884,7 +2907,7 @@ sub parse_version { $_ }; \$$2 }; - no warnings; + local $^W = 0; $result = eval($eval); warn "Could not eval '$eval' in $parsefile: $@" if $@; last; diff --git a/lib/ExtUtils/MM_VMS.pm b/lib/ExtUtils/MM_VMS.pm index 044bd2e..32b75b4 100644 --- a/lib/ExtUtils/MM_VMS.pm +++ b/lib/ExtUtils/MM_VMS.pm @@ -1945,7 +1945,7 @@ Consequently, it hasn't really been tested, and may well be incomplete. =cut -our %olbs; +use vars qw(%olbs); sub makeaperl { my($self, %attribs) = @_; diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm index dbd881d..cf650c4 100644 --- a/lib/ExtUtils/MakeMaker.pm +++ b/lib/ExtUtils/MakeMaker.pm @@ -1,11 +1,11 @@ -BEGIN {require 5.004;} - package ExtUtils::MakeMaker; -$VERSION = "5.92_01"; +BEGIN {require 5.005_03;} + +$VERSION = "5.94_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.46 $, 10)) =~ s/\s+$//; +($Revision = substr(q$Revision: 1.51 $, 10)) =~ s/\s+$//; require Exporter; use Config; @@ -498,7 +498,7 @@ sub WriteEmptyMakefile { rename $self->{MAKEFILE}, "$self->{MAKEFILE}.old" or warn "rename $self->{MAKEFILE} $self->{MAKEFILE}.old: $!" if -f $self->{MAKEFILE}; - open MF, '>', $self->{MAKEFILE} or die "open $self->{MAKEFILE} for write: $!"; + open MF, '>'.$self->{MAKEFILE} or die "open $self->{MAKEFILE} for write: $!"; print MF <<'EOP'; all: @@ -624,7 +624,7 @@ sub check_hints { } sub _run_hintfile { - our $self; + no strict 'vars'; local($self) = shift; # make $self available to the hint file. my($hint_file) = shift; @@ -646,7 +646,10 @@ sub mv_all_methods { # still trying to reduce the list to some reasonable minimum -- # because I want to make it easier for the user. A.K. - no warnings 'redefine'; + local $SIG{__WARN__} = sub { + # can't use 'no warnings redefined', 5.6 only + warn @_ unless $_[0] =~ /^Subroutine .* redefined/ + }; foreach my $method (@Overridable) { # We cannot say "next" here. Nick might call MY->makeaperl @@ -1763,7 +1766,9 @@ RedHatism for C. The output format is different, though: Like PREFIX, but only for the site install locations. -Defaults to PREFIX (if set) or $Config{siteprefixexp} +Defaults to PREFIX (if set) or $Config{siteprefixexp}. Perls prior to +5.6.0 didn't have an explicit siteprefix in the Config. In those +cases $Config{installprefix} will be used. =item SKIP @@ -1812,7 +1817,7 @@ MakeMaker object. The following lines will be parsed o.k.: $VERSION = '1.00'; *VERSION = \'1.01'; - ( $VERSION ) = '$Revision: 1.46 $ ' =~ /\$Revision:\s+([^\s]+)/; + ( $VERSION ) = '$Revision: 1.51 $ ' =~ /\$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 d8aa478..90d96ac 100644 --- a/lib/ExtUtils/Manifest.pm +++ b/lib/ExtUtils/Manifest.pm @@ -4,13 +4,13 @@ require Exporter; use Config; use File::Find; use File::Copy 'copy'; -use File::Spec::Functions qw(splitpath); +use File::Spec; use Carp; use strict; -our ($VERSION,@ISA,@EXPORT_OK, - $Is_MacOS,$Is_VMS, - $Debug,$Verbose,$Quiet,$MANIFEST,$DEFAULT_MSKIP); +use vars qw($VERSION @ISA @EXPORT_OK + $Is_MacOS $Is_VMS + $Debug $Verbose $Quiet $MANIFEST $DEFAULT_MSKIP); $VERSION = 1.37_01; @ISA=('Exporter'); @@ -26,13 +26,8 @@ $Verbose = defined $ENV{PERL_MM_MANIFEST_VERBOSE} ? $ENV{PERL_MM_MANIFEST_VERBOSE} : 1; $Quiet = 0; $MANIFEST = 'MANIFEST'; -$DEFAULT_MSKIP = (splitpath($INC{"ExtUtils/Manifest.pm"}))[1]."$MANIFEST.SKIP"; - -# Really cool fix from Ilya :) -unless (defined $Config{d_link}) { - no warnings; - *ln = \&cp; -} +$DEFAULT_MSKIP = (File::Spec->splitpath($INC{"ExtUtils/Manifest.pm"}))[1]. + "$MANIFEST.SKIP"; sub mkmanifest { my $manimiss = 0; @@ -84,7 +79,7 @@ sub manifind { my $wanted = sub { my $name = clean_up_filename($File::Find::name); warn "Debug: diskfile $name\n" if $Debug; - return if -d $name; + return if -d $_; if( $Is_VMS ) { $name =~ s#(.*)\.$#\L$1#; @@ -97,9 +92,7 @@ sub manifind { # $File::Find::name is unavailable. # Also, it's okay to use / here, because MANIFEST files use Unix-style # paths. - find({wanted => $wanted, - no_chdir => 1, - }, + find({wanted => $wanted}, $Is_MacOS ? ":" : "."); return $found; @@ -247,10 +240,10 @@ sub manicopy { $how ||= 'cp'; require File::Path; require File::Basename; - my(%dirs,$file); + $target = VMS::Filespec::unixify($target) if $Is_VMS; File::Path::mkpath([ $target ],! $Quiet,$Is_VMS ? undef : 0755); - foreach $file (keys %$read){ + foreach my $file (keys %$read){ if ($Is_MacOS) { if ($file =~ m!:!) { my $dir = _maccat($target, $file); @@ -275,7 +268,7 @@ sub cp_if_diff { -f $from or carp "$0: $from not found"; my($diff) = 0; local(*F,*T); - open(F,"< $from\0") or croak "Can't read $from: $!\n"; + open(F,"< $from\0") or die "Can't read $from: $!\n"; if (open(T,"< $to\0")) { while () { $diff++,last if $_ ne ; } $diff++ unless eof(T); @@ -312,15 +305,28 @@ sub ln { my ($srcFile, $dstFile) = @_; return &cp if $Is_VMS or ($^O eq 'MSWin32' and Win32::IsWin95()); link($srcFile, $dstFile); - local($_) = $dstFile; # chmod a+r,go-w+X (except "X" only applies to u=x) + + # chmod a+r,go-w+X (except "X" only applies to u=x) + local($_) = $dstFile; my $mode= 0444 | (stat)[2] & 0700; if (! chmod( $mode | ( $mode & 0100 ? 0111 : 0 ), $_ )) { - unlink $dstFile; - return; + unlink $dstFile; + return; } 1; } +unless (defined $Config{d_link}) { + # Really cool fix from Ilya :) + local $SIG{__WARN__} = sub { + warn @_ unless $_[0] =~ /^Subroutine .* redefined/; + }; + *ln = \&cp; +} + + + + sub best { my ($srcFile, $dstFile) = @_; if (-l $srcFile) { diff --git a/lib/ExtUtils/Mksymlists.pm b/lib/ExtUtils/Mksymlists.pm index 2455072..c5b4053 100644 --- a/lib/ExtUtils/Mksymlists.pm +++ b/lib/ExtUtils/Mksymlists.pm @@ -1,13 +1,14 @@ package ExtUtils::Mksymlists; -use 5.006; +use 5.00503; use strict qw[ subs refs ]; # no strict 'vars'; # until filehandles are exempted use Carp; use Exporter; use Config; -our(@ISA, @EXPORT, $VERSION); + +use vars qw(@ISA @EXPORT $VERSION); @ISA = 'Exporter'; @EXPORT = '&Mksymlists'; $VERSION = 1.18_00; diff --git a/lib/ExtUtils/Packlist.pm b/lib/ExtUtils/Packlist.pm index 077d503..11ab637 100644 --- a/lib/ExtUtils/Packlist.pm +++ b/lib/ExtUtils/Packlist.pm @@ -1,9 +1,10 @@ package ExtUtils::Packlist; -use 5.006; +use 5.00503; use strict; use Carp qw(); -our $VERSION = '0.04'; +use vars qw($VERSION); +$VERSION = '0.04'; # Used for generating filehandle globs. IO::File might not be available! my $fhname = "FH1"; diff --git a/lib/ExtUtils/t/00setup_dummy.t b/lib/ExtUtils/t/00setup_dummy.t index fae48de..3ec1d31 100644 --- a/lib/ExtUtils/t/00setup_dummy.t +++ b/lib/ExtUtils/t/00setup_dummy.t @@ -11,7 +11,7 @@ BEGIN { chdir 't'; use strict; -use Test::More tests => 7; +use Test::More tests => 9; use File::Path; use File::Basename; @@ -36,6 +36,21 @@ WriteMakefile( ); END + 'Big-Dummy/t/compile.t' => <<'END', +print "1..2\n"; + +print eval "use Big::Dummy; 1;" ? "ok 1\n" : "not ok 1\n"; +print "ok 2 - TEST_VERBOSE\n"; +END + + 'Big-Dummy/Liar/t/sanity.t' => <<'END', +print "1..3\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"; +END + 'Big-Dummy/Liar/lib/Big/Liar.pm' => <<'END', package Big::Liar; diff --git a/lib/ExtUtils/t/Command.t b/lib/ExtUtils/t/Command.t index 01d0186..709f3e1 100644 --- a/lib/ExtUtils/t/Command.t +++ b/lib/ExtUtils/t/Command.t @@ -41,8 +41,12 @@ BEGIN { } } + + # % means 'match one character' on VMS. Everything else is ? + my $match_char = $^O eq 'VMS' ? '%' : '?'; + ($ARGV[0] = $file) =~ s/.\z/$match_char/; + # this should find the file - ($ARGV[0] = $file) =~ s/.\z/\?/; ExtUtils::Command::expand_wildcards(); is( scalar @ARGV, 1, 'found one file' ); @@ -97,8 +101,8 @@ BEGIN { # to the beginning of the day in Win95. # There's a small chance of a 1 second flutter here. my $stamp = (stat($ARGV[0]))[9]; - ok( abs($now - $stamp) <= 1, 'checking modify time stamp' ) || - print "# mtime == $stamp, should be $now\n"; + cmp_ok( abs($now - $stamp), '<=', 1, 'checking modify time stamp' ) || + diag "mtime == $stamp, should be $now"; SKIP: { if ($^O eq 'amigaos' || $^O eq 'os2' || $^O eq 'MSWin32' || diff --git a/lib/ExtUtils/t/INST.t b/lib/ExtUtils/t/INST.t index e16be0a..d6780ac 100644 --- a/lib/ExtUtils/t/INST.t +++ b/lib/ExtUtils/t/INST.t @@ -58,9 +58,8 @@ isa_ok( $mm, 'ExtUtils::MakeMaker' ); is( $mm->{NAME}, 'Big::Dummy', 'NAME' ); is( $mm->{VERSION}, 0.01, 'VERSION' ); -my $config_prefix = $^O eq 'VMS' - ? $Config{installprefixexp} || $Config{prefix} - : $Config{installprefixexp}; +my $config_prefix = $Config{installprefixexp} || $Config{installprefix} || + $Config{prefixexp} || $Config{prefix}; is( $mm->{PREFIX}, $config_prefix, 'PREFIX' ); is( !!$mm->{PERL_CORE}, !!$ENV{PERL_CORE}, 'PERL_CORE' ); diff --git a/lib/ExtUtils/t/Installed.t b/lib/ExtUtils/t/Installed.t index cb6d3bb..d609f62 100644 --- a/lib/ExtUtils/t/Installed.t +++ b/lib/ExtUtils/t/Installed.t @@ -13,7 +13,6 @@ chdir 't'; use strict; -use warnings; use Config; use Cwd; @@ -21,7 +20,7 @@ use File::Path; use File::Basename; use File::Spec; -use Test::More tests => 42; +use Test::More tests => 45; BEGIN { use_ok( 'ExtUtils::Installed' ) } @@ -80,49 +79,45 @@ my @under = qw( boo bar baz ); ok( !$ei->_is_under('foo', @under), '... should find no file not under dirs'); ok( $ei->_is_under('baz', @under), '... should find file under dir' ); -# new -my $realei = ExtUtils::Installed->new(); - -isa_ok( $realei, 'ExtUtils::Installed' ); -isa_ok( $realei->{Perl}{packlist}, 'ExtUtils::Packlist' ); -is( $realei->{Perl}{version}, $Config{version}, - 'new() should set Perl version from %Config' ); my $wrotelist; -if (mkpath('auto/FakeMod')) { - if (open(PACKLIST, '>', 'auto/FakeMod/.packlist')) { - print PACKLIST 'list'; - close PACKLIST; - if (open(FAKEMOD, '>', 'auto/FakeMod/FakeMod.pm')) { - print FAKEMOD <<'FAKE'; +ok(mkpath('auto/FakeMod')); +END { rmtree 'auto/FakeMod' } + +ok(open(PACKLIST, '>auto/FakeMod/.packlist')); +print PACKLIST 'list'; +close PACKLIST; + +ok(open(FAKEMOD, '>auto/FakeMod/FakeMod.pm')); + +print FAKEMOD <<'FAKE'; package FakeMod; use vars qw( $VERSION ); $VERSION = '1.1.1'; 1; FAKE - close FAKEMOD; - $wrotelist = 1; - } - } -} - +close FAKEMOD; -SKIP: { - skip("could not write packlist: $!", 3 ) unless $wrotelist; - - # avoid warning and death by localizing glob - local *ExtUtils::Installed::Config; - my $fake_mod_dir = File::Spec->catdir(cwd(), 'auto', 'FakeMod'); - %ExtUtils::Installed::Config = ( - archlibexp => cwd(), - sitearchexp => $fake_mod_dir, - ); +{ + # avoid warning and death by localizing glob + local *ExtUtils::Installed::Config; + my $fake_mod_dir = File::Spec->catdir(cwd(), 'auto', 'FakeMod'); + %ExtUtils::Installed::Config = ( + %Config, + archlibexp => cwd(), + sitearchexp => $fake_mod_dir, + ); # necessary to fool new() push @INC, $fake_mod_dir; my $realei = ExtUtils::Installed->new(); + isa_ok( $realei, 'ExtUtils::Installed' ); + isa_ok( $realei->{Perl}{packlist}, 'ExtUtils::Packlist' ); + is( $realei->{Perl}{version}, $Config{version}, + 'new() should set Perl version from %Config' ); + ok( exists $realei->{FakeMod}, 'new() should find modules with .packlists'); isa_ok( $realei->{FakeMod}{packlist}, 'ExtUtils::Packlist' ); is( $realei->{FakeMod}{version}, '1.1.1', @@ -159,7 +154,7 @@ SKIP: { unless $Config{man1direxp}; @files = $ei->files('goodmod', 'doc', $Config{man1direxp}); is( scalar @files, 1, '... should find doc file under given dir' ); - is( grep({ /foo$/ } @files), 1, '... checking file name' ); + is( (grep { /foo$/ } @files), 1, '... checking file name' ); } SKIP: { skip('no man directories on this system', 1) unless $mandirs; diff --git a/lib/ExtUtils/t/MM_Cygwin.t b/lib/ExtUtils/t/MM_Cygwin.t index 74aef67..03641d3 100644 --- a/lib/ExtUtils/t/MM_Cygwin.t +++ b/lib/ExtUtils/t/MM_Cygwin.t @@ -46,7 +46,10 @@ delete $args->{CFLAGS}; # ExtUtils::MM_Cygwin::cflags() calls this, fake the output { - no warnings 'redefine'; + local $SIG{__WARN__} = sub { + # no warnings 'redefine'; + warn @_ unless $_[0] =~ /^Subroutine .* redefined/; + }; sub ExtUtils::MM_Unix::cflags { return $_[1] }; } @@ -77,6 +80,10 @@ like( $args->manifypods(), qr/pure_all\n\tnoecho/, $args->{MAN3PODS} = { foo => 1 }; my $out = tie *STDOUT, 'FakeOut'; { + local $SIG{__WARN__} = sub { + # no warnings 'redefine'; + warn @_ unless $_[0] =~ /used only once/; + }; no warnings 'once'; local *MM::perl_script = sub { return }; my $res = $args->manifypods(); diff --git a/lib/ExtUtils/t/MM_Unix.t b/lib/ExtUtils/t/MM_Unix.t index b2e4173..1e47f1b 100644 --- a/lib/ExtUtils/t/MM_Unix.t +++ b/lib/ExtUtils/t/MM_Unix.t @@ -24,6 +24,7 @@ BEGIN { BEGIN { use_ok( 'ExtUtils::MM_Unix' ); } +use vars qw($VERSION); $VERSION = '0.02'; use strict; use File::Spec; diff --git a/lib/ExtUtils/t/Manifest.t b/lib/ExtUtils/t/Manifest.t index 8c0246f..7a488be 100644 --- a/lib/ExtUtils/t/Manifest.t +++ b/lib/ExtUtils/t/Manifest.t @@ -20,7 +20,10 @@ use Cwd; # these files are needed for the module itself use File::Spec; use File::Path; -use Carp::Heavy; + +# We're going to be chdir'ing and modules are sometimes loaded on the +# fly in this test, so we need an absolute @INC. +@INC = map { File::Spec->rel2abs($_) } @INC; # keep track of everything added so it can all be deleted my %files; @@ -28,14 +31,16 @@ sub add_file { my ($file, $data) = @_; $data ||= 'foo'; unlink $file; # or else we'll get multiple versions on VMS - open( my $T, '>', $file) or return; - print $T $data; + open( T, '>'.$file) or return; + print T $data; ++$files{$file}; + close T; } sub read_manifest { - open( my $M, 'MANIFEST' ) or return; - chomp( my @files = <$M> ); + open( M, 'MANIFEST' ) or return; + chomp( my @files = ); + close M; return @files; } @@ -136,9 +141,9 @@ ok( mkdir( 'copy', 0777 ), 'made copy directory' ); $files = maniread(); eval { (undef, $warn) = catch_warning( sub { - manicopy( $files, 'copy', 'cp' ) }) + manicopy( $files, 'copy', 'cp' ) }) }; -like( $@, qr/^Can't read none: /, 'carped about none' ); +like( $@, qr/^Can't read none: /, 'croaked about none' ); # a newline comes through, so get rid of it chomp($warn); diff --git a/lib/ExtUtils/t/Mkbootstrap.t b/lib/ExtUtils/t/Mkbootstrap.t index 43de3b2..fe07ddf 100644 --- a/lib/ExtUtils/t/Mkbootstrap.t +++ b/lib/ExtUtils/t/Mkbootstrap.t @@ -81,7 +81,7 @@ SKIP: { chmod 0444, 'dasboot.bs'; SKIP: { - skip("can write readonly files", 1) if -w 'dasboot.bs'; + skip("cannot write readonly files", 1) if -w 'dasboot.bs'; eval{ Mkbootstrap('dasboot', 1) }; like( $@, qr/Unable to open dasboot\.bs/, 'should die given bad filename' ); diff --git a/lib/ExtUtils/t/Packlist.t b/lib/ExtUtils/t/Packlist.t index 66fbea5..58eaf8f 100644 --- a/lib/ExtUtils/t/Packlist.t +++ b/lib/ExtUtils/t/Packlist.t @@ -92,7 +92,7 @@ SKIP: { chmod 0444, 'eplist'; SKIP: { - skip("can write readonly files", 1) if -w 'eplist'; + skip("cannot write readonly files", 1) if -w 'eplist'; eval { ExtUtils::Packlist::write({}, 'eplist') }; like( $@, qr/Can't open file/, 'write() should croak on open failure' ); diff --git a/lib/ExtUtils/t/VERSION_FROM.t b/lib/ExtUtils/t/VERSION_FROM.t index 4f3655f..332b723 100644 --- a/lib/ExtUtils/t/VERSION_FROM.t +++ b/lib/ExtUtils/t/VERSION_FROM.t @@ -1,3 +1,5 @@ +#!/usr/bin/perl -w + BEGIN { if( $ENV{PERL_CORE} ) { chdir 't' if -d 't'; @@ -19,7 +21,7 @@ use File::Path; perl_lib(); -mkdir 'Odd-Version'; +mkdir('Odd-Version', 0777); END { chdir File::Spec->updir; rmtree 'Odd-Version' } chdir 'Odd-Version'; diff --git a/lib/ExtUtils/t/basic.t b/lib/ExtUtils/t/basic.t index ff9b859..740eefd 100644 --- a/lib/ExtUtils/t/basic.t +++ b/lib/ExtUtils/t/basic.t @@ -21,7 +21,27 @@ use TieOut; my $perl = which_perl(); -chdir 't'; +my $root_dir = 't'; + +if( $^O eq 'VMS' ) { + # On older systems we might exceed the 8-level directory depth limit + # imposed by RMS. We get around this with a rooted logical, but we + # can't create logical names with attributes in Perl, so we do it + # in a DCL subprocess and put it in the job table so the parent sees it. + open( BFDTMP, '>bfdtesttmp.com' ) || die "Error creating command file; $!"; + print BFDTMP <<'COMMAND'; +$ BFD_TEST_ROOT = F$PARSE("[.t]",,,,"NO_CONCEAL")-".][000000"-"]["-"].;"+".]" +$ DEFINE/JOB/NOLOG/TRANSLATION=CONCEALED BFD_TEST_ROOT 'BFD_TEST_ROOT' +COMMAND + close BFDTMP; + + system '@bfdtesttmp.com'; + END { 1 while unlink 'bfdtesttmp.com' } + $root_dir = 'BFD_TEST_ROOT:[000000]'; +} + +chdir $root_dir; + perl_lib; @@ -32,32 +52,6 @@ $| = 1; ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) || diag("chdir failed: $!"); - -# The perl core test suite will run any .t file in the MANIFEST. -# So we have to generate this on the fly. -mkdir 't' || die "Can't create test dir: $!"; -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::Dummy; 1;" ? "ok 1\n" : "not ok 1\n"; -print "ok 2 - TEST_VERBOSE\n"; -COMPILE_T -close TEST; - -mkdir 'Liar/t' || die "Can't create test dir: $!"; -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::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; - -END { unlink 't/compile.t', 'Liar/t/sanity.t' } - my @mpl_out = `$perl Makefile.PL PREFIX=dummy-install`; cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) || diff --git a/lib/ExtUtils/t/hints.t b/lib/ExtUtils/t/hints.t index e979cd7..62608d7 100644 --- a/lib/ExtUtils/t/hints.t +++ b/lib/ExtUtils/t/hints.t @@ -13,7 +13,7 @@ chdir 't'; use Test::More tests => 3; -mkdir 'hints'; +mkdir('hints', 0777); my $hint_file = "hints/$^O.pl"; open(HINT, ">$hint_file") || die "Can't write dummy hints file $hint_file: $!"; print HINT <<'CLOO';