Skip Menu |

This queue is for tickets about the DBI CPAN distribution.

Report information
The Basics
Id: 18452
Status: resolved
Priority: 0/
Queue: DBI

People
Owner: Nobody in particular
Requestors: dagolden [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Non-portable filename handling in dbd_postamble breaks DBD compilation for Win32
dbd_postamble hard-codes "/" into the filenames added to the Makefile. This breaks the Makefile on Win32. The attached patch for DBI::DBD uses File::Spec to ensure portable filename treatment. It removes some special VMS substitutions as this should no longer be needed. (Note -- VMS changes not tested, but File::Spec should be equivalent.) The patch was tested with DBI-1.50 on Perl 5.8.8 for Win32 to compile DBD-SQLite-1.11.
Subject: DBD.pm-portable-postamble.patch
--- DBD.pm.orig Thu Mar 30 09:25:39 2006 +++ DBD.pm Thu Mar 30 09:45:04 2006 @@ -2712,6 +2712,7 @@ use Config qw(%Config); use Carp; use Cwd; +use File::Spec; use strict; use vars qw( @ISA @EXPORT @@ -2860,21 +2861,15 @@ Carp::croak("Unable to locate Driver.xst in @try") unless @xst; Carp::carp( "Multiple copies of Driver.xst found in: @xst") if @xst > 1; print "Using DBI $DBI::VERSION (for perl $] on $Config{archname}) installed in $xst[0]\n"; - return $xst[0]; + return File::Spec->canonpath($xst[0]); } sub dbd_postamble { my $self = shift; _inst_checks(); my $dbi_instarch_dir = ($is_dbi) ? "." : dbd_dbi_arch_dir(); - my $dbi_driver_xst= '$(DBI_INSTARCH_DIR)/Driver.xst'; - my $xstf_h = '$(DBI_INSTARCH_DIR)/Driver_xst.h'; - if ($^O eq 'VMS') { - $dbi_instarch_dir = vmsify($dbi_instarch_dir.'/'); - $dbi_instarch_dir =~ s:/$::; # for buggy old vmsify's? - $dbi_driver_xst= '$(DBI_INSTARCH_DIR)Driver.xst'; - $xstf_h = '$(DBI_INSTARCH_DIR)Driver_xst.h'; - } + my $dbi_driver_xst= File::Spec->catfile($dbi_instarch_dir, 'Driver.xst'); + my $xstf_h = File::Spec->catfile($dbi_instarch_dir, 'Driver_xst.h'); # we must be careful of quotes, expecially for Win32 here. return '
Applied. Thanks.