This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate macperl changes #16974 and #16975;
authorJarkko Hietaniemi <jhi@iki.fi>
Wed, 5 Jun 2002 00:07:15 +0000 (00:07 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Wed, 5 Jun 2002 00:07:15 +0000 (00:07 +0000)
nativize() isn't happy with absolute Mac paths

Test::Harness test fixes, attempt #3 :-)
p4raw-link: @16974 on //depot/macperl: 594896ac796bb1aa12d08048b3e095be1cebc16d

p4raw-id: //depot/perl@16989
p4raw-integrated: from //depot/macperl@16987 'copy in'
ext/DynaLoader/DynaLoader_pm.PL (@16929..)
lib/ExtUtils/MM_MacOS.pm (@16938..)
lib/Test/Harness/t/callback.t
lib/Test/Harness/t/strap-analyze.t
lib/Test/Harness/t/test-harness.t lib/lib_pm.PL (@16968..)

ext/DynaLoader/DynaLoader_pm.PL
lib/ExtUtils/MM_MacOS.pm
lib/Test/Harness/t/callback.t
lib/Test/Harness/t/strap-analyze.t
lib/Test/Harness/t/test-harness.t
lib/lib_pm.PL

index 8c44b40..f442579 100644 (file)
@@ -254,7 +254,7 @@ sub bootstrap {
        my $dir;
        if ($Is_MacOS) {
            my $path = $_;
-           if ($Mac_FS) {
+           if ($Mac_FS && ! -d $path) {
                $path = Mac::FileSpec::Unixish::nativize($path);
            }
            $path .= ":"  unless /:$/;
index af4a0d6..71eb969 100644 (file)
@@ -242,22 +242,19 @@ Translate relative path names into Mac names.
 =cut
 
 sub macify {
-    # mmm, better ... and this condition should always be satisified,
-    # as the module is now distributed with MacPerl, but leave in anyway
-    if ($Mac_FS) {
-        return Mac::FileSpec::Unixish::nativize($_[0]);
-    }
-
     my($unix) = @_;
     my(@mac);
 
-    $unix =~ s|^\./||;
-
     foreach (split(/[ \t\n]+/, $unix)) {
        if (m|/|) {
-           $_ = ":$_";
-           s|/|:|g;
-       } 
+           if ($Mac_FS) { # should always be true
+               $_ = Mac::FileSpec::Unixish::nativize($_);
+           } else {
+               s|^\./||;
+               s|/|:|g;
+               $_ = ":$_";
+           }
+       }
        push(@mac, $_);
     }
     
index eeea1e4..74b2fe9 100644 (file)
@@ -57,7 +57,7 @@ $SAMPLE_TESTS = VMS::Filespec::unixify($SAMPLE_TESTS) if $^O eq 'VMS';
 while( my($test, $expect) = each %samples ) {
     local @out = ();
 
-    $strap->analyze_file($^O eq 'macos' ?
+    $strap->analyze_file($^O eq 'MacOS' ?
                         catfile($SAMPLE_TESTS, $test) :
                         "$SAMPLE_TESTS/$test");
 
index 30d363d..c3e3d1e 100644 (file)
@@ -466,7 +466,7 @@ while( my($test, $expect) = each %samples ) {
     }
 
     my $strap = Test::Harness::Straps->new;
-    my %results = $strap->analyze_file($^O eq 'macos' ?
+    my %results = $strap->analyze_file($^O eq 'MacOS' ?
                                        catfile($SAMPLE_TESTS, $test) :
                                        "$SAMPLE_TESTS/$test");
 
index 3cb0abb..1e9f58d 100644 (file)
@@ -433,7 +433,7 @@ while (my($test, $expect) = each %samples) {
         select NULL;    # _run_all_tests() isn't as quiet as it should be.
         local $SIG{__WARN__} = sub { $warning .= join '', @_; };
         ($totals, $failed) = 
-          Test::Harness::_run_all_tests($^O eq 'macos' ?
+          Test::Harness::_run_all_tests($^O eq 'MacOS' ?
                                        catfile($SAMPLE_TESTS, $test) :
                                        "$SAMPLE_TESTS/$test");
     };
@@ -453,7 +453,7 @@ while (my($test, $expect) = each %samples) {
         is_deeply( {map { $_=>$totals->{$_} } keys %{$expect->{total}}},
                    $expect->{total},
                                                   "$test - totals" );
-        is_deeply( {map { $_=>$failed->{$^O eq 'macos' ?
+        is_deeply( {map { $_=>$failed->{$^O eq 'MacOS' ?
                                         catfile($SAMPLE_TESTS, $test) :
                                         "$SAMPLE_TESTS/$test"}{$_} }
                     keys %{$expect->{failed}}},
index 8e94906..6c9ab05 100644 (file)
@@ -149,7 +149,7 @@ sub _get_dirs {
 sub _nativize {
     my($dir) = @_;
 
-    if ($Is_MacOS && $Mac_FS) {
+    if ($Is_MacOS && $Mac_FS && ! -d $dir) {
        $dir = Mac::FileSpec::Unixish::nativize($dir);
        $dir .= ":" unless $dir =~ /:$/;
     }