2
package Module::Install::AutoInstall;
5
use Module::Install::Base ();
7
use vars qw{$VERSION @ISA $ISCORE};
10
@ISA = 'Module::Install::Base';
14
sub AutoInstall { $_[0] }
18
$self->auto_install_now(@_);
23
$self->auto_install(@_);
28
return if $self->{done}++;
30
# Flatten array of arrays into a single array
31
my @core = map @$_, map @$_, grep ref,
32
$self->build_requires, $self->requires;
36
# We'll need Module::AutoInstall
37
$self->include('Module::AutoInstall');
38
require Module::AutoInstall;
40
my @features_require = Module::AutoInstall->import(
41
(@config ? (-config => \@config) : ()),
42
(@core ? (-core => \@core) : ()),
47
my @requires = map @$_, map @$_, grep ref, $self->requires;
48
while (my ($mod, $ver) = splice(@requires, 0, 2)) {
51
my @build_requires = map @$_, map @$_, grep ref, $self->build_requires;
52
while (my ($mod, $ver) = splice(@build_requires, 0, 2)) {
55
my @configure_requires = map @$_, map @$_, grep ref, $self->configure_requires;
56
while (my ($mod, $ver) = splice(@configure_requires, 0, 2)) {
61
while (my ($mod, $ver) = splice(@features_require, 0, 2)) {
62
push @deduped, $mod => $ver unless $seen{$mod}{$ver}++;
65
$self->requires(@deduped);
67
$self->makemaker_args( Module::AutoInstall::_make_args() );
69
my $class = ref($self);
71
"# --- $class section:\n" .
72
Module::AutoInstall::postamble()
76
sub auto_install_now {
78
$self->auto_install(@_);
79
Module::AutoInstall::do_install();