Steffen Mueller wrote:
I would suggest putting a debug statement into _add_info to see what
happens to DBI.*.
Putting some debug into add_deps() was more revealing. With the attached
"debug" patch applied, the output from "scandeps -V
C:\perl5\site\lib\DBI.pm" begins like this:
$rv->{Carp.pm} DOES NOT EXIST
$rv->{DynaLoader.pm} DOES NOT EXIST
ADDING INFO FOR C:/perl5/lib/auto/DynaLoader/autosplit.ix
ADDING INFO FOR C:/perl5/lib/auto/DynaLoader/dl_expandspec.al
ADDING INFO FOR C:/perl5/lib/auto/DynaLoader/dl_findfile.al
ADDING INFO FOR C:/perl5/lib/auto/DynaLoader/dl_find_symbol_anywhere.al
$rv->{Exporter.pm} DOES NOT EXIST
$rv->{DBI/PurePerl.pm} DOES NOT EXIST
$rv->{Exporter.pm} EXISTS--WON'T LOOK IN auto/ !
$rv->{strict.pm} DOES NOT EXIST
$rv->{strict.pm} EXISTS--WON'T LOOK IN auto/ !
$rv->{DBI.pm} EXISTS--WON'T LOOK IN auto/ !
You can see that it's decided not to look into auto/DBI because DBI.pm
already has an entry in some hash. It appears that the hash entry in
question got put there by the "foreach my $input_file (@{$args{files}})
{ ... }" loop in scan_deps(). If I move that loop after the
scan_deps_static() call, which is where add_deps() gets called from, (as
per the attached "fix" patch) then the output now begins:
$rv->{Carp.pm} DOES NOT EXIST
$rv->{DynaLoader.pm} DOES NOT EXIST
ADDING INFO FOR C:/perl5/lib/auto/DynaLoader/autosplit.ix
ADDING INFO FOR C:/perl5/lib/auto/DynaLoader/dl_expandspec.al
ADDING INFO FOR C:/perl5/lib/auto/DynaLoader/dl_findfile.al
ADDING INFO FOR C:/perl5/lib/auto/DynaLoader/dl_find_symbol_anywhere.al
$rv->{Exporter.pm} DOES NOT EXIST
$rv->{DBI/PurePerl.pm} DOES NOT EXIST
$rv->{Exporter.pm} EXISTS--WON'T LOOK IN auto/ !
$rv->{strict.pm} DOES NOT EXIST
$rv->{strict.pm} EXISTS--WON'T LOOK IN auto/ !
$rv->{DBI.pm} DOES NOT EXIST
ADDING INFO FOR C:/perl5/site/lib/auto/DBI/dbd_xsh.h
ADDING INFO FOR C:/perl5/site/lib/auto/DBI/DBI.bs
ADDING INFO FOR C:/perl5/site/lib/auto/DBI/DBI.dll
ADDING INFO FOR C:/perl5/site/lib/auto/DBI/DBI.exp
ADDING INFO FOR C:/perl5/site/lib/auto/DBI/DBI.ilk
ADDING INFO FOR C:/perl5/site/lib/auto/DBI/DBI.pdb
ADDING INFO FOR C:/perl5/site/lib/auto/DBI/dbipport.h
ADDING INFO FOR C:/perl5/site/lib/auto/DBI/dbivport.h
ADDING INFO FOR C:/perl5/site/lib/auto/DBI/DBIXS.h
ADDING INFO FOR C:/perl5/site/lib/auto/DBI/dbixs_rev.h
ADDING INFO FOR C:/perl5/site/lib/auto/DBI/dbi_sql.h
ADDING INFO FOR C:/perl5/site/lib/auto/DBI/Driver.xst
ADDING INFO FOR C:/perl5/site/lib/auto/DBI/Driver_xst.h
and the bug appears to be fixed: DBI.dll gets included in the output.
Note that the foreach-loop in question is precisely the new part of
ScanDeps.pm that I originally said was what breaks 0.75 for me. It looks
like that loop should have been added after the scan_deps_static() call
rather than before it.
--
--- ScanDeps.pm.orig 2007-06-24 18:15:48.000000000 +0100
+++ ScanDeps.pm 2007-07-18 12:48:10.589473100 +0100
@@ -484,6 +484,8 @@
$args{keys} = [map {path_to_inc_name($_, $args{warn_missing})}
@{$args{files}}]
}
+ scan_deps_static(\%args);
+
my ($type, $path);
foreach my $input_file (@{$args{files}}) {
$type = 'module';
@@ -492,8 +494,6 @@
_add_info($args{rv}, path_to_inc_name($path, $args{warn_missing}),
$path, undef, $type);
}
- scan_deps_static(\%args);
-
if ($args{execute} or $args{compile}) {
scan_deps_runtime(
rv => $args{rv},
@@ -805,9 +805,13 @@
or _warn_of_missing_module($module, $args{warn_missing}), next;
if (exists $rv->{$module}) {
+ print STDERR "\$rv->{$module} EXISTS--WON'T LOOK IN auto/ !\n";
_add_info($rv, $module, $file, $used_by, undef);
next;
}
+ else {
+ print STDERR "\$rv->{$module} DOES NOT EXIST\n";
+ }
my $type = 'module';
$type = 'data' unless $file =~ /\.p[mh]$/i;
@@ -825,6 +829,7 @@
$type = 'autoload' if $ext eq '.ix' or $ext eq '.al';
$type ||= 'data';
+ print STDERR "ADDING INFO FOR $_->{file}\n";
_add_info($rv, "auto/$path/$_->{name}", $_->{file}, $module,
$type);
}
--- ScanDeps.pm.orig 2007-06-24 18:15:48.000000000 +0100
+++ ScanDeps.pm 2007-07-18 12:48:02.417431100 +0100
@@ -805,9 +805,13 @@
or _warn_of_missing_module($module, $args{warn_missing}), next;
if (exists $rv->{$module}) {
+ print STDERR "\$rv->{$module} EXISTS--WON'T LOOK IN auto/ !\n";
_add_info($rv, $module, $file, $used_by, undef);
next;
}
+ else {
+ print STDERR "\$rv->{$module} DOES NOT EXIST\n";
+ }
my $type = 'module';
$type = 'data' unless $file =~ /\.p[mh]$/i;
@@ -825,6 +829,7 @@
$type = 'autoload' if $ext eq '.ix' or $ext eq '.al';
$type ||= 'data';
+ print STDERR "ADDING INFO FOR $_->{file}\n";
_add_info($rv, "auto/$path/$_->{name}", $_->{file}, $module,
$type);
}