Miscellaneous MacOS Classic library updates from Matthias Neeracher.
authorJarkko Hietaniemi <jhi@iki.fi>
Mon, 23 Oct 2000 12:16:47 +0000 (12:16 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Mon, 23 Oct 2000 12:16:47 +0000 (12:16 +0000)
p4raw-id: //depot/perl@7412

lib/ExtUtils/Mksymlists.pm
lib/File/Basename.pm
lib/File/Path.pm
lib/Term/ReadLine.pm
lib/perl5db.pl

index c8f41c7..c06b393 100644 (file)
@@ -49,6 +49,7 @@ sub Mksymlists {
     }
 
     if    ($osname eq 'aix') { _write_aix(\%spec); }
+    elsif ($osname eq 'MacOS'){ _write_aix(\%spec) }
     elsif ($osname eq 'VMS') { _write_vms(\%spec) }
     elsif ($osname eq 'os2') { _write_os2(\%spec) }
     elsif ($osname eq 'MSWin32') { _write_win32(\%spec) }
index 4581e7e..2795036 100644 (file)
@@ -236,7 +236,14 @@ sub dirname {
         if ($_[0] =~ m#/#) { $fstype = '' }
         else { return $dirname || $ENV{DEFAULT} }
     }
-    if ($fstype =~ /MacOS/i) { return $dirname }
+    if ($fstype =~ /MacOS/i) {
+       $dirname =~ s/([^:]):\z/$1/s;
+       unless( length($basename) ) {
+           local($File::Basename::Fileparse_fstype) = $fstype;
+           ($basename,$dirname) = fileparse $dirname;
+           $dirname =~ s/([^:]):\z/$1/s;
+       }
+    }
     elsif ($fstype =~ /MSDOS/i) { 
         $dirname =~ s/([^:])[\\\/]*\z/$1/;
         unless( length($basename) ) {
index 46f360a..daa2eae 100644 (file)
@@ -105,8 +105,8 @@ my $Is_VMS = $^O eq 'VMS';
 
 # These OSes complain if you want to remove a file that you have no
 # write permission to:
-my $force_writeable = ($^O eq 'os2' || $^O eq 'dos' || $^O eq 'MSWin32'
-                      || $^O eq 'amigaos');
+my $force_writeable = ($^O eq 'os2' || $^O eq 'dos' || $^O eq 'MSWin32' ||
+                      $^O eq 'amigaos' || $^O eq 'MacOS');
 
 sub mkpath {
     my($paths, $verbose, $mode) = @_;
index 8bb8205..fc78d7b 100644 (file)
@@ -169,12 +169,14 @@ sub ReadLine {'Term::ReadLine::Stub'}
 sub readline {
   my $self = shift;
   my ($in,$out,$str) = @$self;
-  print $out $rl_term_set[0], shift, $rl_term_set[1], $rl_term_set[2]; 
+  my $prompt = shift;
+  print $out $rl_term_set[0], $prompt, $rl_term_set[1], $rl_term_set[2]; 
   $self->register_Tk 
      if not $Term::ReadLine::registered and $Term::ReadLine::toloop
        and defined &Tk::DoOneEvent;
   #$str = scalar <$in>;
   $str = $self->get_line;
+  $str =~ s/^\s*\Q$prompt\E// if ($^O eq 'MacOS');
   print $out $rl_term_set[3]; 
   # bug in 5.000: chomping empty string creats length -1:
   chomp $str if defined $str;
@@ -185,7 +187,9 @@ sub addhistory {}
 sub findConsole {
     my $console;
 
-    if (-e "/dev/tty") {
+    if ($^O eq 'MacOS') {
+        $console = "Dev:Console";
+    } elsif (-e "/dev/tty") {
        $console = "/dev/tty";
     } elsif (-e "con" or $^O eq 'MSWin32') {
        $console = "con";
index fb6d683..836e559 100644 (file)
@@ -401,6 +401,12 @@ if ($notty) {
     $console = "/dev/tty";
   } elsif ($^O eq 'dos' or -e "con" or $^O eq 'MSWin32') {
     $console = "con";
+  } elsif ($^O eq 'MacOS') {
+    if ($MacPerl::Version !~ /MPW/) {
+      $console = "Dev:Console:Perl Debug"; # Separate window for application
+    } else {
+      $console = "Dev:Console";
+    }
   } else {
     $console = "sys\$command";
   }