From 81ee8cbe1e8f44b803470bdeb7cae21224e80d9e Mon Sep 17 00:00:00 2001 From: Kenichi Ishigaki Date: Fri, 1 May 2009 00:50:22 +0000 Subject: [PATCH] DBD-SQLite: reverted cygwin hacks --- Makefile.PL | 3 --- lib/DBD/SQLite.pm | 10 +--------- t/33_non_latin_path.t | 18 ++++++------------ 3 files changed, 7 insertions(+), 24 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index 8a5be1c..b60d6f0 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -212,9 +212,6 @@ WriteMakefile( ( WINLIKE ? ( 'Win32' => '0.30', ) : () ), - ( ($^O eq 'cygwin' && $] < 5.010) ? ( - 'Filesys::CygwinPaths' => '0', - ) : () ), }, OPTIONAL( '6.48', MIN_PERL_VERSION => '5.006', diff --git a/lib/DBD/SQLite.pm b/lib/DBD/SQLite.pm index c03a699..3079093 100644 --- a/lib/DBD/SQLite.pm +++ b/lib/DBD/SQLite.pm @@ -65,7 +65,7 @@ sub connect { # To avoid unicode and long file name problems on Windows, # convert to the shortname if the file (or parent directory) exists. - if ( $^O =~ /MSWin32|cygwin/ and $real ne ':memory:' ) { + if ( $^O =~ /MSWin32/ and $real ne ':memory:' ) { require Win32; require File::Basename; my ($file, $dir, $suffix) = File::Basename::fileparse($real); @@ -81,14 +81,6 @@ sub connect { # SQLite can't do mkpath anyway. # So let it go through as it and fail. } - if ( $^O eq 'cygwin' ) { - if ( $] >= 5.010 ) { - $real = Cygwin::win_to_posix_path($real, 'absolute'); - } else { - require Filesys::CygwinPaths; - $real = Filesys::CygwinPaths::fullposixpath($real); - } - } } # Hand off to the actual login function diff --git a/t/33_non_latin_path.t b/t/33_non_latin_path.t index 7e371fd..d7af9f4 100644 --- a/t/33_non_latin_path.t +++ b/t/33_non_latin_path.t @@ -13,7 +13,7 @@ use t::lib::Test; use Test::More; BEGIN { if ( $] >= 5.008005 ) { - plan( tests => 25 ); + plan( tests => (($^O eq 'cygwin') ? 13 : 25) ); } else { plan( skip_all => 'Unicode is not supported before 5.8.5' ); } @@ -30,6 +30,9 @@ die $@ if $@; my $dir = File::Temp::tempdir( CLEANUP => 1 ); foreach my $subdir ( 'longascii', 'adatbázis', 'name with spaces', '¿¿¿ ¿¿¿¿¿¿') { + if ($^O eq 'cygwin') { + next if (($subdir eq 'adatbázis') || ($subdir eq '¿¿¿ ¿¿¿¿¿¿')); + } utf8::upgrade($subdir); ok( mkdir(catdir($dir, $subdir)), @@ -75,7 +78,7 @@ foreach my $subdir ( 'longascii', 'adatb sub _path { # copied from DBD::SQLite::connect my $path = shift; - if ($^O =~ /MSWin32|cygwin/) { + if ($^O =~ /MSWin32/) { require Win32; require File::Basename; @@ -87,15 +90,6 @@ sub _path { # copied from DBD::SQLite::connect } elsif ( -d $dir ) { $path = join '', grep { defined } Win32::GetShortPathName($dir), $file, $suffix; } - if ($^O eq 'cygwin') { - if ($] >= 5.010) { - $path = Cygwin::win_to_posix_path($path, 'absolute'); - } - else { - require Filesys::CygwinPaths; - $path = Filesys::CygwinPaths::fullposixpath($path); - } - } } return $path; -} \ No newline at end of file +}