summaryrefslogtreecommitdiff
path: root/lib/Devel
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-05-31 21:42:12 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-05-31 21:42:12 +0000
commitd5201bd266fe42b2df8b480183c08be291a1ad06 (patch)
treee7f719e75b91b93f6b813831b273f6d3dca6c15e /lib/Devel
parent83943eac2433a9cd52f114532df2a61529f109a2 (diff)
downloadperl-d5201bd266fe42b2df8b480183c08be291a1ad06.tar.gz
Integrate macperl patches #16926 and #16938;
Big MacPerl Testing Patch No. 2 Big MacPerl Testing Patch No. 3 p4raw-id: //depot/perl@16942 p4raw-integrated: from //depot/macperl@16937 'copy in' lib/Devel/SelfStubber.pm lib/Devel/SelfStubber.t lib/File/DosGlob.t lib/File/Path.t lib/File/Spec/t/Spec.t lib/File/Temp.pm lib/FindBin.t lib/Tie/File/t/09_gen_rs.t lib/lib.t t/comp/use.t utils/dprofpp.PL utils/splain.PL (@16123..) t/lib/MakeMaker/Test/Utils.pm (@16230..) lib/diagnostics.t (@16646..) lib/ExtUtils/t/00setup_dummy.t lib/ExtUtils/t/Command.t (@16730..) lib/lib_pm.PL (@16926..) lib/ExtUtils/MM_MacOS.pm lib/Test/Harness/Straps.pm lib/Test/Harness/t/callback.t lib/Test/Harness/t/strap-analyze.t lib/Test/Harness/t/test-harness.t (@16929..) p4raw-integrated: from //depot/macperl@16926 'merge in' lib/English.t (@16123..) ext/DynaLoader/DynaLoader_pm.PL (@16868..)
Diffstat (limited to 'lib/Devel')
-rw-r--r--lib/Devel/SelfStubber.pm6
-rw-r--r--lib/Devel/SelfStubber.t12
2 files changed, 12 insertions, 6 deletions
diff --git a/lib/Devel/SelfStubber.pm b/lib/Devel/SelfStubber.pm
index baf46dcb5a..bfdb4430d0 100644
--- a/lib/Devel/SelfStubber.pm
+++ b/lib/Devel/SelfStubber.pm
@@ -1,4 +1,5 @@
package Devel::SelfStubber;
+use File::Spec;
require SelfLoader;
@ISA = qw(SelfLoader);
@EXPORT = 'AUTOLOAD';
@@ -29,10 +30,11 @@ sub _package_defined {
sub stub {
my($self,$module,$lib) = @_;
my($line,$end_data,$fh,$mod_file,$found_selfloader);
- $lib ||= '.';
+ $lib ||= File::Spec->curdir();
($mod_file = $module) =~ s,::,/,g;
+ $mod_file =~ tr|/|:| if $^O eq 'MacOS';
- $mod_file = "$lib/$mod_file.pm";
+ $mod_file = File::Spec->catfile($lib, "$mod_file.pm");
$fh = "${module}::DATA";
my (@BEFORE_DATA, @AFTER_DATA, @AFTER_END);
@DATA = @STUBS = ();
diff --git a/lib/Devel/SelfStubber.t b/lib/Devel/SelfStubber.t
index 2e74a022d6..b5deb142fa 100644
--- a/lib/Devel/SelfStubber.t
+++ b/lib/Devel/SelfStubber.t
@@ -7,8 +7,10 @@ BEGIN {
use strict;
use Devel::SelfStubber;
+use File::Spec::Functions;
my $runperl = "$^X \"-I../lib\"";
+$runperl =~ s|../lib|::lib:| if $^O eq 'MacOS';
# ensure correct output ordering for system() calls
@@ -31,7 +33,8 @@ push @cleanup, $inlib;
while (<DATA>) {
if (/^\#{16,}\s+(.*)/) {
- my $file = "$inlib/$1";
+ my $f = $1;
+ my $file = catfile(curdir(),$inlib,$f);
push @cleanup, $file;
open FH, ">$file" or die $!;
} else {
@@ -169,8 +172,9 @@ $Devel::SelfStubber::JUST_STUBS=0;
undef $/;
foreach my $module (@module, 'Data', 'End') {
- my $file = "$lib/$module.pm";
- open FH, "$inlib/$module.pm" or die $!;
+ my $file = catfile(curdir(),$lib,"$module.pm");
+ my $fileo = catfile(curdir(),$inlib,"$module.pm");
+ open FH, $fileo or die "Can't open $fileo: $!";
my $contents = <FH>;
close FH or die $!;
push @cleanup, $file;
@@ -210,7 +214,7 @@ system "$runperl -w \"-I$lib\" \"-MData\" -e \"Data::ok\"";
system "$runperl -w \"-I$lib\" \"-MEnd\" -e \"End::lime\"";
# But check that the documentation after the __END__ survived.
-open FH, "$lib/End.pm" or die $!;
+open FH, catfile(curdir(),$lib,"End.pm") or die $!;
$_ = <FH>;
close FH or die $!;