r12457 - in /branches/upstream/libfile-spec-perl/current: ./ lib/File/ lib/File/Spec/ t/
bremner-guest at users.alioth.debian.org
bremner-guest at users.alioth.debian.org
Thu Jan 10 18:28:42 UTC 2008
Author: bremner-guest
Date: Thu Jan 10 18:28:42 2008
New Revision: 12457
URL: http://svn.debian.org/wsvn/?sc=1&rev=12457
Log:
[svn-upgrade] Integrating new upstream version, libfile-spec-perl (3.2501)
Modified:
branches/upstream/libfile-spec-perl/current/Changes
branches/upstream/libfile-spec-perl/current/Cwd.pm
branches/upstream/libfile-spec-perl/current/Cwd.xs
branches/upstream/libfile-spec-perl/current/META.yml
branches/upstream/libfile-spec-perl/current/Makefile.PL
branches/upstream/libfile-spec-perl/current/SIGNATURE
branches/upstream/libfile-spec-perl/current/lib/File/Spec.pm
branches/upstream/libfile-spec-perl/current/lib/File/Spec/Cygwin.pm
branches/upstream/libfile-spec-perl/current/lib/File/Spec/Epoc.pm
branches/upstream/libfile-spec-perl/current/lib/File/Spec/Functions.pm
branches/upstream/libfile-spec-perl/current/lib/File/Spec/Mac.pm
branches/upstream/libfile-spec-perl/current/lib/File/Spec/OS2.pm
branches/upstream/libfile-spec-perl/current/lib/File/Spec/Unix.pm
branches/upstream/libfile-spec-perl/current/lib/File/Spec/VMS.pm
branches/upstream/libfile-spec-perl/current/lib/File/Spec/Win32.pm
branches/upstream/libfile-spec-perl/current/t/Spec.t
branches/upstream/libfile-spec-perl/current/t/cwd.t
branches/upstream/libfile-spec-perl/current/t/tmpdir.t
Modified: branches/upstream/libfile-spec-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libfile-spec-perl/current/Changes?rev=12457&op=diff
==============================================================================
--- branches/upstream/libfile-spec-perl/current/Changes (original)
+++ branches/upstream/libfile-spec-perl/current/Changes Thu Jan 10 18:28:42 2008
@@ -1,4 +1,34 @@
Revision history for Perl distribution PathTools.
+
+ - tmpdir() on Cygwin now also looks in $ENV{TMP} and $ENV{TEMP}.
+
+ - case_tolerant() on Cygwin and Win32 now take an optional path
+ argument, defaulting to the C drive, to check for case tolerance,
+ because this fact can vary on different volumes.
+
+ - File::Spec on Unix now uses Cwd::getcwd() rather than Cwd::cwd() to
+ get the current directory because I guess someone on p5p thought it
+ was more appropriate.
+
+ - Added a large set of File::Spec tests for the Cygwin platform.
+
+ - abs_path() now behaves correctly with symbolic links on VMS.
+
+ - Someone fixed a couple of mysterious edge cases in VMS' canonpath()
+ and splitdir().
+
+3.25 - Mon May 21 21:07:26 2007
+
+ - Added a workaround for auto-vivication-of-function-args Perl bug
+ (triggered by OS/2-specific code). [Ilya Zakharevich]
+
+ - Sync with a bleadperl change: miniperl can no longer use Win32::*
+ functions because it cannot load Win32.dll. [Jan Dubois]
+
+ - We only need to load ppport.h when building outside the core, so we
+ avoid using it when in the core.
+
+3.24 - Sun Nov 19 22:52:49 2006
- Fixed a bug in the $ENV{PWD}-updating of Cwd::chdir() when a
dirhandle is passed in. [Steve Peters]
Modified: branches/upstream/libfile-spec-perl/current/Cwd.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libfile-spec-perl/current/Cwd.pm?rev=12457&op=diff
==============================================================================
--- branches/upstream/libfile-spec-perl/current/Cwd.pm (original)
+++ branches/upstream/libfile-spec-perl/current/Cwd.pm Thu Jan 10 18:28:42 2008
@@ -171,7 +171,7 @@
use Exporter;
use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION);
-$VERSION = '3.24';
+$VERSION = '3.2501';
@ISA = qw/ Exporter /;
@EXPORT = qw(cwd getcwd fastcwd fastgetcwd);
@@ -644,11 +644,19 @@
sub _vms_abs_path {
return $ENV{'DEFAULT'} unless @_;
+ my $path = shift;
+
+ if (-l $path) {
+ my $link_target = readlink($path);
+ die "Can't resolve link $path: $!" unless defined $link_target;
+
+ return _vms_abs_path($link_target);
+ }
# may need to turn foo.dir into [.foo]
- my $path = VMS::Filespec::pathify($_[0]);
- $path = $_[0] unless defined $path;
-
+ my $pathified = VMS::Filespec::pathify($path);
+ $path = $pathified if defined $pathified;
+
return VMS::Filespec::rmsexpand($path);
}
@@ -660,7 +668,12 @@
}
sub _win32_cwd {
- $ENV{'PWD'} = Win32::GetCwd();
+ if (defined &DynaLoader::boot_DynaLoader) {
+ $ENV{'PWD'} = Win32::GetCwd();
+ }
+ else { # miniperl
+ chomp($ENV{'PWD'} = `cd`);
+ }
$ENV{'PWD'} =~ s:\\:/:g ;
return $ENV{'PWD'};
}
Modified: branches/upstream/libfile-spec-perl/current/Cwd.xs
URL: http://svn.debian.org/wsvn/branches/upstream/libfile-spec-perl/current/Cwd.xs?rev=12457&op=diff
==============================================================================
--- branches/upstream/libfile-spec-perl/current/Cwd.xs (original)
+++ branches/upstream/libfile-spec-perl/current/Cwd.xs Thu Jan 10 18:28:42 2008
@@ -1,8 +1,10 @@
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
-#define NEED_sv_2pv_nolen
-#include "ppport.h"
+#ifndef NO_PPPORT_H
+# define NEED_sv_2pv_nolen
+# include "ppport.h"
+#endif
#ifdef I_UNISTD
# include <unistd.h>
Modified: branches/upstream/libfile-spec-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libfile-spec-perl/current/META.yml?rev=12457&op=diff
==============================================================================
--- branches/upstream/libfile-spec-perl/current/META.yml (original)
+++ branches/upstream/libfile-spec-perl/current/META.yml Thu Jan 10 18:28:42 2008
@@ -1,6 +1,6 @@
---
name: PathTools
-version: 3.24
+version: 3.2501
author:
- 'Maintained by Ken Williams <KWILLIAMS at cpan.org>'
abstract: Tools for working with paths and file specs across platforms
@@ -21,35 +21,35 @@
provides:
Cwd:
file: Cwd.pm
- version: 3.24
+ version: 3.2501
File::Spec:
file: lib/File/Spec.pm
- version: 3.24
+ version: 3.2501
File::Spec::Cygwin:
file: lib/File/Spec/Cygwin.pm
- version: 1.1
+ version: 3.2501
File::Spec::Epoc:
file: lib/File/Spec/Epoc.pm
- version: 1.1
+ version: 3.2501
File::Spec::Functions:
file: lib/File/Spec/Functions.pm
- version: 1.3
+ version: 3.2501
File::Spec::Mac:
file: lib/File/Spec/Mac.pm
- version: 1.4
+ version: 3.2501
File::Spec::OS2:
file: lib/File/Spec/OS2.pm
- version: 1.2
+ version: 3.2501
File::Spec::Unix:
file: lib/File/Spec/Unix.pm
- version: 1.5
+ version: 3.2501
File::Spec::VMS:
file: lib/File/Spec/VMS.pm
- version: 1.4
+ version: 3.2501
File::Spec::Win32:
file: lib/File/Spec/Win32.pm
- version: 1.6
-generated_by: Module::Build version 0.2805
+ version: 3.2501
+generated_by: Module::Build version 0.2808
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.2.html
version: 1.2
Modified: branches/upstream/libfile-spec-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/branches/upstream/libfile-spec-perl/current/Makefile.PL?rev=12457&op=diff
==============================================================================
--- branches/upstream/libfile-spec-perl/current/Makefile.PL (original)
+++ branches/upstream/libfile-spec-perl/current/Makefile.PL Thu Jan 10 18:28:42 2008
@@ -8,6 +8,11 @@
'DISTNAME' => 'PathTools',
'NAME' => 'Cwd',
'VERSION_FROM' => 'Cwd.pm',
+ (
+ (grep { $_ eq 'PERL_CORE=1' } @ARGV)
+ ? ('DEFINE' => '-DNO_PPPORT_H')
+ : ()
+ ),
'PREREQ_PM' => {
'Carp' => '0',
'File::Basename' => '0',
Modified: branches/upstream/libfile-spec-perl/current/SIGNATURE
URL: http://svn.debian.org/wsvn/branches/upstream/libfile-spec-perl/current/SIGNATURE?rev=12457&op=diff
==============================================================================
--- branches/upstream/libfile-spec-perl/current/SIGNATURE (original)
+++ branches/upstream/libfile-spec-perl/current/SIGNATURE Thu Jan 10 18:28:42 2008
@@ -15,39 +15,39 @@
Hash: SHA1
SHA1 1197012d986a400414e13e25d519db39d392c730 Build.PL
-SHA1 5cb3e2cc4f0127acbeec97842fc8f86fac94b432 Changes
-SHA1 50c4687635b02e0f4d4738159b17296f49ca31e8 Cwd.pm
-SHA1 8c5d2a4908b595e8086fdb2e2d5f6f4a27ea7ba4 Cwd.xs
+SHA1 b19dd58f5158f9e3fe023a43bbea540471714054 Changes
+SHA1 727d160573c97f453dcabc11b644f6140abe9048 Cwd.pm
+SHA1 cdbc14186a5fa967a7a39709690992a1516ee8e4 Cwd.xs
SHA1 ac6246562c365a8ad62f910ef31ce514d5a7e292 INSTALL
SHA1 58c981892283d338e23971c5926089e0a6812caf MANIFEST
-SHA1 de0c64ba6c217524c1357cd492e5d5351109e39b META.yml
-SHA1 807d5e01077e291cf40e73b94fb2c55973e71543 Makefile.PL
-SHA1 eaf082b63a7bb094dcc5ac50460e56bc8d6eb296 lib/File/Spec.pm
-SHA1 4f39d982f94ade7240f78059ec4486dd68f88301 lib/File/Spec/Cygwin.pm
-SHA1 249fccb4e3b22a404b17d992416599f4f61016eb lib/File/Spec/Epoc.pm
-SHA1 b542c8ff00721a0beca5731bac6c5e9cf4312bcd lib/File/Spec/Functions.pm
-SHA1 20a5837ddd90d0cdea65ef1a2dd721e28c57e111 lib/File/Spec/Mac.pm
-SHA1 8b5ead79b173c2dbcb3f51467a8ce07c6f587241 lib/File/Spec/OS2.pm
-SHA1 aee2897e9e02b34389ce20d734819e55ef5cedbb lib/File/Spec/Unix.pm
-SHA1 59aba045220e389f6cd9523c81cf5e0ba6200e2a lib/File/Spec/VMS.pm
-SHA1 5a51c89adbe429954e9ebbe606ea9f61be137e8e lib/File/Spec/Win32.pm
+SHA1 16c91be2a8c9bc6acd162d44c9256b8f6f518cbe META.yml
+SHA1 3fb144a9fe45192b55f0b2950c7074241b4f4aa8 Makefile.PL
+SHA1 f5341cd20701f88bfe6d7d933674473c6e6bd919 lib/File/Spec.pm
+SHA1 62cadf2e17c47d75a3e67c3761366665f3ce5a17 lib/File/Spec/Cygwin.pm
+SHA1 1a8a9e95c25317638751462eb0fb5c2acc6dfa7d lib/File/Spec/Epoc.pm
+SHA1 a8ab06ad1067ce48f4550323bb641be1db228590 lib/File/Spec/Functions.pm
+SHA1 fdf446bc0ce3a3d72ff9360a16c79b2f1678bbed lib/File/Spec/Mac.pm
+SHA1 281103fbe3c27f474501305c204bf50a4ef91e3a lib/File/Spec/OS2.pm
+SHA1 a0486e9dd65e6303c2fad92601bfbf4930f39b54 lib/File/Spec/Unix.pm
+SHA1 f28f1c9236ce3e7360a79ad2fab4cf5c1824111c lib/File/Spec/VMS.pm
+SHA1 48a43ce342ca192dca33378d38deef2544715d69 lib/File/Spec/Win32.pm
SHA1 3d896f74f9c954a5f58b7727b510f3b58354799c ppport.h
SHA1 77d045c1404fbe4c0910ed986b286f7b7b7d560d t/Functions.t
-SHA1 75ce1923b1b0aad79bc16a4b463a83bdac909f72 t/Spec.t
+SHA1 5efcb86ed24a529cb75ac59f06af8dc2fc4547ee t/Spec.t
SHA1 931627255cda4e3fdc2cfd4c1b1478c92c0c3baa t/crossplatform.t
-SHA1 5ea1c5cc1a731a49178b98e8577338ca514882a0 t/cwd.t
+SHA1 df1d559021f28a87a507b2613f32245e51a246c0 t/cwd.t
SHA1 220a2b1de7f23aedf2f9daba53238c3d0b06db63 t/lib/Test/Builder.pm
SHA1 0bac03ea869f3ae55a84fa25ac0754c9e0c0f86d t/lib/Test/More.pm
SHA1 706f1f8f3b928c91a7d70f476fd3f62d2055ac1c t/lib/Test/Simple.pm
SHA1 23537c5ecebd2e0fefa6986c106b994f5d1c8e7a t/lib/Test/Tutorial.pod
SHA1 1eb98918332df0f2c7e76f8e17b74b03851cd8e6 t/rel2abs2rel.t
SHA1 3069528f07a6835dd076ec6831a2a6327b09483e t/taint.t
-SHA1 32f1806b9f78c1b09c20aff612c381e9b9719053 t/tmpdir.t
+SHA1 856b7cad801917cf14ad306edf837ae17e7c72cf t/tmpdir.t
SHA1 9e5be2014f97483e76636bcbeb591392b0d68d16 t/win32.t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
-iD8DBQFFYTSLgrvMBLfvlHYRAoDBAKC0WsT0/yBUmsdqp1wE1LoJLz4TfQCeMcTC
-TSHvkB94d0gUsk4KtMjtAKg=
-=i5MJ
+iD8DBQFHcGvOgrvMBLfvlHYRAjCDAKDB9yY3cBbYxBaLDvq52ji6oSykkwCglNQe
+8ZGjHA+wzI0oFwKdDW5Ttts=
+=WT9v
-----END PGP SIGNATURE-----
Modified: branches/upstream/libfile-spec-perl/current/lib/File/Spec.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libfile-spec-perl/current/lib/File/Spec.pm?rev=12457&op=diff
==============================================================================
--- branches/upstream/libfile-spec-perl/current/lib/File/Spec.pm (original)
+++ branches/upstream/libfile-spec-perl/current/lib/File/Spec.pm Thu Jan 10 18:28:42 2008
@@ -3,7 +3,7 @@
use strict;
use vars qw(@ISA $VERSION);
-$VERSION = '3.24';
+$VERSION = '3.2501';
$VERSION = eval $VERSION;
my %module = (MacOS => 'Mac',
Modified: branches/upstream/libfile-spec-perl/current/lib/File/Spec/Cygwin.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libfile-spec-perl/current/lib/File/Spec/Cygwin.pm?rev=12457&op=diff
==============================================================================
--- branches/upstream/libfile-spec-perl/current/lib/File/Spec/Cygwin.pm (original)
+++ branches/upstream/libfile-spec-perl/current/lib/File/Spec/Cygwin.pm Thu Jan 10 18:28:42 2008
@@ -4,7 +4,7 @@
use vars qw(@ISA $VERSION);
require File::Spec::Unix;
-$VERSION = '1.1';
+$VERSION = '3.2501';
@ISA = qw(File::Spec::Unix);
@@ -53,7 +53,7 @@
my $self = shift;
# Don't create something that looks like a //network/path
- if ($_[0] eq '/' or $_[0] eq '\\') {
+ if ($_[0] and ($_[0] eq '/' or $_[0] eq '\\')) {
shift;
return $self->SUPER::catdir('', @_);
}
@@ -84,6 +84,8 @@
$ENV{TMPDIR}
/tmp
+ $ENV{'TMP'}
+ $ENV{'TEMP'}
C:/temp
Since Perl 5.8.0, if running under taint mode, and if the environment
@@ -94,14 +96,52 @@
my $tmpdir;
sub tmpdir {
return $tmpdir if defined $tmpdir;
- $tmpdir = $_[0]->_tmpdir( $ENV{TMPDIR}, "/tmp", 'C:/temp' );
+ $tmpdir = $_[0]->_tmpdir( $ENV{TMPDIR}, "/tmp", $ENV{'TMP'}, $ENV{'TEMP'}, 'C:/temp' );
+}
+
+=item case_tolerant
+
+Override Unix. Cygwin case-tolerance depends on managed mount settings and
+as with MsWin32 on GetVolumeInformation() $ouFsFlags == FS_CASE_SENSITIVE,
+indicating the case significance when comparing file specifications.
+Default: 1
+
+=cut
+
+sub case_tolerant () {
+ if ($^O ne 'cygwin') {
+ return 1;
+ }
+ my $drive = shift;
+ if (! $drive) {
+ my @flags = split(/,/, Cygwin::mount_flags('/cygwin'));
+ my $prefix = pop(@flags);
+ if (! $prefix || $prefix eq 'cygdrive') {
+ $drive = '/cygdrive/c';
+ } elsif ($prefix eq '/') {
+ $drive = '/c';
+ } else {
+ $drive = "$prefix/c";
+ }
+ }
+ my $mntopts = Cygwin::mount_flags($drive);
+ if ($mntopts and ($mntopts =~ /,managed/)) {
+ return 0;
+ }
+ eval { require Win32API::File; } or return 1;
+ my $osFsType = "\0"x256;
+ my $osVolName = "\0"x256;
+ my $ouFsFlags = 0;
+ Win32API::File::GetVolumeInformation($drive, $osVolName, 256, [], [], $ouFsFlags, $osFsType, 256 );
+ if ($ouFsFlags & Win32API::File::FS_CASE_SENSITIVE()) { return 0; }
+ else { return 1; }
}
=back
=head1 COPYRIGHT
-Copyright (c) 2004 by the Perl 5 Porters. All rights reserved.
+Copyright (c) 2004,2007 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.
Modified: branches/upstream/libfile-spec-perl/current/lib/File/Spec/Epoc.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libfile-spec-perl/current/lib/File/Spec/Epoc.pm?rev=12457&op=diff
==============================================================================
--- branches/upstream/libfile-spec-perl/current/lib/File/Spec/Epoc.pm (original)
+++ branches/upstream/libfile-spec-perl/current/lib/File/Spec/Epoc.pm Thu Jan 10 18:28:42 2008
@@ -3,7 +3,7 @@
use strict;
use vars qw($VERSION @ISA);
-$VERSION = '1.1';
+$VERSION = '3.2501';
require File::Spec::Unix;
@ISA = qw(File::Spec::Unix);
Modified: branches/upstream/libfile-spec-perl/current/lib/File/Spec/Functions.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libfile-spec-perl/current/lib/File/Spec/Functions.pm?rev=12457&op=diff
==============================================================================
--- branches/upstream/libfile-spec-perl/current/lib/File/Spec/Functions.pm (original)
+++ branches/upstream/libfile-spec-perl/current/lib/File/Spec/Functions.pm Thu Jan 10 18:28:42 2008
@@ -5,7 +5,7 @@
use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $VERSION);
-$VERSION = '1.3';
+$VERSION = '3.2501';
require Exporter;
Modified: branches/upstream/libfile-spec-perl/current/lib/File/Spec/Mac.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libfile-spec-perl/current/lib/File/Spec/Mac.pm?rev=12457&op=diff
==============================================================================
--- branches/upstream/libfile-spec-perl/current/lib/File/Spec/Mac.pm (original)
+++ branches/upstream/libfile-spec-perl/current/lib/File/Spec/Mac.pm Thu Jan 10 18:28:42 2008
@@ -4,7 +4,7 @@
use vars qw(@ISA $VERSION);
require File::Spec::Unix;
-$VERSION = '1.4';
+$VERSION = '3.2501';
@ISA = qw(File::Spec::Unix);
Modified: branches/upstream/libfile-spec-perl/current/lib/File/Spec/OS2.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libfile-spec-perl/current/lib/File/Spec/OS2.pm?rev=12457&op=diff
==============================================================================
--- branches/upstream/libfile-spec-perl/current/lib/File/Spec/OS2.pm (original)
+++ branches/upstream/libfile-spec-perl/current/lib/File/Spec/OS2.pm Thu Jan 10 18:28:42 2008
@@ -4,7 +4,7 @@
use vars qw(@ISA $VERSION);
require File::Spec::Unix;
-$VERSION = '1.2';
+$VERSION = '3.2501';
@ISA = qw(File::Spec::Unix);
@@ -37,9 +37,8 @@
my $tmpdir;
sub tmpdir {
return $tmpdir if defined $tmpdir;
- $tmpdir = $_[0]->_tmpdir( @ENV{qw(TMPDIR TEMP TMP)},
- '/tmp',
- '/' );
+ my @d = @ENV{qw(TMPDIR TEMP TMP)}; # function call could autovivivy
+ $tmpdir = $_[0]->_tmpdir( @d, '/tmp', '/' );
}
sub catdir {
Modified: branches/upstream/libfile-spec-perl/current/lib/File/Spec/Unix.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libfile-spec-perl/current/lib/File/Spec/Unix.pm?rev=12457&op=diff
==============================================================================
--- branches/upstream/libfile-spec-perl/current/lib/File/Spec/Unix.pm (original)
+++ branches/upstream/libfile-spec-perl/current/lib/File/Spec/Unix.pm Thu Jan 10 18:28:42 2008
@@ -3,7 +3,7 @@
use strict;
use vars qw($VERSION);
-$VERSION = '1.5';
+$VERSION = '3.2501';
=head1 NAME
@@ -475,7 +475,7 @@
# File::Spec subclasses use this.
sub _cwd {
require Cwd;
- Cwd::cwd();
+ Cwd::getcwd();
}
Modified: branches/upstream/libfile-spec-perl/current/lib/File/Spec/VMS.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libfile-spec-perl/current/lib/File/Spec/VMS.pm?rev=12457&op=diff
==============================================================================
--- branches/upstream/libfile-spec-perl/current/lib/File/Spec/VMS.pm (original)
+++ branches/upstream/libfile-spec-perl/current/lib/File/Spec/VMS.pm Thu Jan 10 18:28:42 2008
@@ -4,7 +4,7 @@
use vars qw(@ISA $VERSION);
require File::Spec::Unix;
-$VERSION = '1.4';
+$VERSION = '3.2501';
@ISA = qw(File::Spec::Unix);
@@ -35,6 +35,8 @@
sub canonpath {
my($self,$path) = @_;
+
+ return undef unless defined $path;
if ($path =~ m|/|) { # Fake Unix
my $pathify = $path =~ m|/\Z(?!\n)|;
@@ -260,6 +262,8 @@
sub splitdir {
my($self,$dirspec) = @_;
+ my @dirs = ();
+ return @dirs if ( (!defined $dirspec) || ('' eq $dirspec) );
$dirspec =~ tr/<>/[]/; # < and > ==> [ and ]
$dirspec =~ s/\]\[\./\.\]\[/g; # ][. ==> .][
$dirspec =~ s/\[000000\.\]\[/\[/g; # [000000.][ ==> [
@@ -274,7 +278,8 @@
# .--] ==> .-.-]
# [--] ==> [-.-]
$dirspec = "[$dirspec]" unless $dirspec =~ /[\[<]/; # make legal
- my(@dirs) = split('\.', vmspath($dirspec));
+ $dirspec =~ s/^(\[|<)\./$1/;
+ @dirs = split /(?<!\^)\./, vmspath($dirspec);
$dirs[0] =~ s/^[\[<]//s; $dirs[-1] =~ s/[\]>]\Z(?!\n)//s;
@dirs;
}
Modified: branches/upstream/libfile-spec-perl/current/lib/File/Spec/Win32.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libfile-spec-perl/current/lib/File/Spec/Win32.pm?rev=12457&op=diff
==============================================================================
--- branches/upstream/libfile-spec-perl/current/lib/File/Spec/Win32.pm (original)
+++ branches/upstream/libfile-spec-perl/current/lib/File/Spec/Win32.pm Thu Jan 10 18:28:42 2008
@@ -5,7 +5,7 @@
use vars qw(@ISA $VERSION);
require File::Spec::Unix;
-$VERSION = '1.6';
+$VERSION = '3.2501';
@ISA = qw(File::Spec::Unix);
@@ -77,13 +77,35 @@
'/' );
}
-sub case_tolerant {
- return 1;
-}
+=item case_tolerant
+
+MSWin32 case-tolerance depends on GetVolumeInformation() $ouFsFlags == FS_CASE_SENSITIVE,
+indicating the case significance when comparing file specifications.
+Since XP FS_CASE_SENSITIVE is effectively disabled for the NT subsubsystem.
+See http://cygwin.com/ml/cygwin/2007-07/msg00891.html
+Default: 1
+
+=cut
+
+sub case_tolerant () {
+ eval { require Win32API::File; } or return 1;
+ my $drive = shift || "C:";
+ my $osFsType = "\0"x256;
+ my $osVolName = "\0"x256;
+ my $ouFsFlags = 0;
+ Win32API::File::GetVolumeInformation($drive, $osVolName, 256, [], [], $ouFsFlags, $osFsType, 256 );
+ if ($ouFsFlags & Win32API::File::FS_CASE_SENSITIVE()) { return 0; }
+ else { return 1; }
+}
+
+=item file_name_is_absolute
+
+As of right now, this returns 2 if the path is absolute with a
+volume, 1 if it's absolute with no volume, 0 otherwise.
+
+=cut
sub file_name_is_absolute {
- # As of right now, this returns 2 if the path is absolute with a
- # volume, 1 if it's absolute with no volume, 0 otherwise.
my ($self,$file) = @_;
@@ -341,7 +363,7 @@
=head1 COPYRIGHT
-Copyright (c) 2004 by the Perl 5 Porters. All rights reserved.
+Copyright (c) 2004,2007 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.
Modified: branches/upstream/libfile-spec-perl/current/t/Spec.t
URL: http://svn.debian.org/wsvn/branches/upstream/libfile-spec-perl/current/t/Spec.t?rev=12457&op=diff
==============================================================================
--- branches/upstream/libfile-spec-perl/current/t/Spec.t (original)
+++ branches/upstream/libfile-spec-perl/current/t/Spec.t Thu Jan 10 18:28:42 2008
@@ -358,16 +358,17 @@
[ "VMS->splitdir('[]')", '' ],
[ "VMS->splitdir('d1.d2.d3')", 'd1,d2,d3' ],
[ "VMS->splitdir('[d1.d2.d3]')", 'd1,d2,d3' ],
-[ "VMS->splitdir('.d1.d2.d3')", ',d1,d2,d3' ],
-[ "VMS->splitdir('[.d1.d2.d3]')", ',d1,d2,d3' ],
-[ "VMS->splitdir('.-.d2.d3')", ',-,d2,d3' ],
-[ "VMS->splitdir('[.-.d2.d3]')", ',-,d2,d3' ],
+[ "VMS->splitdir('.d1.d2.d3')", 'd1,d2,d3' ],
+[ "VMS->splitdir('[.d1.d2.d3]')", 'd1,d2,d3' ],
+[ "VMS->splitdir('.-.d2.d3')", '-,d2,d3' ],
+[ "VMS->splitdir('[.-.d2.d3]')", '-,d2,d3' ],
[ "VMS->splitdir('[d1.d2]')", 'd1,d2' ],
[ "VMS->splitdir('[d1-.--d2]')", 'd1-,--d2' ],
[ "VMS->splitdir('[d1---.-.d2]')", 'd1---,-,d2' ],
[ "VMS->splitdir('[d1.---.d2]')", 'd1,-,-,-,d2' ],
[ "VMS->splitdir('[d1---d2]')", 'd1---d2' ],
[ "VMS->splitdir('[d1.][000000.d2]')", 'd1,d2' ],
+[ "VMS->splitdir('[.d1.d2^.d3]')", 'd1,d2^.d3' ],
[ "VMS->catdir('')", '' ],
[ "VMS->catdir('d1','d2','d3')", '[.d1.d2.d3]' ],
@@ -618,8 +619,81 @@
#[ "Epoc->canonpath('/a/.')", '/a' ],
#[ "Epoc->canonpath('/.')", '/' ],
-[ "Cygwin->case_tolerant()", '0' ],
+[ "Cygwin->case_tolerant()", '1' ],
+[ "Cygwin->catfile('a','b','c')", 'a/b/c' ],
+[ "Cygwin->catfile('a','b','./c')", 'a/b/c' ],
+[ "Cygwin->catfile('./a','b','c')", 'a/b/c' ],
+[ "Cygwin->catfile('c')", 'c' ],
+[ "Cygwin->catfile('./c')", 'c' ],
+
+[ "Cygwin->splitpath('file')", ',,file' ],
+[ "Cygwin->splitpath('/d1/d2/d3/')", ',/d1/d2/d3/,' ],
+[ "Cygwin->splitpath('d1/d2/d3/')", ',d1/d2/d3/,' ],
+[ "Cygwin->splitpath('/d1/d2/d3/.')", ',/d1/d2/d3/.,' ],
+[ "Cygwin->splitpath('/d1/d2/d3/..')", ',/d1/d2/d3/..,' ],
+[ "Cygwin->splitpath('/d1/d2/d3/.file')", ',/d1/d2/d3/,.file' ],
+[ "Cygwin->splitpath('d1/d2/d3/file')", ',d1/d2/d3/,file' ],
+[ "Cygwin->splitpath('/../../d1/')", ',/../../d1/,' ],
+[ "Cygwin->splitpath('/././d1/')", ',/././d1/,' ],
+
+[ "Cygwin->catpath('','','file')", 'file' ],
+[ "Cygwin->catpath('','/d1/d2/d3/','')", '/d1/d2/d3/' ],
+[ "Cygwin->catpath('','d1/d2/d3/','')", 'd1/d2/d3/' ],
+[ "Cygwin->catpath('','/d1/d2/d3/.','')", '/d1/d2/d3/.' ],
+[ "Cygwin->catpath('','/d1/d2/d3/..','')", '/d1/d2/d3/..' ],
+[ "Cygwin->catpath('','/d1/d2/d3/','.file')", '/d1/d2/d3/.file' ],
+[ "Cygwin->catpath('','d1/d2/d3/','file')", 'd1/d2/d3/file' ],
+[ "Cygwin->catpath('','/../../d1/','')", '/../../d1/' ],
+[ "Cygwin->catpath('','/././d1/','')", '/././d1/' ],
+[ "Cygwin->catpath('d1','d2/d3/','')", 'd2/d3/' ],
+[ "Cygwin->catpath('d1','d2','d3/')", 'd2/d3/' ],
+
+[ "Cygwin->splitdir('')", '' ],
+[ "Cygwin->splitdir('/d1/d2/d3/')", ',d1,d2,d3,' ],
+[ "Cygwin->splitdir('d1/d2/d3/')", 'd1,d2,d3,' ],
+[ "Cygwin->splitdir('/d1/d2/d3')", ',d1,d2,d3' ],
+[ "Cygwin->splitdir('d1/d2/d3')", 'd1,d2,d3' ],
+
+[ "Cygwin->catdir()", '' ],
+[ "Cygwin->catdir('/')", '/' ],
+[ "Cygwin->catdir('','d1','d2','d3','')", '/d1/d2/d3' ],
+[ "Cygwin->catdir('d1','d2','d3','')", 'd1/d2/d3' ],
+[ "Cygwin->catdir('','d1','d2','d3')", '/d1/d2/d3' ],
+[ "Cygwin->catdir('d1','d2','d3')", 'd1/d2/d3' ],
[ "Cygwin->catdir('/','d2/d3')", '/d2/d3' ],
+
+[ "Cygwin->canonpath('///../../..//./././a//b/.././c/././')", '/a/b/../c' ],
+[ "Cygwin->canonpath('')", '' ],
+[ "Cygwin->canonpath('a/../../b/c')", 'a/../../b/c' ],
+[ "Cygwin->canonpath('/.')", '/' ],
+[ "Cygwin->canonpath('/./')", '/' ],
+[ "Cygwin->canonpath('/a/./')", '/a' ],
+[ "Cygwin->canonpath('/a/.')", '/a' ],
+[ "Cygwin->canonpath('/../../')", '/' ],
+[ "Cygwin->canonpath('/../..')", '/' ],
+
+[ "Cygwin->abs2rel('/t1/t2/t3','/t1/t2/t3')", '.' ],
+[ "Cygwin->abs2rel('/t1/t2/t4','/t1/t2/t3')", '../t4' ],
+[ "Cygwin->abs2rel('/t1/t2','/t1/t2/t3')", '..' ],
+[ "Cygwin->abs2rel('/t1/t2/t3/t4','/t1/t2/t3')", 't4' ],
+[ "Cygwin->abs2rel('/t4/t5/t6','/t1/t2/t3')", '../../../t4/t5/t6' ],
+#[ "Cygwin->abs2rel('../t4','/t1/t2/t3')", '../t4' ],
+[ "Cygwin->abs2rel('/','/t1/t2/t3')", '../../..' ],
+[ "Cygwin->abs2rel('///','/t1/t2/t3')", '../../..' ],
+[ "Cygwin->abs2rel('/.','/t1/t2/t3')", '../../..' ],
+[ "Cygwin->abs2rel('/./','/t1/t2/t3')", '../../..' ],
+#[ "Cygwin->abs2rel('../t4','/t1/t2/t3')", '../t4' ],
+[ "Cygwin->abs2rel('/t1/t2/t3', '/')", 't1/t2/t3' ],
+[ "Cygwin->abs2rel('/t1/t2/t3', '/t1')", 't2/t3' ],
+[ "Cygwin->abs2rel('t1/t2/t3', 't1')", 't2/t3' ],
+[ "Cygwin->abs2rel('t1/t2/t3', 't4')", '../t1/t2/t3' ],
+
+[ "Cygwin->rel2abs('t4','/t1/t2/t3')", '/t1/t2/t3/t4' ],
+[ "Cygwin->rel2abs('t4/t5','/t1/t2/t3')", '/t1/t2/t3/t4/t5' ],
+[ "Cygwin->rel2abs('.','/t1/t2/t3')", '/t1/t2/t3' ],
+[ "Cygwin->rel2abs('..','/t1/t2/t3')", '/t1/t2/t3/..' ],
+[ "Cygwin->rel2abs('../t4','/t1/t2/t3')", '/t1/t2/t3/../t4' ],
+[ "Cygwin->rel2abs('/t1','/t1/t2/t3')", '/t1' ],
) ;
Modified: branches/upstream/libfile-spec-perl/current/t/cwd.t
URL: http://svn.debian.org/wsvn/branches/upstream/libfile-spec-perl/current/t/cwd.t?rev=12457&op=diff
==============================================================================
--- branches/upstream/libfile-spec-perl/current/t/cwd.t (original)
+++ branches/upstream/libfile-spec-perl/current/t/cwd.t Thu Jan 10 18:28:42 2008
@@ -173,14 +173,14 @@
my $abs_path = Cwd::abs_path("linktest");
my $fast_abs_path = Cwd::fast_abs_path("linktest");
- my $want = File::Spec->catdir("t", $Test_Dir);
-
- like($abs_path, qr|$want$|);
- like($fast_abs_path, qr|$want$|);
- like(Cwd::_perl_abs_path("linktest"), qr|$want$|) if $EXTRA_ABSPATH_TESTS;
+ my $want = quotemeta( File::Spec->rel2abs( $Test_Dir ) );
+
+ like($abs_path, qr|$want$|i);
+ like($fast_abs_path, qr|$want$|i);
+ like(Cwd::_perl_abs_path("linktest"), qr|$want$|i) if $EXTRA_ABSPATH_TESTS;
rmtree($test_dirs[0], 0, 0);
- unlink "linktest";
+ 1 while unlink "linktest";
}
if ($ENV{PERL_CORE}) {
Modified: branches/upstream/libfile-spec-perl/current/t/tmpdir.t
URL: http://svn.debian.org/wsvn/branches/upstream/libfile-spec-perl/current/t/tmpdir.t?rev=12457&op=diff
==============================================================================
--- branches/upstream/libfile-spec-perl/current/t/tmpdir.t (original)
+++ branches/upstream/libfile-spec-perl/current/t/tmpdir.t Thu Jan 10 18:28:42 2008
@@ -5,7 +5,7 @@
use File::Spec;
use File::Spec::Win32;
-plan tests => 3;
+plan tests => 4;
ok 1, 1, "Loaded";
@@ -13,5 +13,14 @@
File::Spec->tmpdir;
ok scalar keys %ENV, $num_keys, "tmpdir() shouldn't change the contents of %ENV";
+if ($^O eq 'VMS') {
+ skip('Can\'t make list assignment to \%ENV on this system', 1);
+}
+else {
+ local %ENV;
+ File::Spec::Win32->tmpdir;
+ ok scalar keys %ENV, 0, "Win32->tmpdir() shouldn't change the contents of %ENV";
+}
+
File::Spec::Win32->tmpdir;
ok scalar keys %ENV, $num_keys, "Win32->tmpdir() shouldn't change the contents of %ENV";
More information about the Pkg-perl-cvs-commits
mailing list