Change 34514 by [EMAIL PROTECTED] on 2008/10/19 10:23:11
Upgrade PathTools to 3.28_01
Affected files ...
... //depot/perl/ext/Cwd/t/win32.t#3 edit
... //depot/perl/lib/Cwd.pm#114 edit
... //depot/perl/lib/File/Spec.pm#61 edit
... //depot/perl/lib/File/Spec/Cygwin.pm#23 edit
... //depot/perl/lib/File/Spec/Epoc.pm#14 edit
... //depot/perl/lib/File/Spec/Functions.pm#17 edit
... //depot/perl/lib/File/Spec/Mac.pm#32 edit
... //depot/perl/lib/File/Spec/OS2.pm#28 edit
... //depot/perl/lib/File/Spec/Unix.pm#63 edit
... //depot/perl/lib/File/Spec/VMS.pm#52 edit
... //depot/perl/lib/File/Spec/Win32.pm#49 edit
... //depot/perl/lib/File/Spec/t/Spec.t#29 edit
Differences ...
==== //depot/perl/ext/Cwd/t/win32.t#3 (text) ====
Index: perl/ext/Cwd/t/win32.t
--- perl/ext/Cwd/t/win32.t#2~23977~ 2005-02-17 10:14:19.000000000 -0800
+++ perl/ext/Cwd/t/win32.t 2008-10-19 03:23:11.000000000 -0700
@@ -11,7 +11,7 @@
use Test::More;
if( $^O eq 'MSWin32' ) {
- plan tests => 3;
+ plan tests => 4;
} else {
plan skip_all => 'this is not win32';
}
@@ -29,3 +29,10 @@
# May not have a D: drive mounted
ok 1;
}
+
+# Ensure compatibility with naughty versions of Template::Toolkit,
+# which pass in a bare $1 as an argument
+'Foo/strawberry' =~ /(.*)/;
+my $result = File::Spec::Win32->catfile('C:/cache', $1);
+is( $result, 'C:\cache\Foo\strawberry' );
+
==== //depot/perl/lib/Cwd.pm#114 (text) ====
Index: perl/lib/Cwd.pm
--- perl/lib/Cwd.pm#113~33294~ 2008-02-12 07:11:48.000000000 -0800
+++ perl/lib/Cwd.pm 2008-10-19 03:23:11.000000000 -0700
@@ -171,7 +171,8 @@
use Exporter;
use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION);
-$VERSION = '3.2701';
+$VERSION = '3.28_01';
+$VERSION = eval $VERSION;
@ISA = qw/ Exporter /;
@EXPORT = qw(cwd getcwd fastcwd fastgetcwd);
==== //depot/perl/lib/File/Spec.pm#61 (text) ====
Index: perl/lib/File/Spec.pm
--- perl/lib/File/Spec.pm#60~33294~ 2008-02-12 07:11:48.000000000 -0800
+++ perl/lib/File/Spec.pm 2008-10-19 03:23:11.000000000 -0700
@@ -3,7 +3,7 @@
use strict;
use vars qw(@ISA $VERSION);
-$VERSION = '3.2701';
+$VERSION = '3.28_01';
$VERSION = eval $VERSION;
my %module = (MacOS => 'Mac',
==== //depot/perl/lib/File/Spec/Cygwin.pm#23 (text) ====
Index: perl/lib/File/Spec/Cygwin.pm
--- perl/lib/File/Spec/Cygwin.pm#22~33294~ 2008-02-12 07:11:48.000000000
-0800
+++ perl/lib/File/Spec/Cygwin.pm 2008-10-19 03:23:11.000000000 -0700
@@ -4,7 +4,8 @@
use vars qw(@ISA $VERSION);
require File::Spec::Unix;
-$VERSION = '3.2701';
+$VERSION = '3.28_01';
+$VERSION = eval $VERSION;
@ISA = qw(File::Spec::Unix);
@@ -111,7 +112,7 @@
=cut
-sub case_tolerant () {
+sub case_tolerant {
return 1 unless $^O eq 'cygwin'
and defined &Cygwin::mount_flags;
==== //depot/perl/lib/File/Spec/Epoc.pm#14 (text) ====
Index: perl/lib/File/Spec/Epoc.pm
--- perl/lib/File/Spec/Epoc.pm#13~33294~ 2008-02-12 07:11:48.000000000
-0800
+++ perl/lib/File/Spec/Epoc.pm 2008-10-19 03:23:11.000000000 -0700
@@ -3,7 +3,8 @@
use strict;
use vars qw($VERSION @ISA);
-$VERSION = '3.2701';
+$VERSION = '3.28_01';
+$VERSION = eval $VERSION;
require File::Spec::Unix;
@ISA = qw(File::Spec::Unix);
==== //depot/perl/lib/File/Spec/Functions.pm#17 (text) ====
Index: perl/lib/File/Spec/Functions.pm
--- perl/lib/File/Spec/Functions.pm#16~33294~ 2008-02-12 07:11:48.000000000
-0800
+++ perl/lib/File/Spec/Functions.pm 2008-10-19 03:23:11.000000000 -0700
@@ -5,7 +5,8 @@
use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $VERSION);
-$VERSION = '3.2701';
+$VERSION = '3.28_01';
+$VERSION = eval $VERSION;
require Exporter;
==== //depot/perl/lib/File/Spec/Mac.pm#32 (text) ====
Index: perl/lib/File/Spec/Mac.pm
--- perl/lib/File/Spec/Mac.pm#31~33294~ 2008-02-12 07:11:48.000000000 -0800
+++ perl/lib/File/Spec/Mac.pm 2008-10-19 03:23:11.000000000 -0700
@@ -4,7 +4,8 @@
use vars qw(@ISA $VERSION);
require File::Spec::Unix;
-$VERSION = '3.2701';
+$VERSION = '3.28_01';
+$VERSION = eval $VERSION;
@ISA = qw(File::Spec::Unix);
==== //depot/perl/lib/File/Spec/OS2.pm#28 (text) ====
Index: perl/lib/File/Spec/OS2.pm
--- perl/lib/File/Spec/OS2.pm#27~33294~ 2008-02-12 07:11:48.000000000 -0800
+++ perl/lib/File/Spec/OS2.pm 2008-10-19 03:23:11.000000000 -0700
@@ -4,7 +4,8 @@
use vars qw(@ISA $VERSION);
require File::Spec::Unix;
-$VERSION = '3.2701';
+$VERSION = '3.28_01';
+$VERSION = eval $VERSION;
@ISA = qw(File::Spec::Unix);
==== //depot/perl/lib/File/Spec/Unix.pm#63 (text) ====
Index: perl/lib/File/Spec/Unix.pm
--- perl/lib/File/Spec/Unix.pm#62~33294~ 2008-02-12 07:11:48.000000000
-0800
+++ perl/lib/File/Spec/Unix.pm 2008-10-19 03:23:11.000000000 -0700
@@ -3,7 +3,8 @@
use strict;
use vars qw($VERSION);
-$VERSION = '3.2701';
+$VERSION = '3.28_01';
+$VERSION = eval $VERSION;
=head1 NAME
@@ -104,7 +105,7 @@
=cut
-sub curdir () { '.' }
+sub curdir { '.' }
=item devnull
@@ -112,7 +113,7 @@
=cut
-sub devnull () { '/dev/null' }
+sub devnull { '/dev/null' }
=item rootdir
@@ -120,7 +121,7 @@
=cut
-sub rootdir () { '/' }
+sub rootdir { '/' }
=item tmpdir
@@ -169,7 +170,7 @@
=cut
-sub updir () { '..' }
+sub updir { '..' }
=item no_upwards
@@ -190,7 +191,7 @@
=cut
-sub case_tolerant () { 0 }
+sub case_tolerant { 0 }
=item file_name_is_absolute
==== //depot/perl/lib/File/Spec/VMS.pm#52 (text) ====
Index: perl/lib/File/Spec/VMS.pm
--- perl/lib/File/Spec/VMS.pm#51~33294~ 2008-02-12 07:11:48.000000000 -0800
+++ perl/lib/File/Spec/VMS.pm 2008-10-19 03:23:11.000000000 -0700
@@ -4,7 +4,8 @@
use vars qw(@ISA $VERSION);
require File::Spec::Unix;
-$VERSION = '3.2701';
+$VERSION = '3.28_01';
+$VERSION = eval $VERSION;
@ISA = qw(File::Spec::Unix);
@@ -242,16 +243,34 @@
=item splitpath (override)
-Splits using VMS syntax.
+ ($volume,$directories,$file) = File::Spec->splitpath( $path );
+ ($volume,$directories,$file) = File::Spec->splitpath( $path, $no_file );
+
+Passing a true value for C<$no_file> indicates that the path being
+split only contains directory components, even on systems where you
+can usually (when not supporting a foreign syntax) tell the difference
+between directories and files at a glance.
=cut
sub splitpath {
- my($self,$path) = @_;
- my($dev,$dir,$file) = ('','','');
-
- vmsify($path) =~ /(.+:)?([\[<].*[\]>])?(.*)/s;
- return ($1 || '',$2 || '',$3);
+ my($self,$path, $nofile) = @_;
+ my($dev,$dir,$file) = ('','','');
+ my $vmsify_path = vmsify($path);
+ if ( $nofile ){
+ #vmsify('d1/d2/d3') returns '[.d1.d2]d3'
+ #vmsify('/d1/d2/d3') returns 'd1:[d2]d3'
+ if( $vmsify_path =~ /(.*)\](.+)/ ){
+ $vmsify_path = $1.'.'.$2.']';
+ }
+ $vmsify_path =~ /(.+:)?(.*)/s;
+ $dir = defined $2 ? $2 : ''; # dir can be '0'
+ return ($1 || '',$dir,$file);
+ }
+ else {
+ $vmsify_path =~ /(.+:)?([\[<].*[\]>])?(.*)/s;
+ return ($1 || '',$2 || '',$3);
+ }
}
=item splitdir (override)
@@ -470,7 +489,7 @@
sub fixpath {
my($self,$path,$force_path) = @_;
return '' unless $path;
- $self = bless {} unless ref $self;
+ $self = bless {}, $self unless ref $self;
my($fixedpath,$prefix,$name);
if ($path =~ /\s/) {
==== //depot/perl/lib/File/Spec/Win32.pm#49 (text) ====
Index: perl/lib/File/Spec/Win32.pm
--- perl/lib/File/Spec/Win32.pm#48~33294~ 2008-02-12 07:11:48.000000000
-0800
+++ perl/lib/File/Spec/Win32.pm 2008-10-19 03:23:11.000000000 -0700
@@ -5,7 +5,8 @@
use vars qw(@ISA $VERSION);
require File::Spec::Unix;
-$VERSION = '3.2701';
+$VERSION = '3.28_01';
+$VERSION = eval $VERSION;
@ISA = qw(File::Spec::Unix);
@@ -41,7 +42,7 @@
return "nul";
}
-sub rootdir () { '\\' }
+sub rootdir { '\\' }
=item tmpdir
@@ -87,7 +88,7 @@
=cut
-sub case_tolerant () {
+sub case_tolerant {
eval { require Win32API::File; } or return 1;
my $drive = shift || "C:";
my $osFsType = "\0"x256;
@@ -375,9 +376,10 @@
=cut
-sub _canon_cat(@) # @path -> path
+sub _canon_cat # @path -> path
{
- my $first = shift;
+ my ($first, @rest) = @_;
+
my $volume = $first =~ s{ \A ([A-Za-z]:) ([\\/]?) }{}x # drive letter
? ucfirst( $1 ).( $2 ? "\\" : "" )
: $first =~ s{ \A (?:\\\\|//) ([^\\/]+)
@@ -387,7 +389,7 @@
: $first =~ s{ \A [\\/] }{}x # root dir
? "\\"
: "";
- my $path = join "\\", $first, @_;
+ my $path = join "\\", $first, @rest;
$path =~ tr#\\/#\\\\#s; # xx/yy --> xx\yy & xx\\yy --> xx\yy
==== //depot/perl/lib/File/Spec/t/Spec.t#29 (text) ====
Index: perl/lib/File/Spec/t/Spec.t
--- perl/lib/File/Spec/t/Spec.t#28~33294~ 2008-02-12 07:11:48.000000000
-0800
+++ perl/lib/File/Spec/t/Spec.t 2008-10-19 03:23:11.000000000 -0700
@@ -312,6 +312,44 @@
[ "VMS->splitpath('node\"access_spec\"::volume:[d1.d2.d3]')",
'node"access_spec"::volume:,[d1.d2.d3],' ],
[ "VMS->splitpath('node\"access_spec\"::volume:[d1.d2.d3]file')",
'node"access_spec"::volume:,[d1.d2.d3],file' ],
+[ "VMS->splitpath('[]')", ',[],'
],
+[ "VMS->splitpath('[-]')", ',[-],'
],
+[ "VMS->splitpath('[]file')", ',[],file'
],
+[ "VMS->splitpath('[-]file')", ',[-],file'
],
+[ "VMS->splitpath('')", ',,'
],
+[ "VMS->splitpath('0')", ',,0'
],
+[ "VMS->splitpath('[0]')", ',[0],'
],
+[ "VMS->splitpath('[.0]')", ',[.0],'
],
+[ "VMS->splitpath('[0.0.0]')", ',[0.0.0],'
],
+[ "VMS->splitpath('[.0.0.0]')", ',[.0.0.0],'
],
+[ "VMS->splitpath('[0]0')", ',[0],0'
],
+[ "VMS->splitpath('[0.0.0]0')", ',[0.0.0],0'
],
+[ "VMS->splitpath('[.0.0.0]0')",
',[.0.0.0],0' ],
+[ "VMS->splitpath('0/0')", ',[.0],0'
],
+[ "VMS->splitpath('0/0/0')", ',[.0.0],0'
],
+[ "VMS->splitpath('/0/0')",
'0:,[000000],0' ],
+[ "VMS->splitpath('/0/0/0')", '0:,[0],0'
],
+[ "VMS->splitpath('d1',1)", ',d1,'
],
+# $no_file tests
+[ "VMS->splitpath('[d1.d2.d3]',1)",
',[d1.d2.d3],' ],
+[ "VMS->splitpath('[.d1.d2.d3]',1)",
',[.d1.d2.d3],' ],
+[ "VMS->splitpath('d1/d2/d3',1)",
',[.d1.d2.d3],' ],
+[ "VMS->splitpath('/d1/d2/d3',1)",
'd1:,[d2.d3],' ],
+[ "VMS->splitpath('node::volume:[d1.d2.d3]',1)",
'node::volume:,[d1.d2.d3],' ],
+[ "VMS->splitpath('node\"access_spec\"::volume:[d1.d2.d3]',1)",
'node"access_spec"::volume:,[d1.d2.d3],' ],
+[ "VMS->splitpath('[]',1)", ',[],'
],
+[ "VMS->splitpath('[-]',1)", ',[-],'
],
+[ "VMS->splitpath('',1)", ',,'
],
+[ "VMS->splitpath('0',1)", ',0,'
],
+[ "VMS->splitpath('[0]',1)", ',[0],'
],
+[ "VMS->splitpath('[.0]',1)", ',[.0],'
],
+[ "VMS->splitpath('[0.0.0]',1)", ',[0.0.0],'
],
+[ "VMS->splitpath('[.0.0.0]',1)", ',[.0.0.0],'
],
+[ "VMS->splitpath('0/0',1)", ',[.0.0],'
],
+[ "VMS->splitpath('0/0/0',1)", ',[.0.0.0],'
],
+[ "VMS->splitpath('/0/0',1)",
'0:,[000000.0],' ],
+[ "VMS->splitpath('/0/0/0',1)", '0:,[0.0],'
],
+
[ "VMS->catpath('','','file')", 'file'
],
[ "VMS->catpath('','[d1.d2.d3]','')",
'[d1.d2.d3]' ],
[ "VMS->catpath('','[.d1.d2.d3]','')",
'[.d1.d2.d3]' ],
End of Patch.