From: Jarkko Hietaniemi Date: Tue, 20 Mar 2001 14:26:25 +0000 (+0000) Subject: Integrate changes #9259,9260 from maintperl into mainline. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ffb9ee5f5f9d80d28ce950a2ff357650c8f1cc03;p=p5sagit%2Fp5-mst-13.2.git Integrate changes #9259,9260 from maintperl into mainline. Subject: [MacPerl-Porters] [PATCH] POSIX, File::Path (Mac OS) for 5.6.1 and 5.7 Subject: [PATCH perl-5.6.1-TRIAL3/run.c] printf warning p4raw-link: @9260 on //depot/maint-5.6/perl: b83ee361c1b8f0045f0125bffa546780643848c4 p4raw-link: @9259 on //depot/maint-5.6/perl: 5a271d91b72f558a378756b049d1040c9ff0a63c p4raw-id: //depot/perl@9261 p4raw-integrated: from //depot/maint-5.6/perl@9258 'copy in' lib/File/Path.pm (@8175..) 'merge in' ext/POSIX/POSIX.xs (@8885..) run.c (@8987..) --- diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index 83498ed..b5fd3a9 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -155,8 +155,6 @@ # endif /* !HAS_MKFIFO */ # ifdef MACOS_TRADITIONAL - struct tms { time_t tms_utime, tms_stime, tms_cutime, tms_cstime; }; -# define times(a) not_here("times") # define ttyname(a) (char*)not_here("ttyname") # define tzset() not_here("tzset") # else diff --git a/lib/File/Path.pm b/lib/File/Path.pm index 3859f24..0eb6128 100644 --- a/lib/File/Path.pm +++ b/lib/File/Path.pm @@ -97,11 +97,12 @@ use File::Basename (); use Exporter (); use strict; -our $VERSION = "1.0403"; +our $VERSION = "1.0404"; our @ISA = qw( Exporter ); our @EXPORT = qw( mkpath rmtree ); my $Is_VMS = $^O eq 'VMS'; +my $Is_MacOS = $^O eq 'MacOS'; # These OSes complain if you want to remove a file that you have no # write permission to: @@ -113,7 +114,7 @@ sub mkpath { # $paths -- either a path string or ref to list of paths # $verbose -- optional print "mkdir $path" for each directory created # $mode -- optional permissions, defaults to 0777 - local($")="/"; + local($")=$Is_MacOS ? ":" : "/"; $mode = 0777 unless defined($mode); $paths = [$paths] unless ref $paths; my(@created,$path); @@ -160,7 +161,12 @@ sub rmtree { my($root); foreach $root (@{$roots}) { - $root =~ s#/\z##; + if ($Is_MacOS) { + $root = ":$root" if $root !~ /:/; + $root =~ s#([^:])\z#$1:#; + } else { + $root =~ s#/\z##; + } (undef, undef, my $rp) = lstat $root or next; $rp &= 07777; # don't forget setuid, setgid, sticky bits if ( -d _ ) { @@ -185,7 +191,11 @@ sub rmtree { # is faster if done in reverse ASCIIbetical order @files = reverse @files if $Is_VMS; ($root = VMS::Filespec::unixify($root)) =~ s#\.dir\z## if $Is_VMS; - @files = map("$root/$_", grep $_!~/^\.{1,2}\z/s,@files); + if ($Is_MacOS) { + @files = map("$root$_", @files); + } else { + @files = map("$root/$_", grep $_!~/^\.{1,2}\z/s,@files); + } $count += rmtree(\@files,$verbose,$safe); if ($safe && ($Is_VMS ? !&VMS::Filespec::candelete($root) : !-w $root)) { diff --git a/run.c b/run.c index a4d3ea0..1b1e72b 100644 --- a/run.c +++ b/run.c @@ -90,7 +90,7 @@ Perl_debop(pTHX_ OP *o) if (svp) PerlIO_printf(Perl_debug_log, "(%s)", SvPV(*svp,n_a)); else - PerlIO_printf(Perl_debug_log, "[%"UVuf"]", o->op_targ); + PerlIO_printf(Perl_debug_log, "[%"UVuf"]", (UV)o->op_targ); break; default: break;