From: Craig A. Berry Date: Fri, 26 Oct 2007 23:59:42 +0000 (+0000) Subject: In the revised Module::Build, don't create temp directories X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3143ec600f79205281fb493535fd6e6fe3615c9d;p=p5sagit%2Fp5-mst-13.2.git In the revised Module::Build, don't create temp directories with dots in the names. Also, restore some VMS fixes that regressed in the last integration. p4raw-id: //depot/perl@32195 --- diff --git a/lib/Module/Build/t/destinations.t b/lib/Module/Build/t/destinations.t index e3b4173..b28abf5 100644 --- a/lib/Module/Build/t/destinations.t +++ b/lib/Module/Build/t/destinations.t @@ -16,7 +16,7 @@ chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; use Config; -use File::Spec::Functions qw( catdir splitdir ); +use File::Spec::Functions qw( catdir splitdir splitpath ); ######################### @@ -300,10 +300,12 @@ sub have_same_ending { my ($dir1, $dir2, $message) = @_; $dir1 =~ s{/$}{} if $^O eq 'cygwin'; # remove any trailing slash - my @dir1 = splitdir $dir1; + my (undef, $dirs1, undef) = splitpath $dir1; + my @dir1 = splitdir $dirs1; $dir2 =~ s{/$}{} if $^O eq 'cygwin'; # remove any trailing slash - my @dir2 = splitdir $dir2; + my (undef, $dirs2, undef) = splitpath $dir2; + my @dir2 = splitdir $dirs2; is $dir1[-1], $dir2[-1], $message; } diff --git a/lib/Module/Build/t/install.t b/lib/Module/Build/t/install.t index 397dfe6..42fafc5 100644 --- a/lib/Module/Build/t/install.t +++ b/lib/Module/Build/t/install.t @@ -56,7 +56,7 @@ my $mb = Module::Build->new_from_context( ok $mb; -my $destdir = File::Spec->catdir($cwd, 't', 'install_test.' . $$); +my $destdir = File::Spec->catdir($cwd, 't', 'install_test' . $$); $mb->add_to_cleanup($destdir); { diff --git a/lib/Module/Build/t/lib/MBTest.pm b/lib/Module/Build/t/lib/MBTest.pm index 6764daf..a2443b4 100644 --- a/lib/Module/Build/t/lib/MBTest.pm +++ b/lib/Module/Build/t/lib/MBTest.pm @@ -62,7 +62,7 @@ __PACKAGE__->export(scalar caller, @extra_exports); { # Setup a temp directory if it doesn't exist my $cwd = Cwd::cwd; - my $tmp = File::Spec->catdir( $cwd, 't', '_tmp.' . $$); + my $tmp = File::Spec->catdir( $cwd, 't', '_tmp' . $$); mkdir $tmp, 0777 unless -d $tmp; sub tmpdir { $tmp } diff --git a/lib/Module/Build/t/manifypods.t b/lib/Module/Build/t/manifypods.t index b3b8084..b0c7328 100644 --- a/lib/Module/Build/t/manifypods.t +++ b/lib/Module/Build/t/manifypods.t @@ -58,7 +58,7 @@ $dist->regen; chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; use File::Spec::Functions qw( catdir ); -my $destdir = catdir($cwd, 't', 'install_test.' . $$); +my $destdir = catdir($cwd, 't', 'install_test' . $$); my $mb = Module::Build->new( @@ -118,7 +118,7 @@ while (my ($from, $v) = each %distro) { next; } - my $to = File::Spec->catfile('blib', ($from =~ /^lib/ ? 'libdoc' : 'bindoc'), $v); + my $to = File::Spec->catfile('blib', ($from =~ /^[\.\/\[]*lib/ ? 'libdoc' : 'bindoc'), $v); ok $mb->contains_pod($from), "$from should contain POD"; ok -e $to, "Created $to manpage"; } diff --git a/lib/Module/Build/t/xs.t b/lib/Module/Build/t/xs.t index 2eb0595..25e1759 100644 --- a/lib/Module/Build/t/xs.t +++ b/lib/Module/Build/t/xs.t @@ -109,7 +109,7 @@ $dist->remove; # Try a XS distro with a deep namespace -$dist = DistGen->new( name => 'Simple::With::Deep::Namespace', +$dist = DistGen->new( name => 'Simple::With::Deep::Name', dir => $tmp, xs => 1 ); $dist->regen; chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!";