+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)
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';
=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<NOT>
+
+ perl -MExtUtils::Command -e 'some_command qw(some files to work on)'
+
+Filenames with * and ? will be glob expanded.
=over 4
sub rm_rf
{
- rmtree([grep -e $_,expand_wildcards()],0,0);
+ expand_wildcards();
+ rmtree([grep -e $_,@ARGV],0,0);
}
=item rm_f files....
sub rm_f
{
- foreach (expand_wildcards())
+ expand_wildcards();
+ foreach (@ARGV)
{
next unless -f $_;
next if unlink($_);
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...
sub mkpath
{
- File::Path::mkpath([expand_wildcards()],0,0777);
+ expand_wildcards();
+ File::Path::mkpath([@ARGV],0,0777);
}
=item test_f file
use strict;
-require 5.006;
+require 5.005_03;
require Exporter;
use vars qw($VERSION @ISA @EXPORT);
@ISA = qw(Exporter);
package ExtUtils::Install;
-use 5.006;
-our(@ISA, @EXPORT, $VERSION);
+use 5.00503;
+use vars qw(@ISA @EXPORT $VERSION);
$VERSION = 1.29;
use Exporter;
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 {
package ExtUtils::Installed;
-use 5.006;
+use 5.00503;
use strict;
use Carp qw();
use ExtUtils::Packlist;
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)$/);
package ExtUtils::Liblist;
use vars qw($VERSION);
-
-$VERSION = 1.0;
+$VERSION = '1.00';
use File::Spec;
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__
# 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';
use vars qw(@ISA $VERSION);
@ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
-$VERSION = 1.01_01;
+$VERSION = 1.02_01;
=item perl_archive
@ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
use vars qw($VERSION);
-
-$VERSION = 1.0;
+$VERSION = '1.00';
use Config;
use Cwd 'cwd';
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);
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
}
# 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;
END
+ $m .= $self->dir_target('$(INST_ARCHAUTODIR)');
return $m;
}
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;
}
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 (
$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
# 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");
}
$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)');
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;
$_
}; \$$2
};
- no warnings;
+ local $^W = 0;
$result = eval($eval);
warn "Could not eval '$eval' in $parsefile: $@" if $@;
last;
=cut
-our %olbs;
+use vars qw(%olbs);
sub makeaperl {
my($self, %attribs) = @_;
-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;
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:
}
sub _run_hintfile {
- our $self;
+ no strict 'vars';
local($self) = shift; # make $self available to the hint file.
my($hint_file) = shift;
# 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
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
$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
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');
$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;
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#;
# $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;
$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);
-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 (<F>) { $diff++,last if $_ ne <T>; }
$diff++ unless eof(T);
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) {
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;
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";
chdir 't';
use strict;
-use Test::More tests => 7;
+use Test::More tests => 9;
use File::Path;
use File::Basename;
);
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;
}
}
+
+ # % 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' );
# 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' ||
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' );
use strict;
-use warnings;
use Config;
use Cwd;
use File::Basename;
use File::Spec;
-use Test::More tests => 42;
+use Test::More tests => 45;
BEGIN { use_ok( 'ExtUtils::Installed' ) }
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',
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;
# 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] };
}
$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();
BEGIN { use_ok( 'ExtUtils::MM_Unix' ); }
+use vars qw($VERSION);
$VERSION = '0.02';
use strict;
use File::Spec;
# 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;
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 = <M> );
+ close M;
return @files;
}
$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);
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' );
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' );
+#!/usr/bin/perl -w
+
BEGIN {
if( $ENV{PERL_CORE} ) {
chdir 't' if -d 't';
perl_lib();
-mkdir 'Odd-Version';
+mkdir('Odd-Version', 0777);
END { chdir File::Spec->updir; rmtree 'Odd-Version' }
chdir 'Odd-Version';
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;
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' ) ||
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';