[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl-Porters] [PATCH 5.6.0] fix :base:term.t for use on MacOS




With the enclosed patch, and with the extra step of copying
:MacPerl:macos:lib:Config.pm to :MacPerl:lib: (so as to take
care of the C<use Config;> statement which is there to handle
EBCDIC machines and _could_ be re-written), I find that my
MPW PPC miniperl can successfully run all the tests in :t:base:
if I directory into :t: and have the :macos: folder in my {Commands}
path I can simply run:

   miniperl :base:term.t

This looks pretty straightforward and apart from the Config.pm
issue (which I think could be addressed by tweaking the
:macos:makefile.mk to handle the Config.pm couldn't it?) I think
it'd be acceptable to p5p:

--- :base:term.t.orig	Tue Jul 20 17:18:11 1999
+++ :base:term.t	Sun May 14 08:40:05 2000
@@ -4,7 +4,12 @@
 
 BEGIN {
     chdir 't' if -d 't';
-    unshift @INC, '../lib';
+	if ($^O eq "MacOS") {
+        unshift @INC, '::lib:';
+    }
+	else {
+		unshift @INC, '../lib';
+	}
 }
 
 use Config;
@@ -16,7 +21,8 @@
 $x = "\n";
 # 10 is ASCII/Iso Latin, 21 is EBCDIC.
 if ($x eq chr(10) ||
-    ($Config{ebcdic} eq 'define' && $x eq chr(21))) {print "ok 1\n";}
+    ($Config{ebcdic} eq 'define' && $x eq chr(21)) ||
+	($x eq chr(13) && $^O eq 'MacOS')) {print "ok 1\n";}
 else {print "not ok 1\n";}
 
 # check `` processing
@@ -42,7 +48,7 @@
 
 # check <> pseudoliteral
 
-open(try, "/dev/null") || open(try,"nla0:") || (die "Can't open /dev/null.");
+open(try, "/dev/null") || open(try,"nla0:") || open(try,"Dev:Null") || (die "Can't open /dev/null.");
 if (<try> eq '') {
     print "ok 6\n";
 }
@@ -51,5 +57,5 @@
     die "/dev/null IS NOT A CHARACTER SPECIAL FILE!!!!\n" unless -c '/dev/null';
 }
 
-open(try, "../Configure") || (die "Can't open ../Configure.");
+open(try, "../Configure") || open (try, "::Configure") || (die "Can't open ../Configure.");
 if (<try> ne '') {print "ok 7\n";} else {print "not ok 7\n";}
End of Patch.

Peter Prymmer





==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-porters-request@macperl.org