Change 29356 by [EMAIL PROTECTED] on 2006/11/23 03:09:08

        Upgrade to PathTools-3.24.

Affected files ...

... //depot/perl/ext/Cwd/Changes#29 edit
... //depot/perl/lib/Cwd.pm#106 edit
... //depot/perl/lib/File/Spec.pm#56 edit
... //depot/perl/lib/File/Spec/Cygwin.pm#13 edit
... //depot/perl/lib/File/Spec/Unix.pm#57 edit

Differences ...

==== //depot/perl/ext/Cwd/Changes#29 (text) ====
Index: perl/ext/Cwd/Changes
--- perl/ext/Cwd/Changes#28~29004~      2006-10-12 08:07:17.000000000 -0700
+++ perl/ext/Cwd/Changes        2006-11-22 19:09:08.000000000 -0800
@@ -1,5 +1,18 @@
 Revision history for Perl distribution PathTools.
 
+ - Fixed a bug in the $ENV{PWD}-updating of Cwd::chdir() when a
+   dirhandle is passed in. [Steve Peters]
+
+ - Add perl 5.005 to the list of requirements in the
+   Build.PL/Makefile.PL/META.yml.
+
+ - Add ExtUtils::CBuilder to the list of build_requires in Build.PL.
+
+ - Improved performance of canonpath() on Unix-ish platforms - on my
+   OS X laptop it looks like it's about twice as fast. [Ruslan Zakirov]
+
+3.23 - Wed Oct 11 12:11:25 2006
+
  - Yet more Win32 fixes (sigh... seems like I'm fighting a neverending
    waterbed...).  This time, fixed file_name_is_absolute() to know
    what it's doing when the path includes a volume but a relative

==== //depot/perl/lib/Cwd.pm#106 (text) ====
Index: perl/lib/Cwd.pm
--- perl/lib/Cwd.pm#105~29004~  2006-10-12 08:07:17.000000000 -0700
+++ perl/lib/Cwd.pm     2006-11-22 19:09:08.000000000 -0800
@@ -171,7 +171,7 @@
 use Exporter;
 use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION);
 
-$VERSION = '3.23';
+$VERSION = '3.24';
 
 @ISA = qw/ Exporter /;
 @EXPORT = qw(cwd getcwd fastcwd fastgetcwd);
@@ -479,7 +479,9 @@
        return 1;
     }
 
-    if ($newdir =~ m#^/#s) {
+    if (ref $newdir eq 'GLOB') { # in case a file/dir handle is passed in
+       $ENV{'PWD'} = cwd();
+    } elsif ($newdir =~ m#^/#s) {
        $ENV{'PWD'} = $newdir;
     } else {
        my @curdir = split(m#/#,$ENV{'PWD'});

==== //depot/perl/lib/File/Spec.pm#56 (text) ====
Index: perl/lib/File/Spec.pm
--- perl/lib/File/Spec.pm#55~29004~     2006-10-12 08:07:17.000000000 -0700
+++ perl/lib/File/Spec.pm       2006-11-22 19:09:08.000000000 -0800
@@ -3,7 +3,7 @@
 use strict;
 use vars qw(@ISA $VERSION);
 
-$VERSION = '3.23';
+$VERSION = '3.24';
 $VERSION = eval $VERSION;
 
 my %module = (MacOS   => 'Mac',

==== //depot/perl/lib/File/Spec/Cygwin.pm#13 (text) ====
Index: perl/lib/File/Spec/Cygwin.pm
--- perl/lib/File/Spec/Cygwin.pm#12~26174~      2005-11-19 05:46:27.000000000 
-0800
+++ perl/lib/File/Spec/Cygwin.pm        2006-11-22 19:09:08.000000000 -0800
@@ -40,7 +40,13 @@
 sub canonpath {
     my($self,$path) = @_;
     $path =~ s|\\|/|g;
-    return $self->SUPER::canonpath($path);
+
+    # Handle network path names beginning with double slash
+    my $node = '';
+    if ( $path =~ [EMAIL PROTECTED](//[^/]+)(?:/|\z)@/@s ) {
+        $node = $1;
+    }
+    return $node . $self->SUPER::canonpath($path);
 }
 
 sub catdir {

==== //depot/perl/lib/File/Spec/Unix.pm#57 (text) ====
Index: perl/lib/File/Spec/Unix.pm
--- perl/lib/File/Spec/Unix.pm#56~28983~        2006-10-10 07:05:52.000000000 
-0700
+++ perl/lib/File/Spec/Unix.pm  2006-11-22 19:09:08.000000000 -0800
@@ -43,13 +43,12 @@
     my ($self,$path) = @_;
     
     # Handle POSIX-style node names beginning with double slash (qnx, nto)
-    # Handle network path names beginning with double slash (cygwin)
     # (POSIX says: "a pathname that begins with two successive slashes
     # may be interpreted in an implementation-defined manner, although
     # more than two leading slashes shall be treated as a single slash.")
     my $node = '';
-    my $double_slashes_special = $self->isa("File::Spec::Cygwin") || $^O =~ 
m/^(?:qnx|nto)$/;
-    if ( $double_slashes_special && $path =~ s:^(//[^/]+)(/|\z):/:s ) {
+    my $double_slashes_special = $^O eq 'qnx' || $^O eq 'nto';
+    if ( $double_slashes_special && $path =~ s{^(//[^/]+)(?:/|\z)}{/}s ) {
       $node = $1;
     }
     # This used to be
@@ -57,12 +56,12 @@
     # but that made tests 29, 30, 35, 46, and 213 (as of #13272) to fail
     # (Mainly because trailing "" directories didn't get stripped).
     # Why would cygwin avoid collapsing multiple slashes into one? --jhi
-    $path =~ s|/+|/|g;                             # xx////xx  -> xx/xx
-    $path =~ s@(/\.)+(/|\Z(?!\n))@/@g;             # xx/././xx -> xx/xx
-    $path =~ s|^(\./)+||s unless $path eq "./";    # ./xx      -> xx
-    $path =~ s|^/(\.\./)+|/|;                      # /../../xx -> xx
+    $path =~ s|/{2,}|/|g;                            # xx////xx  -> xx/xx
+    $path =~ s{(?:/\.)+(?:/|\z)}{/}g;                # xx/././xx -> xx/xx
+    $path =~ s|^(?:\./)+||s unless $path eq "./";    # ./xx      -> xx
+    $path =~ s|^/(?:\.\./)+|/|;                      # /../../xx -> xx
     $path =~ s|^/\.\.$|/|;                         # /..       -> /
-    $path =~ s|/\Z(?!\n)|| unless $path eq "/";          # xx/       -> xx
+    $path =~ s|/\z|| unless $path eq "/";          # xx/       -> xx
     return "$node$path";
 }
 
@@ -180,7 +179,7 @@
 
 sub no_upwards {
     my $self = shift;
-    return grep(!/^\.{1,2}\Z(?!\n)/s, @_);
+    return grep(!/^\.{1,2}\z/s, @_);
 }
 
 =item case_tolerant
@@ -260,7 +259,7 @@
         $directory = $path;
     }
     else {
-        $path =~ m|^ ( (?: .* / (?: \.\.?\Z(?!\n) )? )? ) ([^/]*) |xs;
+        $path =~ m|^ ( (?: .* / (?: \.\.?\z )? )? ) ([^/]*) |xs;
         $directory = $1;
         $file      = $2;
     }
End of Patch.

Reply via email to