Subject: | More diagnostics in find_header in Makefile.PL |
File::Find::find(...) dies if no directories are specified. This is the
case in find_headers in Makefile.PL, if no of the @try directories
could actually be find. The attached patch fixes this by skipping
the call of File::Find::find and falling through to a better error
message text.
This problem was also mentioned at
http://www.mail-archive.com/dbi-dev@perl.org/msg04390.html
Regards,
Slaven
Subject: | dbd-oracle-makefilepl.diff |
--- Makefile.PL.orig 2006-10-10 20:54:05.000000000 +0200
+++ Makefile.PL 2007-06-12 09:40:36.000000000 +0200
@@ -1413,14 +1413,15 @@ sub find_headers {
unshift @try, $::opt_h if $::opt_h;
@try = grep { -d $_ } @try;
- my %h_file;
- find( sub {
- return unless /^o(ci.{3,4}|ratypes)\.h$/i;
- my $dir = $File::Find::dir;
- $h_file{$_} ||= $dir; # record first one found
- print "Found $dir/$_\n" if $::opt_d;
- }, @try);
-
+ my %h_file;
+ if (@try) {
+ find( sub {
+ return unless /^o(ci.{3,4}|ratypes)\.h$/i;
+ my $dir = $File::Find::dir;
+ $h_file{$_} ||= $dir; # record first one found
+ print "Found $dir/$_\n" if $::opt_d;
+ }, @try);
+ }
my %h_dir = reverse %h_file; # distinct first found dirs
my @h_dir = keys %h_dir;