New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File::Spec->case_tolerant() should return true on Cygwin #8555
Comments
From g.paulissen@chello.nlThis is a bug report for perl from g.paulissen@chello.nl, In think the File::Spec::Cygwin case_tolerant() should return true (1) instead of false (0). $ perl -e "use File::Spec; print File::Spec->case_tolerant();" Why? Have a look at the following commands: $ which sqlplus $ ln -s /cygdrive/c/Oracle/product/10.1.0/Db__4/bin/sqlplus SQLPLUS.exe $ PATH=.:$PATH $ which sqlplus So although the executable is named SQLPLUS.exe, which still can find it. Flags: Site configuration information for perl v5.8.4: Configured by ActiveState at Tue Jun 1 11:52:09 2004. Summary of my perl5 (revision 5 version 8 subversion 4) configuration: Locally applied patches: @INC for perl v5.8.4: Environment for perl v5.8.4: |
From @schwerng.paulissen@chello.nl (via RT) wrote:
Is that magic in which or is that magic in the filesystem? I know Cygwin's which is already pretty magical with regard to .exe. A simple way to test this is: open FILE, ">this is a test file" or die $!; print open(FILE, "This is a Test FILE") ? "Tolerant" : "Intolerant"; |
The RT System itself - Status changed from 'new' to 'open' |
From @rurbanAttached patch fixes #40103 for blead. |
From @rurbanpl-#40103-File-Spec-case_tolerant.patch--- perl-5.9.5/lib/File/Spec/Cygwin.pm.orig 2006-11-23 03:13:19.000000000 +0000
+++ perl-5.9.5/lib/File/Spec/Cygwin.pm 2007-06-20 17:25:13.625000000 +0000
@@ -4,7 +4,7 @@
use vars qw(@ISA $VERSION);
require File::Spec::Unix;
-$VERSION = '1.1';
+$VERSION = '1.2';
@ISA = qw(File::Spec::Unix);
@@ -97,6 +97,15 @@
$tmpdir = $_[0]->_tmpdir( $ENV{TMPDIR}, "/tmp", 'C:/temp' );
}
+=item case_tolerant
+
+Override Unix. Cygwin is always case-tolerant, indicating that it is not
+significant when comparing file specifications.
+
+=cut
+
+sub case_tolerant () { 1 }
+
=back
=head1 COPYRIGHT
|
From @rurbanOn Wed Jun 20 10:27:50 2007, rurban wrote:
Oops, forgot the test. -- |
From @rurbanpl-#40103-File-Spec-case_tolerant.patch--- perl-5.9.5/lib/File/Spec/Cygwin.pm.orig 2006-11-23 03:13:19.000000000 +0000
+++ perl-5.9.5/lib/File/Spec/Cygwin.pm 2007-06-20 17:25:13.625000000 +0000
@@ -4,7 +4,7 @@
use vars qw(@ISA $VERSION);
require File::Spec::Unix;
-$VERSION = '1.1';
+$VERSION = '1.2';
@ISA = qw(File::Spec::Unix);
@@ -97,6 +97,15 @@
$tmpdir = $_[0]->_tmpdir( $ENV{TMPDIR}, "/tmp", 'C:/temp' );
}
+=item case_tolerant
+
+Override Unix. Cygwin is always case-tolerant, indicating that it is not
+significant when comparing file specifications.
+
+=cut
+
+sub case_tolerant () { 1 }
+
=back
=head1 COPYRIGHT
--- perl-5.9.5/lib/File/Spec/t/Spec.t.orig 2006-10-12 15:10:26.000000000 +0000
+++ perl-5.9.5/lib/File/Spec/t/Spec.t 2007-06-20 18:48:37.406250000 +0000
@@ -618,7 +618,7 @@
#[ "Epoc->canonpath('/a/.')", '/a' ],
#[ "Epoc->canonpath('/.')", '/' ],
-[ "Cygwin->case_tolerant()", '0' ],
+[ "Cygwin->case_tolerant()", '1' ],
[ "Cygwin->catdir('/','d2/d3')", '/d2/d3' ],
) ;
|
@rgs - Status changed from 'open' to 'resolved' |
From @rgsOn 20/06/07, Reini Urban via RT <perlbug-followup@perl.org> wrote:
Thanks, applied, bumping the version to 1.1_01. |
From @wb8tywReini Urban via RT wrote:
Isn't the case tolerant setting something that could be on the file Windows has the option of setting the file system to be case sensitive. On VMS it is a per-process setting, but only affects the ODS-5 file system. -John |
From @rurbanOn Thu Jun 21 01:39:59 2007, rafael wrote:
And this patch is for maint and bumps the version to 1.1_02 This also adds "Handle network path names beginning with double slash" -- |
From @rurbanpl-40103-File-Spec-case_tolerant_2.patchdifforig perl-5.8.8/lib/File/Spec
2007-07-08 Reini Urban <rurban@x-ray.at>
diff -ub perl-5.8.8/lib/File/Spec/Cygwin.pm.orig
--- perl-5.8.8/lib/File/Spec/Cygwin.pm.orig 2005-05-06 16:03:10.000000000 +0000
+++ perl-5.8.8/lib/File/Spec/Cygwin.pm 2007-07-08 11:35:13.227000000 +0000
@@ -4,7 +4,7 @@
use vars qw(@ISA $VERSION);
require File::Spec::Unix;
-$VERSION = '1.1';
+$VERSION = '1.1_02';
@ISA = qw(File::Spec::Unix);
@@ -40,7 +40,25 @@
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 =~ s@^(//[^/]+)(?:/|\z)@/@s ) {
+ $node = $1;
+ }
+ return $node . $self->SUPER::canonpath($path);
+}
+
+sub catdir {
+ my $self = shift;
+
+ # Don't create something that looks like a //network/path
+ if ($_[0] and ($_[0] eq '/' or $_[0] eq '\\')) {
+ shift;
+ return $self->SUPER::catdir('', @_);
+ }
+
+ $self->SUPER::catdir(@_);
}
=pod
@@ -66,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
@@ -76,9 +96,18 @@
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 is always case-tolerant, indicating that it is not
+significant when comparing file specifications.
+
+=cut
+
+sub case_tolerant () { 1 }
+
=back
=head1 COPYRIGHT
diff -ub perl-5.8.8/lib/File/Spec/t/Spec.t.orig
--- perl-5.8.8/lib/File/Spec/t/Spec.t.orig 2005-08-27 17:26:19.000000000 +0000
+++ perl-5.8.8/lib/File/Spec/t/Spec.t 2007-07-08 12:12:06.242625000 +0000
@@ -595,7 +595,7 @@
#[ "Epoc->canonpath('/a/.')", '/a' ],
#[ "Epoc->canonpath('/.')", '/' ],
-[ "Cygwin->case_tolerant()", '0' ],
+[ "Cygwin->case_tolerant()", '1' ],
) ;
|
From @rurbanOn Thu Jun 21 19:52:13 2007, malmberg wrote:
This is true, but rarely used and impossible to check (yet). For the managed mount I have to extend the Cygwin API for something like |
Migrated from rt.perl.org#40103 (status was 'resolved')
Searchable as RT40103$
The text was updated successfully, but these errors were encountered: