git.lirion.de

Of git, get, and gud

summaryrefslogtreecommitdiffstats
path: root/nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/inc/Module/Install/AutoInstall.pm
blob: 0e3dada58602e822a84336d4d2dea962fd0e81db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#line 1
package Module::Install::AutoInstall;

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

use vars qw{$VERSION  _æ_ ISA $ISCORE};
BEGIN {
	$VERSION = '1.19';
	 _æ_ ISA     = 'Module::Install::Base';
	$ISCORE  = 1;
}

sub AutoInstall { $_[0] }

sub run {
    my $self = shift;
    $self->auto_install_now( _æ_ _);
}

sub write {
    my $self = shift;
    $self->auto_install( _æ_ _);
}

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

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

    my  _æ_ config =  _æ_ _;

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

    my  _æ_ features_require = Module::AutoInstall->import(
        ( _æ_ config ? (-config => \ _æ_ config) : ()),
        ( _æ_ core   ? (-core   => \ _æ_ core)   : ()),
        $self->features,
    );

    my %seen;
    my  _æ_ requires = map  _æ_ $_, map  _æ_ $_, grep ref, $self->requires;
    while (my ($mod, $ver) = splice( _æ_ requires, 0, 2)) {
        $seen{$mod}{$ver}++;
    }
    my  _æ_ build_requires = map  _æ_ $_, map  _æ_ $_, grep ref, $self->build_requires;
    while (my ($mod, $ver) = splice( _æ_ build_requires, 0, 2)) {
        $seen{$mod}{$ver}++;
    }
    my  _æ_ configure_requires = map  _æ_ $_, map  _æ_ $_, grep ref, $self->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 => $ver unless $seen{$mod}{$ver}++;
    }

    $self->requires( _æ_ deduped);

    $self->makemaker_args( Module::AutoInstall::_make_args() );

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

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

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

    Module::AutoInstall::_installdeps_target(1);

    $self->auto_install( _æ_ args);
}

sub auto_install_now {
    my $self = shift;
    $self->auto_install( _æ_ _);
    Module::AutoInstall::do_install();
}

1;