<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package Module::Install::AutoInstall;

use strict;
use Module::Install::Base ();

use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
	$VERSION = '1.06';
	@ISA     = 'Module::Install::Base';
	$ISCORE  = 1;
}

sub AutoInstall { $_[0] }

sub run {
    my $self = shift;
    $self-&gt;auto_install_now(@_);
}

sub write {
    my $self = shift;
    $self-&gt;auto_install(@_);
}

sub auto_install {
    my $self = shift;
    return if $self-&gt;{done}++;

    # Flatten array of arrays into a single array
    my @core = map @$_, map @$_, grep ref,
               $self-&gt;build_requires, $self-&gt;requires;

    my @config = @_;

    # We'll need Module::AutoInstall
    $self-&gt;include('Module::AutoInstall');
    require Module::AutoInstall;

    my @features_require = Module::AutoInstall-&gt;import(
        (@config ? (-config =&gt; \@config) : ()),
        (@core   ? (-core   =&gt; \@core)   : ()),
        $self-&gt;features,
    );

    my %seen;
    my @requires = map @$_, map @$_, grep ref, $self-&gt;requires;
    while (my ($mod, $ver) = splice(@requires, 0, 2)) {
        $seen{$mod}{$ver}++;
    }
    my @build_requires = map @$_, map @$_, grep ref, $self-&gt;build_requires;
    while (my ($mod, $ver) = splice(@build_requires, 0, 2)) {
        $seen{$mod}{$ver}++;
    }
    my @configure_requires = map @$_, map @$_, grep ref, $self-&gt;configure_requires;
    while (my ($mod, $ver) = splice(@configure_requires, 0, 2)) {
        $seen{$mod}{$ver}++;
    }

    my @deduped;
    while (my ($mod, $ver) = splice(@features_require, 0, 2)) {
        push @deduped, $mod =&gt; $ver unless $seen{$mod}{$ver}++;
    }

    $self-&gt;requires(@deduped);

    $self-&gt;makemaker_args( Module::AutoInstall::_make_args() );

    my $class = ref($self);
    $self-&gt;postamble(
        "# --- $class section:\n" .
        Module::AutoInstall::postamble()
    );
}

sub installdeps_target {
    my ($self, @args) = @_;

    $self-&gt;include('Module::AutoInstall');
    require Module::AutoInstall;

    Module::AutoInstall::_installdeps_target(1);

    $self-&gt;auto_install(@args);
}

sub auto_install_now {
    my $self = shift;
    $self-&gt;auto_install(@_);
    Module::AutoInstall::do_install();
}

1;
</pre></body></html>