Author: dagolden
Date: Wed Jul  1 09:13:52 2009
New Revision: 12987

Modified:
   Module-Build/trunk/Changes
   Module-Build/trunk/lib/Module/Build/Base.pm

Log:
PL_files check in script_files fixed for case-tolerant systems

Modified: Module-Build/trunk/Changes
==============================================================================
--- Module-Build/trunk/Changes  (original)
+++ Module-Build/trunk/Changes  Wed Jul  1 09:13:52 2009
@@ -1,11 +1,14 @@
 Revision history for Perl extension Module::Build.
 
-0.33_06 - 
+0.33_06 -
 
  Bug-fixes:
  - Bundled version code will use pure Perl on 5.10.0 to work around
    a corner case involving eval and locale [John Peacock]
  - Reversed VMS patch from 0.33_03 [Craig Berry]
+ - PL_files in Build.PL that are in the bin/scripts directory should not be
+   installed as if they are scripts (fixed for case-tolerant systems). 
+   [David Golden, reported by Craig Berry]
 
 0.33_05 - Sun Jun 28 22:06:49 EDT 2009
 

Modified: Module-Build/trunk/lib/Module/Build/Base.pm
==============================================================================
--- Module-Build/trunk/lib/Module/Build/Base.pm (original)
+++ Module-Build/trunk/lib/Module/Build/Base.pm Wed Jul  1 09:13:52 2009
@@ -3500,24 +3500,32 @@
 
 sub script_files {
   my $self = shift;
-  
+
   for ($self->{properties}{script_files}) {
     $_ = shift if @_;
     next unless $_;
-    
+
     # Always coerce into a hash
     return $_ if UNIVERSAL::isa($_, 'HASH');
     return $_ = { map {$_,1} @$_ } if UNIVERSAL::isa($_, 'ARRAY');
-    
+
     die "'script_files' must be a hashref, arrayref, or string" if ref();
-    
+
     return $_ = { map {$_,1} $self->_files_in( $_ ) } if -d $_;
     return $_ = {$_ => 1};
   }
-  
-  my %pl_files = map { File::Spec->canonpath($_) => 1 }
-                 keys %{ $self->PL_files || {} };
-  return $_ = { map {$_ => 1} grep !$pl_files{$_}, $self->_files_in('bin') };
+
+  my %pl_files = map {
+    File::Spec->canonpath( File::Spec->case_tolerant ? uc $_ : $_ ) => 1 
+  } keys %{ $self->PL_files || {} };
+
+  my @bin_files = $self->_files_in('bin');
+
+  my %bin_map = map {
+    $_ => File::Spec->canonpath( File::Spec->case_tolerant ? uc $_ : $_ ) 
+  } @bin_files;
+
+  return $_ = { map {$_ => 1} grep !$pl_files{$bin_map{$_}}, @bin_files };
 }
 BEGIN { *scripts = \&script_files; }
 

Reply via email to