summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl/dist/Cwd/lib/File
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/perl/dist/Cwd/lib/File')
-rw-r--r--gnu/usr.bin/perl/dist/Cwd/lib/File/Spec.pm4
-rw-r--r--gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Cygwin.pm2
-rw-r--r--gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Epoc.pm2
-rw-r--r--gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Functions.pm2
-rw-r--r--gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Mac.pm2
-rw-r--r--gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/OS2.pm2
-rw-r--r--gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Unix.pm76
-rw-r--r--gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/VMS.pm2
-rw-r--r--gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Win32.pm2
9 files changed, 33 insertions, 61 deletions
diff --git a/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec.pm b/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec.pm
index 6062c015179..782e28425b7 100644
--- a/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec.pm
+++ b/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec.pm
@@ -3,7 +3,7 @@ package File::Spec;
use strict;
use vars qw(@ISA $VERSION);
-$VERSION = '3.40';
+$VERSION = '3.39_02';
$VERSION =~ tr/_//;
my %module = (MacOS => 'Mac',
@@ -331,7 +331,7 @@ splitpath(), splitdir(), catpath() and catdir() by Barrie Slaymaker.
=head1 COPYRIGHT
-Copyright (c) 2004-2013 by the Perl 5 Porters. All rights reserved.
+Copyright (c) 2004-2010 by the Perl 5 Porters. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
diff --git a/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Cygwin.pm b/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Cygwin.pm
index b27f7b15f19..b63b85f6cda 100644
--- a/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Cygwin.pm
+++ b/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Cygwin.pm
@@ -4,7 +4,7 @@ use strict;
use vars qw(@ISA $VERSION);
require File::Spec::Unix;
-$VERSION = '3.40';
+$VERSION = '3.39_02';
$VERSION =~ tr/_//;
@ISA = qw(File::Spec::Unix);
diff --git a/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Epoc.pm b/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Epoc.pm
index e7faa16086a..50304ffed06 100644
--- a/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Epoc.pm
+++ b/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Epoc.pm
@@ -3,7 +3,7 @@ package File::Spec::Epoc;
use strict;
use vars qw($VERSION @ISA);
-$VERSION = '3.40';
+$VERSION = '3.39_02';
$VERSION =~ tr/_//;
require File::Spec::Unix;
diff --git a/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Functions.pm b/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Functions.pm
index f5b9046aa5e..454a5b30898 100644
--- a/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Functions.pm
+++ b/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Functions.pm
@@ -5,7 +5,7 @@ use strict;
use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $VERSION);
-$VERSION = '3.40';
+$VERSION = '3.39_02';
$VERSION =~ tr/_//;
require Exporter;
diff --git a/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Mac.pm b/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Mac.pm
index 7f42171bc92..57d1d3efb33 100644
--- a/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Mac.pm
+++ b/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Mac.pm
@@ -4,7 +4,7 @@ use strict;
use vars qw(@ISA $VERSION);
require File::Spec::Unix;
-$VERSION = '3.40';
+$VERSION = '3.39_02';
$VERSION =~ tr/_//;
@ISA = qw(File::Spec::Unix);
diff --git a/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/OS2.pm b/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/OS2.pm
index 7f60d68927a..5461cf7a701 100644
--- a/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/OS2.pm
+++ b/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/OS2.pm
@@ -4,7 +4,7 @@ use strict;
use vars qw(@ISA $VERSION);
require File::Spec::Unix;
-$VERSION = '3.40';
+$VERSION = '3.39_02';
$VERSION =~ tr/_//;
@ISA = qw(File::Spec::Unix);
diff --git a/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Unix.pm b/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Unix.pm
index a1a91b42607..c150445d776 100644
--- a/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Unix.pm
+++ b/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Unix.pm
@@ -3,7 +3,7 @@ package File::Spec::Unix;
use strict;
use vars qw($VERSION);
-$VERSION = '3.40';
+$VERSION = '3.39_02';
$VERSION =~ tr/_//;
=head1 NAME
@@ -352,11 +352,9 @@ directories.
If $path is relative, it is converted to absolute form using L</rel2abs()>.
This means that it is taken to be relative to L<cwd()|Cwd>.
-No checks against the filesystem are made, so the result may not be correct if
-C<$base> contains symbolic links. (Apply
-L<Cwd::abs_path()|Cwd/abs_path> beforehand if that
-is a concern.) On VMS, there is interaction with the working environment, as
-logicals and macros are expanded.
+No checks against the filesystem are made. On VMS, there is
+interaction with the working environment, as logicals and
+macros are expanded.
Based on code written by Shigio Yamaguchi.
@@ -368,32 +366,28 @@ sub abs2rel {
($path, $base) = map $self->canonpath($_), $path, $base;
- my $path_directories;
- my $base_directories;
-
if (grep $self->file_name_is_absolute($_), $path, $base) {
($path, $base) = map $self->rel2abs($_), $path, $base;
+ }
+ else {
+ # save a couple of cwd()s if both paths are relative
+ ($path, $base) = map $self->catdir('/', $_), $path, $base;
+ }
- my ($path_volume) = $self->splitpath($path, 1);
- my ($base_volume) = $self->splitpath($base, 1);
+ my ($path_volume) = $self->splitpath($path, 1);
+ my ($base_volume) = $self->splitpath($base, 1);
- # Can't relativize across volumes
- return $path unless $path_volume eq $base_volume;
+ # Can't relativize across volumes
+ return $path unless $path_volume eq $base_volume;
- $path_directories = ($self->splitpath($path, 1))[1];
- $base_directories = ($self->splitpath($base, 1))[1];
+ my $path_directories = ($self->splitpath($path, 1))[1];
+ my $base_directories = ($self->splitpath($base, 1))[1];
- # For UNC paths, the user might give a volume like //foo/bar that
- # strictly speaking has no directory portion. Treat it as if it
- # had the root directory for that volume.
- if (!length($base_directories) and $self->file_name_is_absolute($base)) {
- $base_directories = $self->rootdir;
- }
- }
- else {
- my $wd= ($self->splitpath($self->_cwd(), 1))[1];
- $path_directories = $self->catdir($wd, $path);
- $base_directories = $self->catdir($wd, $base);
+ # For UNC paths, the user might give a volume like //foo/bar that
+ # strictly speaking has no directory portion. Treat it as if it
+ # had the root directory for that volume.
+ if (!length($base_directories) and $self->file_name_is_absolute($base)) {
+ $base_directories = $self->rootdir;
}
# Now, remove all leading components that are the same
@@ -401,39 +395,19 @@ sub abs2rel {
my @basechunks = $self->splitdir( $base_directories );
if ($base_directories eq $self->rootdir) {
- return $self->curdir if $path_directories eq $self->rootdir;
shift @pathchunks;
return $self->canonpath( $self->catpath('', $self->catdir( @pathchunks ), '') );
}
- my @common;
while (@pathchunks && @basechunks && $self->_same($pathchunks[0], $basechunks[0])) {
- push @common, shift @pathchunks ;
+ shift @pathchunks ;
shift @basechunks ;
}
return $self->curdir unless @pathchunks || @basechunks;
- # @basechunks now contains the directories the resulting relative path
- # must ascend out of before it can descend to $path_directory. If there
- # are updir components, we must descend into the corresponding directories
- # (this only works if they are no symlinks).
- my @reverse_base;
- while( defined(my $dir= shift @basechunks) ) {
- if( $dir ne $self->updir ) {
- unshift @reverse_base, $self->updir;
- push @common, $dir;
- }
- elsif( @common ) {
- if( @reverse_base && $reverse_base[0] eq $self->updir ) {
- shift @reverse_base;
- pop @common;
- }
- else {
- unshift @reverse_base, pop @common;
- }
- }
- }
- my $result_dirs = $self->catdir( @reverse_base, @pathchunks );
+ # $base now contains the directories the resulting relative path
+ # must ascend out of before it can descend to $path_directory.
+ my $result_dirs = $self->catdir( ($self->updir) x @basechunks, @pathchunks );
return $self->canonpath( $self->catpath('', $result_dirs, '') );
}
@@ -499,8 +473,6 @@ Copyright (c) 2004 by the Perl 5 Porters. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
-Please submit bug reports and patches to perlbug@perl.org.
-
=head1 SEE ALSO
L<File::Spec>
diff --git a/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/VMS.pm b/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/VMS.pm
index 6af1ac0b3d1..1ababbf1350 100644
--- a/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/VMS.pm
+++ b/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/VMS.pm
@@ -4,7 +4,7 @@ use strict;
use vars qw(@ISA $VERSION);
require File::Spec::Unix;
-$VERSION = '3.40';
+$VERSION = '3.39_02';
$VERSION =~ tr/_//;
@ISA = qw(File::Spec::Unix);
diff --git a/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Win32.pm b/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Win32.pm
index ae74a265931..39f5a8bb95a 100644
--- a/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Win32.pm
+++ b/gnu/usr.bin/perl/dist/Cwd/lib/File/Spec/Win32.pm
@@ -5,7 +5,7 @@ use strict;
use vars qw(@ISA $VERSION);
require File::Spec::Unix;
-$VERSION = '3.40';
+$VERSION = '3.39_02';
$VERSION =~ tr/_//;
@ISA = qw(File::Spec::Unix);