Incorrect search filter: invalid characters - *.p[ml]
AI-ExpertSystem-Advanced

 view release on metacpan or  search on metacpan

inc/Module/Install/Makefile.pm  view on Meta::CPAN

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
sub prompt {
        shift;
 
        # Infinite loop protection
        my @c = caller();
        if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
                die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
        }
 
        # In automated testing, always use defaults
        if ( $ENV{AUTOMATED_TESTING} and ! $ENV{PERL_MM_USE_DEFAULT} ) {
                local $ENV{PERL_MM_USE_DEFAULT} = 1;
                goto &ExtUtils::MakeMaker::prompt;
        } else {
                goto &ExtUtils::MakeMaker::prompt;
        }
}
 
sub makemaker_args {
        my $self = shift;

inc/Module/Install/Makefile.pm  view on Meta::CPAN

82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
        my $self = shift;
        my $libs = ref $_[0] ? shift : [ shift ];
        $self->makemaker_args( LIBS => $libs );
}
 
sub inc {
        my $self = shift;
        $self->makemaker_args( INC => shift );
}
 
my %test_dir = ();
 
sub _wanted_t {
        /\.t$/ and -f $_ and $test_dir{$File::Find::dir} = 1;
}
 
sub tests_recursive {
        my $self = shift;
        if ( $self->tests ) {
                die "tests_recursive will not work if tests are already defined";
        }
        my $dir = shift || 't';
        unless ( -d $dir ) {
                die "tests_recursive dir '$dir' does not exist";
        }
        %test_dir = ();
        require File::Find;
        File::Find::find( \&_wanted_t, $dir );
        $self->tests( join ' ', map { "$_/*.t" } sort keys %test_dir );
}
 
sub write {
        my $self = shift;
        die "&Makefile->write() takes no arguments\n" if @_;
 
        # Check the current Perl version
        my $perl_version = $self->perl_version;
        if ( $perl_version ) {
                eval "use $perl_version; 1"

inc/Module/Install/Makefile.pm  view on Meta::CPAN

138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
        $self->build_requires( 'ExtUtils::MakeMaker' => 6.42 );
        $self->configure_requires( 'ExtUtils::MakeMaker' => 6.42 );
}
 
# Generate the MakeMaker params
my $args = $self->makemaker_args;
$args->{DISTNAME} = $self->name;
$args->{NAME}     = $self->module_name || $self->name;
$args->{VERSION}  = $self->version;
$args->{NAME}     =~ s/-/::/g;
if ( $self->tests ) {
        $args->{test} = { TESTS => $self->tests };
}
if ( $] >= 5.005 ) {
        $args->{ABSTRACT} = $self->abstract;
        $args->{AUTHOR}   = $self->author;
}
if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) {
        $args->{NO_META} = 1;
}
if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 and $self->sign ) {
        $args->{SIGN} = 1;

inc/Module/Install/Makefile.pm  view on Meta::CPAN

216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
                . $self->preamble
        : '';
my $postamble = "# Postamble by $top_class $top_version\n"
        . ($self->postamble || '');
 
local *MAKEFILE;
open MAKEFILE, "< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
my $makefile = do { local $/; <MAKEFILE> };
close MAKEFILE or die $!;
 
$makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
$makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
$makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g;
$makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m;
$makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m;
 
# Module::Install will never be used to build the Core Perl
# Sometimes PERL_LIB and PERL_ARCHLIB get written anyway, which breaks
# PREFIX/PERL5LIB, and thus, install_share. Blank them if they exist
$makefile =~ s/^PERL_LIB = .+/PERL_LIB =/m;
#$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m;

inc/Module/Install/Metadata.pm  view on Meta::CPAN

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
        sign
};
 
my @scalar_keys = qw{
        name
        module_name
        abstract
        author
        version
        distribution_type
        tests
        installdirs
};
 
my @tuple_keys = qw{
        configure_requires
        build_requires
        requires
        recommends
        bundles
        resources

inc/Module/Install/Metadata.pm  view on Meta::CPAN

132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
                        die("Unsupported reserved lowercase resource '$name'");
                }
                $self->{values}->{resources} ||= [];
                push @{ $self->{values}->{resources} }, [ $name, $value ];
        }
        $self->{values}->{resources};
}
 
# Aliases for build_requires that will have alternative
# meanings in some future version of META.yml.
sub test_requires     { shift->build_requires(@_) }
sub install_requires  { shift->build_requires(@_) }
 
# Aliases for installdirs options
sub install_as_core   { $_[0]->installdirs('perl')   }
sub install_as_cpan   { $_[0]->installdirs('site')   }
sub install_as_site   { $_[0]->installdirs('site')   }
sub install_as_vendor { $_[0]->installdirs('vendor') }
 
sub dynamic_config {
        my $self = shift;

inc/Module/Install/Metadata.pm  view on Meta::CPAN

498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
        my $self     = shift;
        my $content  = Module::Install::_readperl($_[0]);
        my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg;
        while ( @requires ) {
                my $module  = shift @requires;
                my $version = shift @requires;
                $self->requires( $module => $version );
        }
}
 
sub test_requires_from {
        my $self     = shift;
        my $content  = Module::Install::_readperl($_[0]);
        my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg;
        while ( @requires ) {
                my $module  = shift @requires;
                my $version = shift @requires;
                $self->test_requires( $module => $version );
        }
}
 
# Convert triple-part versions (eg, 5.6.1 or 5.8.9) to
# numbers (eg, 5.006001 or 5.008009).
# Also, convert double-part versions (eg, 5.8)
sub _perl_version {
        my $v = $_[-1];
        $v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e;
        $v =~ s/^([1-9])\.([1-9]\d?\d?)\.(0|[1-9]\d?\d?)$/sprintf("%d.%03d%03d",$1,$2,$3 || 0)/e;



( run in 0.437 second using v1.01-cache-2.11-cpan-4e96b696675 )