In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/c457df0449f0dea3e420c5db9e823240ec3148a0?hp=8f8c2a4448d4895f07a65262094032f124603527>
- Log ----------------------------------------------------------------- commit c457df0449f0dea3e420c5db9e823240ec3148a0 Author: Nicholas Clark <[email protected]> Date: Mon Jun 21 21:40:27 2010 +0100 Remove MacOS classic support from DynaLoader. ExtUtils::MakeMaker removed MacOS support in 6.25, merged to blead in December 2004, so this code is vestigial, and a small maintenance penalty. M MANIFEST M ext/DynaLoader/DynaLoader_pm.PL D ext/DynaLoader/dl_mac.xs commit 862f843bac3434c2861e482369451dae9f8ce17c Author: Nicholas Clark <[email protected]> Date: Mon Jun 21 21:10:40 2010 +0100 Remove MacOS classic support from File::{Copy,DosGlob,Find,Glob,stat}. ExtUtils::MakeMaker removed MacOS support in 6.25, merged to blead in December 2004, so this code is vestigial, and a small runtime penalty. M ext/File-Glob/Glob.pm M lib/File/Copy.pm M lib/File/DosGlob.pm M lib/File/Find.pm M lib/File/stat.pm commit e713b73750eb9e684a6d14dcca1a22d55ce2226d Author: Nicholas Clark <[email protected]> Date: Mon Jun 21 21:09:52 2010 +0100 Remove MacOS classic support from File::Basename. ExtUtils::MakeMaker removed MacOS support in 6.25, merged to blead in December 2004, so this code is vestigial, and a small runtime penalty. M lib/File/Basename.pm M lib/File/Basename.t commit f64e7edf51fa6878ada89003ea04b8672baadbb3 Author: Nicholas Clark <[email protected]> Date: Mon Jun 21 20:42:38 2010 +0100 Remove MacOS classic support from blib, diagnostics and Term::ReadLine. ExtUtils::MakeMaker removed MacOS support in 6.25, merged to blead in December 2004, so this code is vestigial, and a small runtime penalty. M lib/Term/ReadLine.pm M lib/blib.pm M lib/diagnostics.pm commit 2b894b7afaeab63c3565bccc12e75832831eb18f Author: Nicholas Clark <[email protected]> Date: Mon Jun 21 20:42:10 2010 +0100 Remove MacOS classic support from the debugger. ExtUtils::MakeMaker removed MacOS support in 6.25, merged to blead in December 2004, so this code is vestigial, and a small runtime penalty. M lib/DB.pm M lib/perl5db.pl commit df0d8043b5e8cb96091cbe5bda160a4997cb1b19 Author: Nicholas Clark <[email protected]> Date: Mon Jun 21 20:25:53 2010 +0100 Remove MacOS classic support from lib. ExtUtils::MakeMaker removed MacOS support in 6.25, merged to blead in December 2004, so this code in lib is vestigial, and a small runtime penalty. M dist/lib/lib_pm.PL ----------------------------------------------------------------------- Summary of changes: MANIFEST | 1 - dist/lib/lib_pm.PL | 47 ++-------- ext/DynaLoader/DynaLoader_pm.PL | 51 +--------- ext/DynaLoader/dl_mac.xs | 162 ------------------------------ ext/File-Glob/Glob.pm | 4 +- lib/DB.pm | 11 +-- lib/File/Basename.pm | 22 +---- lib/File/Basename.t | 30 +------ lib/File/Copy.pm | 29 ------ lib/File/DosGlob.pm | 46 +--------- lib/File/Find.pm | 205 +++++++++------------------------------ lib/File/stat.pm | 3 - lib/Term/ReadLine.pm | 7 +- lib/blib.pm | 12 +-- lib/diagnostics.pm | 8 +-- lib/perl5db.pl | 26 +----- 16 files changed, 72 insertions(+), 592 deletions(-) delete mode 100644 ext/DynaLoader/dl_mac.xs diff --git a/MANIFEST b/MANIFEST index 6cd7aa9..b1e4b5a 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2980,7 +2980,6 @@ ext/DynaLoader/dl_dllload.xs S/390 dllload() style implementation ext/DynaLoader/dl_dlopen.xs BSD/SunOS4&5 dlopen() style implementation ext/DynaLoader/dl_dyld.xs NeXT/Apple dyld implementation ext/DynaLoader/dl_hpux.xs HP-UX implementation -ext/DynaLoader/dl_mac.xs MacOS implementation ext/DynaLoader/dl_mpeix.xs MPE/iX implementation ext/DynaLoader/dl_next.xs NeXT implementation ext/DynaLoader/dl_none.xs Stub implementation diff --git a/dist/lib/lib_pm.PL b/dist/lib/lib_pm.PL index fabdbd0..8706e82 100644 --- a/dist/lib/lib_pm.PL +++ b/dist/lib/lib_pm.PL @@ -86,13 +86,7 @@ my \...@inc_version_list = $Config_inc_version_list; print OUT <<'!NO!SUBS!'; our @ORIG_INC = @INC; # take a handy copy of 'original' value -our $VERSION = '0.62'; -my $Is_MacOS = $^O eq 'MacOS'; -my $Mac_FS; -if ($Is_MacOS) { - require File::Spec; - $Mac_FS = eval { require Mac::FileSpec::Unixish }; -} +our $VERSION = '0.63'; sub import { shift; @@ -105,8 +99,6 @@ sub import { Carp::carp("Empty compile time value given to use lib"); } - $path = _nativize($path); - if ($path !~ /\.par$/i && -e $path && ! -d _) { require Carp; Carp::carp("Parameter to use lib must be directory, not file"); @@ -115,9 +107,7 @@ sub import { # Add any previous version directories we found at configure time foreach my $incver (@inc_version_list) { - my $dir = $Is_MacOS - ? File::Spec->catdir( $path, $incver ) - : "$path/$incver"; + my $dir = "$path/$incver"; unshift(@INC, $dir) if -d $dir; } # Put a corresponding archlib directory in front of $path if it @@ -139,9 +129,7 @@ sub unimport { shift; my %names; - foreach (@_) { - my $path = _nativize($_); - + foreach my $path (@_) { my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir) = _get_dirs($path); ++$names{$path}; @@ -159,31 +147,12 @@ sub _get_dirs { my($dir) = @_; my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir); - # we could use this for all platforms in the future, but leave it - # Mac-only for now, until there is more time for testing it. - if ($Is_MacOS) { - $arch_auto_dir = File::Spec->catdir( $dir, $archname, 'auto' ); - $arch_dir = File::Spec->catdir( $dir, $archname, ); - $version_dir = File::Spec->catdir( $dir, $version ); - $version_arch_dir = File::Spec->catdir( $dir, $version, $archname ); - } else { - $arch_auto_dir = "$dir/$archname/auto"; - $arch_dir = "$dir/$archname"; - $version_dir = "$dir/$version"; - $version_arch_dir = "$dir/$version/$archname"; - } - return($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir); -} + $arch_auto_dir = "$dir/$archname/auto"; + $arch_dir = "$dir/$archname"; + $version_dir = "$dir/$version"; + $version_arch_dir = "$dir/$version/$archname"; -sub _nativize { - my($dir) = @_; - - if ($Is_MacOS && $Mac_FS && ! -d $dir) { - $dir = Mac::FileSpec::Unixish::nativize($dir); - $dir .= ":" unless $dir =~ /:$/; - } - - return $dir; + return($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir); } 1; diff --git a/ext/DynaLoader/DynaLoader_pm.PL b/ext/DynaLoader/DynaLoader_pm.PL index 27ccd7d..776ddf9 100644 --- a/ext/DynaLoader/DynaLoader_pm.PL +++ b/ext/DynaLoader/DynaLoader_pm.PL @@ -134,11 +134,6 @@ $Is_VMS = $^O eq 'VMS'; <</$^O-eq-VMS>> $do_expand = <<$^O-eq-VMS>>1<<|$^O-eq-VMS>>0<</$^O-eq-VMS>>; -<<$^O-eq-MacOS>> -my $Mac_FS; -$Mac_FS = eval { require Mac::FileSpec::Unixish }; -<</$^O-eq-MacOS>> - @dl_require_symbols = (); # names of symbols we need @dl_resolve_using = (); # names of files to link with @dl_library_path = (); # path to look for files @@ -312,30 +307,20 @@ sub bootstrap { } <</$^O-eq-NetWare>> - my $modpname = join(<<$^O-eq-MacOS>>':'<<|$^O-eq-MacOS>>'/'<</$^O-eq-MacOS>>,@modparts); + my $modpname = join('/',@modparts); print STDERR "DynaLoader::bootstrap for $module ", - <<$^O-eq-MacOS>> "(:auto:$modpname:$modfname.$dl_dlext)\n" - <<|$^O-eq-MacOS>>"(auto/$modpname/$modfname.$dl_dlext)\n"<</$^O-eq-MacOS>> + "(auto/$modpname/$modfname.$dl_dlext)\n" if $dl_debug; foreach (@INC) { <<$^O-eq-VMS>>chop($_ = VMS::Filespec::unixpath($_));<</$^O-eq-VMS>> - <<$^O-eq-MacOS>> - my $path = $_; - if ($Mac_FS && ! -d $path) { - $path = Mac::FileSpec::Unixish::nativize($path); - } - $path .= ":" unless /:$/; - my $dir = "${path}auto:$modpname"; - <<|$^O-eq-MacOS>> my $dir = "$_/auto/$modpname"; - <</$^O-eq-MacOS>> next unless -d $dir; # skip over uninteresting directories # check for common cases to avoid autoload of dl_findfile - my $try = <<$^O-eq-MacOS>> "$dir:$modfname.$dl_dlext" <<|$^O-eq-MacOS>> "$dir/$modfname.$dl_dlext"<</$^O-eq-MacOS>>; + my $try = "$dir/$modfname.$dl_dlext"; last if $file = ($do_expand) ? dl_expandspec($try) : ((-f $try) && $try); # no luck here, save dir for possible later dl_findfile search @@ -439,12 +424,6 @@ sub dl_findfile { next; } <</$^O-eq-VMS>> - <<$^O-eq-MacOS>> - if (m/:/ && -f $_) { - push(@found,$_); - last arg unless wantarray; - } - <</$^O-eq-MacOS>> <<$^O-ne-VMS>> if (m:/: && -f $_) { push(@found,$_); @@ -457,30 +436,6 @@ sub dl_findfile { # Using a -L prefix is the preferred option (faster and more robust) if (m:^-L:) { s/^-L//; push(@dirs, $_); next; } - <<$^O-eq-MacOS>> - # Otherwise we try to try to spot directories by a heuristic - # (this is a more complicated issue than it first appears) - if (m/:/ && -d $_) { push(@dirs, $_); next; } - # Only files should get this far... - my(@names, $name); # what filenames to look for - s/^-l//; - push(@names, $_); - foreach $dir (@dirs, @dl_library_path) { - next unless -d $dir; - $dir =~ s/^([^:]+)$/:$1/; - $dir =~ s/:$//; - foreach $name (@names) { - my($file) = "$dir:$name"; - print STDERR " checking in $dir for $name\n" if $dl_debug; - if (-f $file) { - push(@found, $file); - next arg; # no need to look any further - } - } - } - next; - <</$^O-eq-MacOS>> - # Otherwise we try to try to spot directories by a heuristic # (this is a more complicated issue than it first appears) if (m:/: && -d $_) { push(@dirs, $_); next; } diff --git a/ext/DynaLoader/dl_mac.xs b/ext/DynaLoader/dl_mac.xs deleted file mode 100644 index d06bb3b..0000000 --- a/ext/DynaLoader/dl_mac.xs +++ /dev/null @@ -1,162 +0,0 @@ -/* dl_mac.xs - * - * Platform: Macintosh CFM - * Author: Matthias Neeracher <[email protected]> - * Adapted from dl_dlopen.xs reference implementation by - * Paul Marquess ([email protected]) - * $Log: dl_mac.xs,v $ - * Revision 1.3 1998/04/07 01:47:24 neeri - * MacPerl 5.2.0r4b1 - * - * Revision 1.2 1997/08/08 16:39:18 neeri - * MacPerl 5.1.4b1 + time() fix - * - * Revision 1.1 1997/04/07 20:48:23 neeri - * Synchronized with MacPerl 5.1.4a1 - * - */ - -#define MAC_CONTEXT -#include "EXTERN.h" -#include "perl.h" -#include "XSUB.h" - -#include <CodeFragments.h> - -typedef CFragConnectionID ConnectionID; - -typedef struct { - ConnectionID ** x_connections; -} my_cxtx_t; /* this *must* be named my_cxtx_t */ - -#define DL_CXT_EXTRA /* ask for dl_cxtx to be defined in dlutils.c */ -#include "dlutils.c" /* SaveError() etc */ - -#define dl_connections (dl_cxtx.x_connections) - -static void terminate(pTHX_ void *ptr) -{ - dMY_CXT; - int size = GetHandleSize((Handle) dl_connections) / sizeof(ConnectionID); - HLock((Handle) dl_connections); - while (size) - CloseConnection(*dl_connections + --size); - DisposeHandle((Handle) dl_connections); - dl_connections = nil; -} - -static void -dl_private_init(pTHX) -{ - (void)dl_generic_private_init(aTHX); -} - -MODULE = DynaLoader PACKAGE = DynaLoader - -BOOT: - (void)dl_private_init(aTHX); - - -ConnectionID -dl_load_file(filename, flags=0) - char * filename - int flags - PREINIT: - OSErr err; - FSSpec spec; - ConnectionID connID; - Ptr mainAddr; - Str255 errName; - CODE: - DLDEBUG(1,PerlIO_printf(Perl_debug_log,"dl_load_file(%s):\n", filename)); - err = GUSIPath2FSp(filename, &spec); - if (!err) - err = - GetDiskFragment( - &spec, 0, 0, spec.name, kLoadCFrag, &connID, &mainAddr, errName); - if (!err) { - dMY_CXT; - if (!dl_connections) { - dl_connections = (ConnectionID **)NewHandle(0); - call_atexit(terminate, (void*)0); - } - PtrAndHand((Ptr) &connID, (Handle) dl_connections, sizeof(ConnectionID)); - RETVAL = connID; - } else - RETVAL = (ConnectionID) 0; - DLDEBUG(2,PerlIO_printf(Perl_debug_log," libref=%d\n", RETVAL)); - ST(0) = sv_newmortal() ; - if (err) - SaveError(aTHX_ "DynaLoader error [%d, %#s]", err, errName) ; - else - sv_setiv( ST(0), (IV)RETVAL); - -void * -dl_find_symbol(connID, symbol) - ConnectionID connID - Str255 symbol - CODE: - { - OSErr err; - Ptr symAddr; - CFragSymbolClass symClass; - DLDEBUG(2,PerlIO_printf(Perl_debug_log,"dl_find_symbol(handle=%x, symbol=%#s)\n", - connID, symbol)); - err = FindSymbol(connID, symbol, &symAddr, &symClass); - if (err) - symAddr = (Ptr) 0; - RETVAL = (void *) symAddr; - DLDEBUG(2,PerlIO_printf(Perl_debug_log," symbolref = %x\n", RETVAL)); - ST(0) = sv_newmortal() ; - if (err) - SaveError(aTHX_ "DynaLoader error [%d]!", err) ; - else - sv_setiv( ST(0), (IV)RETVAL); - } - -void -dl_undef_symbols() - PPCODE: - - - -# These functions should not need changing on any platform: - -void -dl_install_xsub(perl_name, symref, filename="$Package") - char * perl_name - void * symref - const char * filename - CODE: - DLDEBUG(2,PerlIO_printf(Perl_debug_log,"dl_install_xsub(name=%s, symref=%x)\n", - perl_name, symref)); - ST(0) = sv_2mortal(newRV((SV*)newXS_flags(perl_name, - (void(*)(pTHX_ CV *))symref, - filename, NULL, - XS_DYNAMIC_FILENAME))); - - -char * -dl_error() - CODE: - dMY_CXT; - RETVAL = dl_last_error ; - OUTPUT: - RETVAL - -#if defined(USE_ITHREADS) - -void -CLONE(...) - CODE: - MY_CXT_CLONE; - - /* MY_CXT_CLONE just does a memcpy on the whole structure, so to avoid - * using Perl variables that belong to another thread, we create our - * own for this thread. - */ - MY_CXT.x_dl_last_error = newSVpvn("", 0); - -#endif - -# end. diff --git a/ext/File-Glob/Glob.pm b/ext/File-Glob/Glob.pm index 7c6b92c..240e0a5 100644 --- a/ext/File-Glob/Glob.pm +++ b/ext/File-Glob/Glob.pm @@ -56,7 +56,7 @@ use XSLoader (); ) ], ); -$VERSION = '1.07'; +$VERSION = '1.08'; sub import { require Exporter; @@ -110,7 +110,7 @@ sub GLOB_CSH () { } $DEFAULT_FLAGS = GLOB_CSH(); -if ($^O =~ /^(?:MSWin32|VMS|os2|dos|riscos|MacOS)$/) { +if ($^O =~ /^(?:MSWin32|VMS|os2|dos|riscos)$/) { $DEFAULT_FLAGS |= GLOB_NOCASE(); } diff --git a/lib/DB.pm b/lib/DB.pm index efb9035..16ff99a 100644 --- a/lib/DB.pm +++ b/lib/DB.pm @@ -41,7 +41,7 @@ BEGIN { $DB::subname = ''; # currently executing sub (fullly qualified name) $DB::lineno = ''; # current line number - $DB::VERSION = $DB::VERSION = '1.02'; + $DB::VERSION = $DB::VERSION = '1.03'; # initialize private globals to avoid warnings @@ -93,15 +93,6 @@ sub DB { $usrctxt = "package $DB::package;"; # this won't let them modify, alas local(*DB::dbline) = "::_<$DB::filename"; - # we need to check for pseudofiles on Mac OS (these are files - # not attached to a filename, but instead stored in Dev:Pseudo) - # since this is done late, $DB::filename will be "wrong" after - # skippkg - if ($^O eq 'MacOS' && $#DB::dbline < 0) { - $DB::filename = 'Dev:Pseudo'; - *DB::dbline = "::_<$DB::filename"; - } - my ($stop, $action); if (($stop,$action) = split(/\0/,$DB::dbline{$DB::lineno})) { if ($stop eq '1') { diff --git a/lib/File/Basename.pm b/lib/File/Basename.pm index d842844..da9e07b 100644 --- a/lib/File/Basename.pm +++ b/lib/File/Basename.pm @@ -54,7 +54,7 @@ our(@ISA, @EXPORT, $VERSION, $Fileparse_fstype, $Fileparse_igncase); require Exporter; @ISA = qw(Exporter); @EXPORT = qw(fileparse fileparse_set_fstype basename dirname); -$VERSION = "2.78"; +$VERSION = "2.79"; fileparse_set_fstype($^O); @@ -131,10 +131,6 @@ sub fileparse { $dirpath = './' unless $dirpath; # Can't be 0 $dirpath .= '/' unless $dirpath =~ m#[\\/]\z#; } - elsif ($type eq "MacOS") { - ($dirpath,$basename) = ($fullname =~ /^(.*:)?(.*)/s); - $dirpath = ':' unless $dirpath; - } elsif ($type eq "AmigaOS") { ($dirpath,$basename) = ($fullname =~ /(.*[:\/])?(.*)/s); $dirpath = './' unless $dirpath; @@ -296,13 +292,6 @@ sub dirname { if ($type eq 'VMS') { $dirname ||= $ENV{DEFAULT}; } - elsif ($type eq 'MacOS') { - if( !length($basename) && $dirname !~ /^[^:]+:\z/) { - _strip_trailing_sep($dirname); - ($basename,$dirname) = fileparse $dirname; - } - $dirname .= ":" unless $dirname =~ /:\z/; - } elsif (grep { $type eq $_ } qw(MSDOS DOS MSWin32 OS2)) { _strip_trailing_sep($dirname); unless( length($basename) ) { @@ -331,10 +320,7 @@ sub dirname { sub _strip_trailing_sep { my $type = $Fileparse_fstype; - if ($type eq 'MacOS') { - $_[0] =~ s/([^:]):\z/$1/s; - } - elsif (grep { $type eq $_ } qw(MSDOS DOS MSWin32 OS2)) { + if (grep { $type eq $_ } qw(MSDOS DOS MSWin32 OS2)) { $_[0] =~ s/([^:])[\\\/]*\z/$1/; } else { @@ -353,7 +339,7 @@ Normally File::Basename will assume a file path type native to your current operating system (ie. /foo/bar style on Unix, \foo\bar on Windows, etc...). With this function you can override that assumption. -Valid $types are "MacOS", "VMS", "AmigaOS", "OS2", "RISCOS", +Valid $types are "VMS", "AmigaOS", "OS2", "RISCOS", "MSWin32", "DOS" (also "MSDOS" for backwards bug compatibility), "Epoc" and "Unix" (all case-insensitive). If an unrecognized $type is given "Unix" will be assumed. @@ -370,7 +356,7 @@ call only. BEGIN { -my @Ignore_Case = qw(MacOS VMS AmigaOS OS2 RISCOS MSWin32 MSDOS DOS Epoc); +my @Ignore_Case = qw(VMS AmigaOS OS2 RISCOS MSWin32 MSDOS DOS Epoc); my @Types = (@Ignore_Case, qw(Unix)); sub fileparse_set_fstype { diff --git a/lib/File/Basename.t b/lib/File/Basename.t index 0d3b633..627d2f4 100644 --- a/lib/File/Basename.t +++ b/lib/File/Basename.t @@ -5,7 +5,7 @@ BEGIN { @INC = '../lib'; } -use Test::More tests => 64; +use Test::More tests => 49; BEGIN { use_ok 'File::Basename' } @@ -76,34 +76,6 @@ can_ok( __PACKAGE__, qw( basename fileparse dirname fileparse_set_fstype ) ); is( dirname("\\foo\\bar\\baz"), "\\foo\\bar" ); } - -### Testing MacOS -{ - is(fileparse_set_fstype('MacOS'), 'MSDOS', 'set fstype to MacOS'); - - my($base,$path,$type) = fileparse('virgil:aeneid:draft.book7', - '\.book\d+'); - is($base, 'draft'); - is($path, 'virgil:aeneid:'); - is($type, '.book7'); - - is(basename(':arma:virumque:cano.trojae'), 'cano.trojae'); - is(dirname(':arma:virumque:cano.trojae'), ':arma:virumque:'); - is(dirname(':arma:virumque:'), ':arma:'); - is(dirname(':arma:virumque'), ':arma:'); - is(dirname(':arma:'), ':'); - is(dirname(':arma'), ':'); - is(dirname('arma:'), 'arma:'); - is(dirname('arma'), ':'); - is(dirname(':'), ':'); - - - # Check quoting of metacharacters in suffix arg by basename() - is(basename(':arma:virumque:cano.trojae','.trojae'), 'cano'); - is(basename(':arma:virumque:cano_trojae','.trojae'), 'cano_trojae'); -} - - ### extra tests for a few specific bugs { fileparse_set_fstype 'DOS'; diff --git a/lib/File/Copy.pm b/lib/File/Copy.pm index 8382565..e14b01b 100644 --- a/lib/File/Copy.pm +++ b/lib/File/Copy.pm @@ -41,13 +41,6 @@ sub carp { goto &Carp::carp; } -my $macfiles; -if ($^O eq 'MacOS') { - $macfiles = eval { require Mac::MoreFiles }; - warn 'Mac::MoreFiles could not be loaded; using non-native syscopy' - if $@ && $^W; -} - # Look up the feature settings on VMS using VMS::Feature when available. my $use_vms_feature = 0; @@ -93,11 +86,6 @@ sub _catname { import File::Basename 'basename'; } - if ($^O eq 'MacOS') { - # a partial dir name that's valid only in the cwd (e.g. 'tmp') - $to = ':' . $to if $to !~ /:/; - } - return File::Spec->catfile($to, basename($from)); } @@ -166,7 +154,6 @@ sub copy { && !($from_a_handle && $^O eq 'os2' ) # OS/2 cannot handle handles && !($from_a_handle && $^O eq 'mpeix') # and neither can MPE/iX. && !($from_a_handle && $^O eq 'MSWin32') - && !($from_a_handle && $^O eq 'MacOS') && !($from_a_handle && $^O eq 'NetWare') ) { @@ -436,22 +423,6 @@ unless (defined &syscopy) { return 0 unless @_ == 2; return Win32::CopyFile(@_, 1); }; - } elsif ($macfiles) { - *syscopy = sub { - my($from, $to) = @_; - my($dir, $toname); - - return 0 unless -e $from; - - if ($to =~ /(.*:)([^:]+):?$/) { - ($dir, $toname) = ($1, $2); - } else { - ($dir, $toname) = (":", $to); - } - - unlink($to); - Mac::MoreFiles::FSpFileCopy($from, $dir, $toname, 1); - }; } else { $Syscopy_is_copy = 1; *syscopy = \© diff --git a/lib/File/DosGlob.pm b/lib/File/DosGlob.pm index 496a14c..0963b39 100644 --- a/lib/File/DosGlob.pm +++ b/lib/File/DosGlob.pm @@ -9,7 +9,7 @@ package File::DosGlob; -our $VERSION = '1.01'; +our $VERSION = '1.02'; use strict; use warnings; @@ -261,40 +261,6 @@ sub _expand_volume { return @new_pat; } - -# -# _preprocess_pattern() will only be used on Mac OS (Classic): -# Resolves any updirs in the pattern. Removes a single trailing colon -# from the pattern, unless it's a volume name pattern like "*HD:" -# -sub _preprocess_pattern { - my @pat = @_; - - foreach my $p (@pat) { - my $proceed; - # resolve any updirs, e.g. "*HD:t?p::a*" -> "*HD:a*" - do { - $proceed = ($p =~ s/^(.*):[^:]+::(.*?)\z/$1:$2/); - } while ($proceed); - # remove a single trailing colon, e.g. ":*:" -> ":*" - $p =~ s/:([^:]+):\z/:$1/; - } - return @pat; -} - - -# -# _un_escape() will only be used on Mac OS (Classic): -# Unescapes a list of arguments which may contain escaped -# metachars '*', '?' and '\'. -# -sub _un_escape { - foreach (@_) { - s/\\([*?\\])/$1/g; - } - return @_; -} - # # this can be used to override CORE::glob in a specific # package by saying C<use File::DosGlob 'glob';> in that @@ -373,15 +339,7 @@ sub glob { # if we're just beginning, do it all first if ($iter{$cxix} == 0) { - if ($^O eq 'MacOS') { - # first, take care of updirs and trailing colons - @pat = _preprocess_pattern(@pat); - # expand volume names - @pat = _expand_volume(@pat); - $entries{$cxix} = (@pat) ? [_un_escape( doglob_Mac(1,@pat) )] : [()]; - } else { - $entries{$cxix} = [doglob(1,@pat)]; - } + $entries{$cxix} = [doglob(1,@pat)]; } # chuck it all out, quick or slow diff --git a/lib/File/Find.pm b/lib/File/Find.pm index c9c6f69..2967bd3 100644 --- a/lib/File/Find.pm +++ b/lib/File/Find.pm @@ -3,7 +3,7 @@ use 5.006; use strict; use warnings; use warnings::register; -our $VERSION = '1.16'; +our $VERSION = '1.17'; require Exporter; require Cwd; @@ -423,7 +423,6 @@ our @EXPORT = qw(find finddepth); use strict; my $Is_VMS; -my $Is_MacOS; require File::Basename; require File::Spec; @@ -505,32 +504,20 @@ sub PathCombine($$) { my ($Base,$Name) = @_; my $AbsName; - if ($Is_MacOS) { - # $Name is the resolved symlink (always a full path on MacOS), - # i.e. there's no need to call contract_name_Mac() - $AbsName = $Name; - - # (simple) check for recursion - if ( ( $Base =~ /^$AbsName/) && (-d $AbsName) ) { # recursion - return undef; - } + if (substr($Name,0,1) eq '/') { + $AbsName= $Name; } else { - if (substr($Name,0,1) eq '/') { - $AbsName= $Name; - } - else { - $AbsName= contract_name($Base,$Name); - } + $AbsName= contract_name($Base,$Name); + } - # (simple) check for recursion - my $newlen= length($AbsName); - if ($newlen <= length($Base)) { - if (($newlen == length($Base) || substr($Base,$newlen,1) eq '/') - && $AbsName eq substr($Base,0,$newlen)) - { - return undef; - } + # (simple) check for recursion + my $newlen= length($AbsName); + if ($newlen <= length($Base)) { + if (($newlen == length($Base) || substr($Base,$newlen,1) eq '/') + && $AbsName eq substr($Base,0,$newlen)) + { + return undef; } } return $AbsName; @@ -652,10 +639,7 @@ sub _find_opt { ($topdev,$topino,$topmode,$topnlink) = $follow ? stat $top_item : lstat $top_item; - if ($Is_MacOS) { - $top_item = ":$top_item" - if ( (-d _) && ( $top_item !~ /:/ ) ); - } elsif ($^O eq 'MSWin32') { + if ($^O eq 'MSWin32') { $top_item =~ s|/\z|| unless $top_item =~ m|\w:/$|; } else { @@ -666,32 +650,15 @@ sub _find_opt { if ($follow) { - if ($Is_MacOS) { - $cwd = "$cwd:" unless ($cwd =~ /:$/); # for safety - - if ($top_item eq $File::Find::current_dir) { - $abs_dir = $cwd; - } - else { - $abs_dir = contract_name_Mac($cwd, $top_item); - unless (defined $abs_dir) { - warnings::warnif "Can't determine absolute path for $top_item (No such file or directory)\n"; - next Proc_Top_Item; - } - } - + if (substr($top_item,0,1) eq '/') { + $abs_dir = $top_item; } - else { - if (substr($top_item,0,1) eq '/') { - $abs_dir = $top_item; - } - elsif ($top_item eq $File::Find::current_dir) { - $abs_dir = $cwd; - } - else { # care about any ../ - $top_item =~ s/\.dir\z//i if $Is_VMS; - $abs_dir = contract_name("$cwd/",$top_item); - } + elsif ($top_item eq $File::Find::current_dir) { + $abs_dir = $cwd; + } + else { # care about any ../ + $top_item =~ s/\.dir\z//i if $Is_VMS; + $abs_dir = contract_name("$cwd/",$top_item); } $abs_dir= Follow_SymLink($abs_dir); unless (defined $abs_dir) { @@ -729,12 +696,7 @@ sub _find_opt { unless ($Is_Dir) { unless (($_,$dir) = File::Basename::fileparse($abs_dir)) { - if ($Is_MacOS) { - ($dir,$_) = (':', $top_item); # $File::Find::dir, $_ - } - else { - ($dir,$_) = ('./', $top_item); - } + ($dir,$_) = ('./', $top_item); } $abs_dir = $dir; @@ -797,9 +759,7 @@ sub _find_dir($$$) { my $tainted = 0; my $no_nlink; - if ($Is_MacOS) { - $dir_pref= ($p_dir =~ /:$/) ? $p_dir : "$p_dir:"; # preface - } elsif ($^O eq 'MSWin32') { + if ($^O eq 'MSWin32') { $dir_pref = ($p_dir =~ m|\w:/?$| ? $p_dir : "$p_dir/" ); } elsif ($^O eq 'VMS') { @@ -840,10 +800,6 @@ sub _find_dir($$$) { # push the starting directory push @Stack,[$CdLvl,$p_dir,$dir_rel,-1] if $bydepth; - if ($Is_MacOS) { - $p_dir = $dir_pref; # ensure trailing ':' - } - while (defined $SE) { unless ($bydepth) { $dir= $p_dir; # $File::Find::dir @@ -862,34 +818,20 @@ sub _find_dir($$$) { ( $udir ) = $dir_rel =~ m|$untaint_pat|; unless (defined $udir) { if ($untaint_skip == 0) { - if ($Is_MacOS) { - die "directory ($p_dir) $dir_rel is still tainted"; - } - else { - die "directory (" . ($p_dir ne '/' ? $p_dir : '') . "/) $dir_rel is still tainted"; - } + die "directory (" . ($p_dir ne '/' ? $p_dir : '') . "/) $dir_rel is still tainted"; } else { # $untaint_skip == 1 next; } } } unless (chdir ($Is_VMS && $udir !~ /[\/\[<]+/ ? "./$udir" : $udir)) { - if ($Is_MacOS) { - warnings::warnif "Can't cd to ($p_dir) $udir: $!\n"; - } - else { - warnings::warnif "Can't cd to (" . - ($p_dir ne '/' ? $p_dir : '') . "/) $udir: $!\n"; - } + warnings::warnif "Can't cd to (" . + ($p_dir ne '/' ? $p_dir : '') . "/) $udir: $!\n"; next; } $CdLvl++; } - if ($Is_MacOS) { - $dir_name = "$dir_name:" unless ($dir_name =~ /:$/); - } - $dir= $dir_name; # $File::Find::dir # Get the list of files in the current directory. @@ -971,10 +913,7 @@ sub _find_dir($$$) { ($Level, $p_dir, $dir_rel, $nlink) = @$SE; if ($CdLvl > $Level && !$no_chdir) { my $tmp; - if ($Is_MacOS) { - $tmp = (':' x ($CdLvl-$Level)) . ':'; - } - elsif ($Is_VMS) { + if ($Is_VMS) { $tmp = '[' . ('-' x ($CdLvl-$Level)) . ']'; } else { @@ -985,13 +924,7 @@ sub _find_dir($$$) { $CdLvl = $Level; } - if ($Is_MacOS) { - # $pdir always has a trailing ':', except for the starting dir, - # where $dir_rel eq ':' - $dir_name = "$p_dir$dir_rel"; - $dir_pref = "$dir_name:"; - } - elsif ($^O eq 'MSWin32') { + if ($^O eq 'MSWin32') { $dir_name = ($p_dir =~ m|\w:/?$| ? "$p_dir$dir_rel" : "$p_dir/$dir_rel"); $dir_pref = "$dir_name/"; } @@ -1018,23 +951,13 @@ sub _find_dir($$$) { } elsif ( $nlink < 0 ) { # must be finddepth, report dirname now $name = $dir_name; - if ($Is_MacOS) { - if ($dir_rel eq ':') { # must be the top dir, where we started - $name =~ s|:$||; # $File::Find::name - $p_dir = "$p_dir:" unless ($p_dir =~ /:$/); - } - $dir = $p_dir; # $File::Find::dir - $_ = ($no_chdir ? $name : $dir_rel); # $_ + if ( substr($name,-2) eq '/.' ) { + substr($name, length($name) == 2 ? -1 : -2) = ''; } - else { - if ( substr($name,-2) eq '/.' ) { - substr($name, length($name) == 2 ? -1 : -2) = ''; - } - $dir = $p_dir; - $_ = ($no_chdir ? $dir_name : $dir_rel ); - if ( substr($_,-2) eq '/.' ) { - substr($_, length($_) == 2 ? -1 : -2) = ''; - } + $dir = $p_dir; + $_ = ($no_chdir ? $dir_name : $dir_rel ); + if ( substr($_,-2) eq '/.' ) { + substr($_, length($_) == 2 ? -1 : -2) = ''; } { $wanted_callback->() }; # protect against wild "next" } @@ -1069,13 +992,8 @@ sub _find_dir_symlnk($$$) { my $tainted = 0; my $ok = 1; - if ($Is_MacOS) { - $dir_pref = ($p_dir =~ /:$/) ? "$p_dir" : "$p_dir:"; - $loc_pref = ($dir_loc =~ /:$/) ? "$dir_loc" : "$dir_loc:"; - } else { - $dir_pref = ( $p_dir eq '/' ? '/' : "$p_dir/" ); - $loc_pref = ( $dir_loc eq '/' ? '/' : "$dir_loc/" ); - } + $dir_pref = ( $p_dir eq '/' ? '/' : "$p_dir/" ); + $loc_pref = ( $dir_loc eq '/' ? '/' : "$dir_loc/" ); local ($dir, $name, $fullname, $prune, *DIR); @@ -1104,10 +1022,6 @@ sub _find_dir_symlnk($$$) { push @Stack,[$dir_loc,$updir_loc,$p_dir,$dir_rel,-1] if $bydepth; - if ($Is_MacOS) { - $p_dir = $dir_pref; # ensure trailing ':' - } - while (defined $SE) { unless ($bydepth) { @@ -1150,10 +1064,6 @@ sub _find_dir_symlnk($$$) { } } - if ($Is_MacOS) { - $dir_name = "$dir_name:" unless ($dir_name =~ /:$/); - } - $dir = $dir_name; # $File::Find::dir # Get the list of files in the current directory. @@ -1216,18 +1126,9 @@ sub _find_dir_symlnk($$$) { continue { while (defined($SE = pop @Stack)) { ($dir_loc, $updir_loc, $p_dir, $dir_rel, $byd_flag) = @$SE; - if ($Is_MacOS) { - # $p_dir always has a trailing ':', except for the starting dir, - # where $dir_rel eq ':' - $dir_name = "$p_dir$dir_rel"; - $dir_pref = "$dir_name:"; - $loc_pref = ($dir_loc =~ /:$/) ? $dir_loc : "$dir_loc:"; - } - else { - $dir_name = ($p_dir eq '/' ? "/$dir_rel" : "$p_dir/$dir_rel"); - $dir_pref = "$dir_name/"; - $loc_pref = "$dir_loc/"; - } + $dir_name = ($p_dir eq '/' ? "/$dir_rel" : "$p_dir/$dir_rel"); + $dir_pref = "$dir_name/"; + $loc_pref = "$dir_loc/"; if ( $byd_flag < 0 ) { # must be finddepth, report dirname now unless ($no_chdir || ($dir_rel eq $File::Find::current_dir)) { unless (chdir $updir_loc) { # $updir_loc (parent dir) is always untainted @@ -1237,23 +1138,13 @@ sub _find_dir_symlnk($$$) { } $fullname = $dir_loc; # $File::Find::fullname $name = $dir_name; # $File::Find::name - if ($Is_MacOS) { - if ($dir_rel eq ':') { # must be the top dir, where we started - $name =~ s|:$||; # $File::Find::name - $p_dir = "$p_dir:" unless ($p_dir =~ /:$/); - } - $dir = $p_dir; # $File::Find::dir - $_ = ($no_chdir ? $name : $dir_rel); # $_ + if ( substr($name,-2) eq '/.' ) { + substr($name, length($name) == 2 ? -1 : -2) = ''; # $File::Find::name } - else { - if ( substr($name,-2) eq '/.' ) { - substr($name, length($name) == 2 ? -1 : -2) = ''; # $File::Find::name - } - $dir = $p_dir; # $File::Find::dir - $_ = ($no_chdir ? $dir_name : $dir_rel); # $_ - if ( substr($_,-2) eq '/.' ) { - substr($_, length($_) == 2 ? -1 : -2) = ''; - } + $dir = $p_dir; # $File::Find::dir + $_ = ($no_chdir ? $dir_name : $dir_rel); # $_ + if ( substr($_,-2) eq '/.' ) { + substr($_, length($_) == 2 ? -1 : -2) = ''; } lstat($_); # make sure file tests with '_' work @@ -1312,12 +1203,6 @@ if ($^O eq 'VMS') { $Is_VMS = 1; $File::Find::dont_use_nlink = 1; } -elsif ($^O eq 'MacOS') { - $Is_MacOS = 1; - $File::Find::dont_use_nlink = 1; - $File::Find::skip_pattern = qr/^Icon\015\z/; - $File::Find::untaint_pattern = qr|^(.+)$|; -} # this _should_ work properly on all platforms # where File::Find can be expected to work diff --git a/lib/File/stat.pm b/lib/File/stat.pm index bdf3aad..3c16658 100644 --- a/lib/File/stat.pm +++ b/lib/File/stat.pm @@ -45,9 +45,6 @@ BEGIN { # from doio.c sub _ingroup { - - $^O eq "MacOS" and return 1; - my ($gid, $eff) = @_; # I am assuming that since VMS doesn't have getgroups(2), $) will diff --git a/lib/Term/ReadLine.pm b/lib/Term/ReadLine.pm index 7ecb479..0121cdf 100644 --- a/lib/Term/ReadLine.pm +++ b/lib/Term/ReadLine.pm @@ -180,7 +180,6 @@ sub readline { and defined &Tk::DoOneEvent; #$str = scalar <$in>; $str = $self->get_line; - $str =~ s/^\s*\Q$prompt\E// if ($^O eq 'MacOS'); utf8::upgrade($str) if (${^UNICODE} & PERL_UNICODE_STDIN || defined ${^ENCODING}) && utf8::valid($str); @@ -195,9 +194,7 @@ sub findConsole { my $console; my $consoleOUT; - if ($^O eq 'MacOS') { - $console = "Dev:Console"; - } elsif (-e "/dev/tty") { + if (-e "/dev/tty") { $console = "/dev/tty"; } elsif (-e "con" or $^O eq 'MSWin32') { $console = 'CONIN$'; @@ -291,7 +288,7 @@ sub get_line { package Term::ReadLine; # So late to allow the above code be defined? -our $VERSION = '1.06'; +our $VERSION = '1.07'; my ($which) = exists $ENV{PERL_RL} ? split /\s+/, $ENV{PERL_RL} : undef; if ($which) { diff --git a/lib/blib.pm b/lib/blib.pm index f755e29..854ec0b 100644 --- a/lib/blib.pm +++ b/lib/blib.pm @@ -40,7 +40,7 @@ use Cwd; use File::Spec; use vars qw($VERSION $Verbose); -$VERSION = '1.04'; +$VERSION = '1.05'; $Verbose = 0; sub import @@ -73,15 +73,7 @@ sub import { $blib = File::Spec->catdir($dir, "blib"); $blib_lib = File::Spec->catdir($blib, "lib"); - - if ($^O eq 'MacOS') - { - $blib_arch = File::Spec->catdir($blib_lib, $MacPerl::Architecture); - } - else - { - $blib_arch = File::Spec->catdir($blib, "arch"); - } + $blib_arch = File::Spec->catdir($blib, "arch"); if (-d $blib && -d $blib_arch && -d $blib_lib) { diff --git a/lib/diagnostics.pm b/lib/diagnostics.pm index 721b466..f694e3f 100644 --- a/lib/diagnostics.pm +++ b/lib/diagnostics.pm @@ -185,7 +185,7 @@ use 5.009001; use Carp; $Carp::Internal{__PACKAGE__.""}++; -our $VERSION = '1.19'; +our $VERSION = '1.20'; our $DEBUG; our $VERBOSE; our $PRETTY; @@ -211,12 +211,6 @@ my @trypod = ( unshift @trypod, "./pod/perldiag.pod" if -e "pod/perldiag.pod"; (my $PODFILE) = ((grep { -e } @trypod), $trypod[$#trypod])[0]; -if ($^O eq 'MacOS') { - # just updir one from each lib dir, we'll find it ... - ($PODFILE) = grep { -e } map { "$_:pod:perldiag.pod" } @INC; -} - - $DEBUG ||= 0; my $WHOAMI = ref bless []; # nobody's business, prolly not even mine diff --git a/lib/perl5db.pl b/lib/perl5db.pl index b3daaf5..6337974 100644 --- a/lib/perl5db.pl +++ b/lib/perl5db.pl @@ -1630,23 +1630,6 @@ We then determine what the console should be on various systems: $console = "con"; } -=item * MacOS - use C<Dev:Console:Perl Debug> if this is the MPW version; C<Dev: -Console> if not. - -Note that Mac OS X returns C<darwin>, not C<MacOS>. Also note that the debugger doesn't do anything special for C<darwin>. Maybe it should. - -=cut - - elsif ( $^O eq 'MacOS' ) { - if ( $MacPerl::Version !~ /MPW/ ) { - $console = - "Dev:Console:Perl Debug"; # Separate window for application - } - else { - $console = "Dev:Console"; - } - } ## end elsif ($^O eq 'MacOS') - =item * VMS - use C<sys$command>. =cut @@ -1923,13 +1906,6 @@ sub DB { # the code here. local (*dbline) = $main::{ '_<' . $filename }; - # we need to check for pseudofiles on Mac OS (these are files - # not attached to a filename, but instead stored in Dev:Pseudo) - if ( $^O eq 'MacOS' && $#dbline < 0 ) { - $filename_ini = $filename = 'Dev:Pseudo'; - *dbline = $main::{ '_<' . $filename }; - } - # Last line in the program. local $max = $#dbline; @@ -8040,7 +8016,7 @@ Just checks the contents of C<$^O> and sets the C<$doccmd> global accordingly. =cut sub setman { - $doccmd = $^O !~ /^(?:MSWin32|VMS|os2|dos|amigaos|riscos|MacOS|NetWare)\z/s + $doccmd = $^O !~ /^(?:MSWin32|VMS|os2|dos|amigaos|riscos|NetWare)\z/s ? "man" # O Happy Day! : "perldoc"; # Alas, poor unfortunates } ## end sub setman -- Perl5 Master Repository
