Upgrade to PathTools 3.19
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Wed, 12 Jul 2006 08:49:17 +0000 (08:49 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Wed, 12 Jul 2006 08:49:17 +0000 (08:49 +0000)
p4raw-id: //depot/perl@28551

ext/Cwd/Changes
lib/Cwd.pm
lib/File/Spec.pm
lib/File/Spec/Unix.pm
lib/File/Spec/t/Spec.t

index 8efefe1..2199b59 100644 (file)
@@ -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
index 755c7a7..1a85d67 100644 (file)
@@ -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('.');
index 7a3dd26..60553b5 100644 (file)
@@ -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',
index fc20200..902e14b 100644 (file)
@@ -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) {
index c931866..bbc54bf 100644 (file)
@@ -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