auto_include_deps requires me to use build_requires. This means I have to know which Module::Install extensions my Makefile.PL uses. This breaks the philosophy of Module::Install. Instead, I'm doing this:
requires ( 'perl' => 5.00503 );
# For some reason, Module::Install doesn't detect dependent modules of
# extensions. :(
Include_Dependencies_Of_Extensions();
...
sub Include_Dependencies_Of_Extensions
{
# These don't have non-core dependencies (presumably)
my @module_install_modules = qw(
Module::Install::AutoInstall Module::Install::Base Module::Install
+::Build
Module::Install::Bundle Module::Install::Can Module::Install::Fetc
+h
Module::Install::Include Module::Install::Inline Module::Install::
+InstallDirs
Module::Install::Makefile Module::Install::Makefile::Name
Module::Install::Makefile::Version Module::Install::MakeMaker
Module::Install::Metadata Module::Install::PAR Module::Install::Ru
+n
Module::Install::Scripts Module::Install::Skip Module::Install::Wi
+n32
Module::Install::WriteAll
);
foreach my $included_file (<inc/Module/Install/*.pm>,
<inc/Module/Install/PRIVATE/*.pm>,<inc/Module/Install/PRIVATE.*pm>
+)
{
my $module = $included_file;
$module =~ s#^inc/(.*)\.pm$#$1#;
$module =~ s#/#::#g;
next if grep { $_ eq $module } @module_install_modules;
print "--> Including dependent modules for non-standard Module::In
+stall extension $module\n";
include_deps($module);
}
}
Actually, now that I think about it, it might be better to just fix the bug and submit a patch. Until it's accepted, I can store the patched module in Module::Install::PRIVATE. (Although it would be nice if the author would confirm that it's a bug... sigh) | [reply] [d/l] |
I was cruising through the other modules in Module::Install, and I noticed "$self->include_deps('Foo')" in an extension. So, in every method in an Module::Install::Bar extension, call include_deps explicitly to tell Module::Install that the dependency must be in inc/ in order for that method to work.
Cool!
| [reply] |