From: Rafael Garcia-Suarez Date: Wed, 12 Jul 2006 08:49:17 +0000 (+0000) Subject: Upgrade to PathTools 3.19 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c47834cd2409d3680cf65095db9f9ea634e47197;p=p5sagit%2Fp5-mst-13.2.git Upgrade to PathTools 3.19 p4raw-id: //depot/perl@28551 --- diff --git a/ext/Cwd/Changes b/ext/Cwd/Changes index 8efefe1..2199b59 100644 --- a/ext/Cwd/Changes +++ b/ext/Cwd/Changes @@ -1,5 +1,23 @@ Revision history for Perl distribution PathTools. +3.19 Tue Jul 11 22:40:26 CDT 2006 + + - When abs2rel() is called with two relative paths + (e.g. abs2rel('foo/bar/baz', 'foo/bar')) the resolution algorithm + needlessly called cwd() (twice!) to turn both arguments into + absolute paths. Now it avoids the cwd() calls with a workaround, + making a big efficiency win when abs2rel() is called + repeatedly. [Brendan O'Dea] + + - Added a build-time dependency on ExtUtils::Install version 1.39 + when on Windows. This is necessary because version 1.39 knows how + to replace an in-use Cwd shared library, but previous versions + don't. [Suggested by Adam Kennedy] + + - Fixed File::Spec::Win32->canonpath('foo/../bar'), which was + returning \bar, and now properly returns just bar. [Spotted by + Heinrich Tegethoff] + 3.18 Thu Apr 27 22:01:38 CDT 2006 - Fixed some problems on VMS in which a directory called "0" would be diff --git a/lib/Cwd.pm b/lib/Cwd.pm index 755c7a7..1a85d67 100644 --- a/lib/Cwd.pm +++ b/lib/Cwd.pm @@ -171,7 +171,7 @@ use strict; use Exporter; use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION); -$VERSION = '3.18'; +$VERSION = '3.19'; @ISA = qw/ Exporter /; @EXPORT = qw(cwd getcwd fastcwd fastgetcwd); @@ -370,10 +370,8 @@ if ($^O eq 'cygwin') { # isn't redefined later (20001212 rspier) *fastgetcwd = \&cwd; -# By Brandon S. Allbery -# -# Usage: $cwd = getcwd(); - +# A non-XS version of getcwd() - also used to bootstrap the perl build +# process, when miniperl is running and no XS loading happens. sub _perl_getcwd { abs_path('.'); diff --git a/lib/File/Spec.pm b/lib/File/Spec.pm index 7a3dd26..60553b5 100644 --- a/lib/File/Spec.pm +++ b/lib/File/Spec.pm @@ -3,7 +3,7 @@ package File::Spec; use strict; use vars qw(@ISA $VERSION); -$VERSION = '3.18'; +$VERSION = '3.19'; $VERSION = eval $VERSION; my %module = (MacOS => 'Mac', diff --git a/lib/File/Spec/Unix.pm b/lib/File/Spec/Unix.pm index fc20200..902e14b 100644 --- a/lib/File/Spec/Unix.pm +++ b/lib/File/Spec/Unix.pm @@ -489,6 +489,7 @@ sub _collapse { my($vol, $dirs, $file) = $fs->splitpath($path); my @dirs = $fs->splitdir($dirs); + pop @dirs if @dirs && $dirs[-1] eq ''; my @collapsed; foreach my $dir (@dirs) { diff --git a/lib/File/Spec/t/Spec.t b/lib/File/Spec/t/Spec.t index c931866..bbc54bf 100644 --- a/lib/File/Spec/t/Spec.t +++ b/lib/File/Spec/t/Spec.t @@ -116,6 +116,8 @@ if ($^O eq 'MacOS') { #[ "Unix->abs2rel('../t4','/t1/t2/t3')", '../t4' ], [ "Unix->abs2rel('/t1/t2/t3', '/')", 't1/t2/t3' ], [ "Unix->abs2rel('/t1/t2/t3', '/t1')", 't2/t3' ], +[ "Unix->abs2rel('t1/t2/t3', 't1')", 't2/t3' ], +[ "Unix->abs2rel('t1/t2/t3', 't4')", '../t1/t2/t3' ], [ "Unix->rel2abs('t4','/t1/t2/t3')", '/t1/t2/t3/t4' ], [ "Unix->rel2abs('t4/t5','/t1/t2/t3')", '/t1/t2/t3/t4/t5' ], @@ -205,6 +207,7 @@ if ($^O eq 'MacOS') { [ "Win32->catdir('A:/')", 'A:\\' ], [ "Win32->catdir('\\', 'foo')", '\\foo' ], + [ "Win32->catfile('a','b','c')", 'a\\b\\c' ], [ "Win32->catfile('a','b','.\\c')", 'a\\b\\c' ], [ "Win32->catfile('.\\a','b','c')", 'a\\b\\c' ], @@ -235,6 +238,8 @@ if ($^O eq 'MacOS') { [ "Win32->canonpath('\\..\\')", '\\' ], [ "Win32->canonpath('/../')", '\\' ], [ "Win32->canonpath('/..\\')", '\\' ], +[ "Win32->canonpath('d1/../foo')", 'foo' ], + [ "Win32->can('_cwd')", '/CODE/' ], # FakeWin32 subclass (see below) just sets CWD to C:\one\two and getdcwd('D') to D:\alpha\beta