| 1 | 59 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 2 | package CPAN::Reporter::PrereqCheck; | ||||||||||||||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||||||||||||||
| 4 | 35 | our $VERSION = '1.2018'; | |||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||
| 6 | 47 | ▶ | use ExtUtils::MakeMaker 6.36; | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 7 | 47 | ▶ | use File::Spec; | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 8 | 47 | ▶ | use CPAN::Version; | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||
| 10 | 35 | ▶ | _run() if ! caller(); | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||
| 12 | sub _run { | ||||||||||||||||||||||||||||||||||||||||
| 13 | 14 | ▶ | my %saw_mod; | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
_run: called CC=30 SCAR=34.2
| |||||||||||||||||||||||||||||||||||||||||
| 14 | # read module and prereq string from STDIN | ||||||||||||||||||||||||||||||||||||||||
| 15 | # do this as early as possible: https://github.com/cpan-testers/CPAN-Reporter/issues/20 | ||||||||||||||||||||||||||||||||||||||||
| 16 | my @modules; | ||||||||||||||||||||||||||||||||||||||||
| 17 | 14 | ▶ | while ( <> ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 18 | 154 | push @modules, $_; | |||||||||||||||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||||||||||||||
| 20 | 14 | local *DEVNULL; | |||||||||||||||||||||||||||||||||||||||
| 21 | 14 | open DEVNULL, ">" . File::Spec->devnull; ## no critic | |||||||||||||||||||||||||||||||||||||||
| 22 | # ensure actually installed, not ./inc/... or ./t/..., etc. | ||||||||||||||||||||||||||||||||||||||||
| 23 | 14 | local @INC = grep { $_ ne '.' } @INC; | |||||||||||||||||||||||||||||||||||||||
| 24 | 14 | for (@modules) { | |||||||||||||||||||||||||||||||||||||||
| 25 | 154 | m/^(\S+)\s+([^\n]*)/; | |||||||||||||||||||||||||||||||||||||||
| 26 | 154 | my ($mod, $need) = ($1, $2); | |||||||||||||||||||||||||||||||||||||||
| 27 | 154 | ▶ | die "Couldn't read module for '$_'" unless $mod; | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 28 | 154 | ▶ | $need = 0 if not defined $need; | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||
| 30 | # only evaluate a module once | ||||||||||||||||||||||||||||||||||||||||
| 31 | 154 | ▶ | next if $saw_mod{$mod}++; | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||
| 33 | # get installed version from file with EU::MM | ||||||||||||||||||||||||||||||||||||||||
| 34 | 153 | my($have, $inst_file, $dir, @packpath); | |||||||||||||||||||||||||||||||||||||||
| 35 | 153 | ▶ | if ( $mod eq "perl" ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 36 | 5 | $have = $]; | |||||||||||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||||||||||
| 38 | else { | ||||||||||||||||||||||||||||||||||||||||
| 39 | 148 | @packpath = split( /::/, $mod ); | |||||||||||||||||||||||||||||||||||||||
| 40 | 148 | $packpath[-1] .= ".pm"; | |||||||||||||||||||||||||||||||||||||||
| 41 | 148 | ▶ | if (@packpath == 1 && $packpath[0] eq "readline.pm") { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
@packpath == 1 and $packpath[0] eq "readline.pm"
MC/DC0%0/2
@packpath == 1 and $packpath[0] eq "readline.pm"
@packpath == 1
$packpath[0] eq "readline.pm"
Truth table66%2/3
A and B
A= @packpath == 1B= $packpath[0] eq "readline.pm"
| |||||||||||||||||||||||||||||||||||||||||
| 42 | 0 | unshift @packpath, "Term", "ReadLine"; # historical reasons | |||||||||||||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||||||||||||
| 44 | INCDIR: | ||||||||||||||||||||||||||||||||||||||||
| 45 | 148 | foreach my $dir (@INC) { | |||||||||||||||||||||||||||||||||||||||
| 46 | 846 | my $pmfile = File::Spec->catfile($dir,@packpath); | |||||||||||||||||||||||||||||||||||||||
| 47 | 846 | ▶ | if (-f $pmfile){ | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 48 | 126 | $inst_file = $pmfile; | |||||||||||||||||||||||||||||||||||||||
| 49 | 126 | last INCDIR; | |||||||||||||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||
| 53 | # get version from file or else report missing | ||||||||||||||||||||||||||||||||||||||||
| 54 | 148 | ▶ | if ( defined $inst_file ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 55 | 126 | $have = my $preliminary_version = MM->parse_version($inst_file); | |||||||||||||||||||||||||||||||||||||||
| 56 | 126 | ▶ | $preliminary_version = "0" if ! defined $preliminary_version || $preliminary_version eq 'undef'; | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
not defined $preliminary_version or $preliminary_version eq "undef"
MC/DC50%1/2
not defined $preliminary_version or $preliminary_version eq "undef"
not defined $preliminary_version
$preliminary_version eq "undef"
Truth table66%2/3
not(A) or B
A= not defined $preliminary_versionB= $preliminary_version eq "undef"
| |||||||||||||||||||||||||||||||||||||||||
| 57 | # report broken if it can't be loaded | ||||||||||||||||||||||||||||||||||||||||
| 58 | # "select" to try to suppress spurious newlines | ||||||||||||||||||||||||||||||||||||||||
| 59 | 126 | select DEVNULL; ## no critic | |||||||||||||||||||||||||||||||||||||||
| 60 | 126 | ▶ | if ( ! _try_load( $mod, $preliminary_version ) ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 61 | 4 | select STDOUT; ## no critic | |||||||||||||||||||||||||||||||||||||||
| 62 | 4 | print "$mod 0 broken\n"; | |||||||||||||||||||||||||||||||||||||||
| 63 | 4 | next; | |||||||||||||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||||||||||||||
| 65 | # Now the module is loaded: if MM->parse_version previously failed to | ||||||||||||||||||||||||||||||||||||||||
| 66 | # get the version, then we can now look at the value of the $VERSION | ||||||||||||||||||||||||||||||||||||||||
| 67 | # variable. | ||||||||||||||||||||||||||||||||||||||||
| 68 | 122 | ▶ | if (! defined $have || $have eq 'undef') { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
not defined $have or $have eq "undef"
MC/DC50%1/2
not defined $have or $have eq "undef"
not defined $have
$have eq "undef"
Truth table66%2/3
not(A) or B
A= not defined $haveB= $have eq "undef"
| |||||||||||||||||||||||||||||||||||||||||
| 69 | 47 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 70 | 5 | my $mod_version = ${$mod.'::VERSION'}; | |||||||||||||||||||||||||||||||||||||||
| 71 | 5 | ▶ | if (defined $mod_version) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 72 | 1 | $have = $mod_version; | |||||||||||||||||||||||||||||||||||||||
| 73 | } else { | ||||||||||||||||||||||||||||||||||||||||
| 74 | 4 | $have = 0; # fallback | |||||||||||||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||||||||||||||
| 77 | 122 | select STDOUT; ## no critic | |||||||||||||||||||||||||||||||||||||||
| 78 | } | ||||||||||||||||||||||||||||||||||||||||
| 79 | else { | ||||||||||||||||||||||||||||||||||||||||
| 80 | 22 | print "$mod 0 n/a\n"; | |||||||||||||||||||||||||||||||||||||||
| 81 | 22 | next; | |||||||||||||||||||||||||||||||||||||||
| 82 | } | ||||||||||||||||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||
| 85 | # complex requirements are comma separated | ||||||||||||||||||||||||||||||||||||||||
| 86 | 127 | my ( @requirements ) = split /\s*,\s*/, $need; | |||||||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||||||||
| 88 | 127 | my $passes = 0; | |||||||||||||||||||||||||||||||||||||||
| 89 | RQ: | ||||||||||||||||||||||||||||||||||||||||
| 90 | 127 | for my $rq (@requirements) { | |||||||||||||||||||||||||||||||||||||||
| 91 | 139 | ▶ | if ($rq =~ s|>=\s*||) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 5 branches
| |||||||||||||||||||||||||||||||||||||||||
| 92 | # no-op -- just trimmed string | ||||||||||||||||||||||||||||||||||||||||
| 93 | } elsif ($rq =~ s|>\s*||) { | ||||||||||||||||||||||||||||||||||||||||
| 94 | 5 | ▶ | if (CPAN::Version->vgt($have,$rq)){ | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 95 | 0 | $passes++; | |||||||||||||||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||||||||||||||
| 97 | 5 | next RQ; | |||||||||||||||||||||||||||||||||||||||
| 98 | } elsif ($rq =~ s|!=\s*||) { | ||||||||||||||||||||||||||||||||||||||||
| 99 | 9 | ▶ | if (CPAN::Version->vcmp($have,$rq)) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 100 | 1 | $passes++; # didn't match | |||||||||||||||||||||||||||||||||||||||
| 101 | } | ||||||||||||||||||||||||||||||||||||||||
| 102 | 9 | next RQ; | |||||||||||||||||||||||||||||||||||||||
| 103 | } elsif ($rq =~ s|<=\s*||) { | ||||||||||||||||||||||||||||||||||||||||
| 104 | 5 | ▶ | if (! CPAN::Version->vgt($have,$rq)){ | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 105 | 5 | $passes++; | |||||||||||||||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||||||||||||||
| 107 | 5 | next RQ; | |||||||||||||||||||||||||||||||||||||||
| 108 | } elsif ($rq =~ s|<\s*||) { | ||||||||||||||||||||||||||||||||||||||||
| 109 | 9 | ▶ | if (CPAN::Version->vlt($have,$rq)){ | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 110 | 5 | $passes++; | |||||||||||||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||||||||||||||
| 112 | 9 | next RQ; | |||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||
| 114 | # if made it here, then it's a normal >= comparison | ||||||||||||||||||||||||||||||||||||||||
| 115 | 111 | ▶ | if (! CPAN::Version->vlt($have, $rq)){ | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 116 | 107 | $passes++; | |||||||||||||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||||||||||||||
| 119 | 127 | ▶ | my $ok = $passes == @requirements ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 120 | 127 | print "$mod $ok $have\n" | |||||||||||||||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||||||||||||||
| 122 | 14 | return; | |||||||||||||||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||||||||
| 125 | sub _try_load { | ||||||||||||||||||||||||||||||||||||||||
| 126 | 132 | ▶ | my ($module, $have) = @_; | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
_try_load: called CC=11 SCAR=24.0
| |||||||||||||||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||||||||||||||
| 128 | 132 | my @do_not_load = ( | |||||||||||||||||||||||||||||||||||||||
| 129 | # should not be loaded directly | ||||||||||||||||||||||||||||||||||||||||
| 130 | qw/Term::ReadLine::Perl Term::ReadLine::Gnu MooseX::HasDefaults Readonly::XS | ||||||||||||||||||||||||||||||||||||||||
| 131 | POE::Loop::Event SOAP::Constants | ||||||||||||||||||||||||||||||||||||||||
| 132 | Moose::Meta::TypeConstraint::Parameterizable Moose::Meta::TypeConstraint::Parameterized/, | ||||||||||||||||||||||||||||||||||||||||
| 133 | 'Devel::Trepan', #"require Enbugger; require Devel::Trepan;" starts debugging session | ||||||||||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||||||||||
| 135 | #removed modules | ||||||||||||||||||||||||||||||||||||||||
| 136 | qw/Pegex::Mo YAML::LibYAML/, | ||||||||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||||||||
| 138 | #have additional prereqs | ||||||||||||||||||||||||||||||||||||||||
| 139 | qw/Log::Dispatch::Email::MailSender RDF::NS::Trine Plack::Handler::FCGI Web::Scraper::LibXML/, | ||||||||||||||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||||||||||||||
| 141 | #modify @INC. 'lib' appearing in @INC will prevent correct | ||||||||||||||||||||||||||||||||||||||||
| 142 | #checking of modules with XS part, for ex. List::Util | ||||||||||||||||||||||||||||||||||||||||
| 143 | qw/ExtUtils::ParseXS ExtUtils::ParseXS::Utilities/, | ||||||||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||||||||
| 145 | #require special conditions to run | ||||||||||||||||||||||||||||||||||||||||
| 146 | qw/mylib/, | ||||||||||||||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||||||||||||||
| 148 | #do not return true value | ||||||||||||||||||||||||||||||||||||||||
| 149 | qw/perlsecret Alt::Crypt::RSA::BigInt/, | ||||||||||||||||||||||||||||||||||||||||
| 150 | ); | ||||||||||||||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||||||||||||||
| 152 | 132 | my %loading_conflicts = ( | |||||||||||||||||||||||||||||||||||||||
| 153 | 'signatures' => ['Catalyst'], | ||||||||||||||||||||||||||||||||||||||||
| 154 | 'Dancer::Plugin::FlashMessage' => ['Dancer::Plugin::FlashNote'], | ||||||||||||||||||||||||||||||||||||||||
| 155 | 'Dancer::Plugin::FlashNote' => ['Dancer::Plugin::FlashMessage'], | ||||||||||||||||||||||||||||||||||||||||
| 156 | 'Dancer::Plugin::Mongoose' => ['Dancer::Plugin::DBIC'], | ||||||||||||||||||||||||||||||||||||||||
| 157 | 'Dancer::Plugin::DBIC' => ['Dancer::Plugin::Mongoose'], | ||||||||||||||||||||||||||||||||||||||||
| 158 | 'Test::BDD::Cucumber::Loader' => ['Test::Exception', 'Test::MockObject'], #works in different order | ||||||||||||||||||||||||||||||||||||||||
| 159 | 'Test::Mock::LWP::UserAgent' => ['HTTP::Response'], | ||||||||||||||||||||||||||||||||||||||||
| 160 | 'Test::SharedFork' => ['threads'], #dies if $INC{'threads.pm'} | ||||||||||||||||||||||||||||||||||||||||
| 161 | 'Test::TCP' => ['threads'], #loads Test::SharedFork | ||||||||||||||||||||||||||||||||||||||||
| 162 | 'Test::Fake::HTTPD' => ['threads'], #loads Test::SharedFork | ||||||||||||||||||||||||||||||||||||||||
| 163 | #Note: Test::Perl::Critic and other modules load threads, so reordering will not help | ||||||||||||||||||||||||||||||||||||||||
| 164 | ); #modules that conflict with each other | ||||||||||||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||||||||||||
| 166 | 132 | my %load_before = ( | |||||||||||||||||||||||||||||||||||||||
| 167 | 'Tk::Font' => 'Tk', | ||||||||||||||||||||||||||||||||||||||||
| 168 | 'Tk::Widget' => 'Tk', | ||||||||||||||||||||||||||||||||||||||||
| 169 | 'Tk::Label' => 'Tk', | ||||||||||||||||||||||||||||||||||||||||
| 170 | 'Tk::Menubutton' => 'Tk', | ||||||||||||||||||||||||||||||||||||||||
| 171 | 'Tk::Entry' => 'Tk', | ||||||||||||||||||||||||||||||||||||||||
| 172 | 'Class::MOP::Class' => 'Class::MOP', | ||||||||||||||||||||||||||||||||||||||||
| 173 | 'Moose::Meta::TypeConstraint::Role' => 'Moose', | ||||||||||||||||||||||||||||||||||||||||
| 174 | 'Moose::Meta::TypeConstraint::Union' => 'Moose', | ||||||||||||||||||||||||||||||||||||||||
| 175 | 'Moose::Meta::Attribute::Native' => 'Class::MOP', | ||||||||||||||||||||||||||||||||||||||||
| 176 | 'Moose::Meta::Role::Attribute' => 'Class::MOP', | ||||||||||||||||||||||||||||||||||||||||
| 177 | 'Test::More::Hooks' => 'Test::More', | ||||||||||||||||||||||||||||||||||||||||
| 178 | 'Net::HTTP::Spore::Middleware::DefaultParams' => 'Net::HTTP::Spore::Meta::Method', | ||||||||||||||||||||||||||||||||||||||||
| 179 | 'Log::Log4perl::Filter' => 'Log::Log4perl', | ||||||||||||||||||||||||||||||||||||||||
| 180 | 'RDF::DOAP::Project' => 'RDF::Trine', #or other modules that use RDF::Trine will fail | ||||||||||||||||||||||||||||||||||||||||
| 181 | ); | ||||||||||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||||||||||
| 183 | # M::I < 0.95 dies in require, so we can't check if it loads | ||||||||||||||||||||||||||||||||||||||||
| 184 | # Instead we just pretend that it works | ||||||||||||||||||||||||||||||||||||||||
| 185 | 132 | ▶ | if ( $module eq 'Module::Install' && $have < 0.95 ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
Condition66%2/3
$module eq "Module::Install" and $have < "0.95"
MC/DC50%1/2
$module eq "Module::Install" and $have < "0.95"
$module eq "Module::Install"
$have < "0.95"
Truth table66%2/3
A and B
A= $module eq "Module::Install"B= $have < "0.95"
| |||||||||||||||||||||||||||||||||||||||||
| 186 | 1 | return 1; | |||||||||||||||||||||||||||||||||||||||
| 187 | } | ||||||||||||||||||||||||||||||||||||||||
| 188 | # circular dependency with Catalyst::Runtime, so this module | ||||||||||||||||||||||||||||||||||||||||
| 189 | # does not depends on it, but still does not work without it. | ||||||||||||||||||||||||||||||||||||||||
| 190 | ▶ | elsif ( $module eq 'Catalyst::DispatchType::Regex' && $have <= 5.90032 ) { | |||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$module eq "Catalyst::DispatchType::Regex" and $have <= "5.90032"
MC/DC50%1/2
$module eq "Catalyst::DispatchType::Regex" and $have <= "5.90032"
$module eq "Catalyst::DispatchType::Regex"
$have <= "5.90032"
Truth table66%2/3
A and B
A= $module eq "Catalyst::DispatchType::Regex"B= $have <= "5.90032"
| |||||||||||||||||||||||||||||||||||||||||
| 191 | 1 | return 1; | |||||||||||||||||||||||||||||||||||||||
| 192 | } | ||||||||||||||||||||||||||||||||||||||||
| 193 | 2600 | elsif ( grep { $_ eq $module } @do_not_load ) { | |||||||||||||||||||||||||||||||||||||||
| 194 | 6 | return 1; | |||||||||||||||||||||||||||||||||||||||
| 195 | } | ||||||||||||||||||||||||||||||||||||||||
| 196 | # loading Acme modules like Acme::Bleach can do bad things, | ||||||||||||||||||||||||||||||||||||||||
| 197 | # so never try to load them; just pretend that they work | ||||||||||||||||||||||||||||||||||||||||
| 198 | elsif( $module =~ /^Acme::/ ) { | ||||||||||||||||||||||||||||||||||||||||
| 199 | 1 | return 1; | |||||||||||||||||||||||||||||||||||||||
| 200 | } | ||||||||||||||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||||||||||||||
| 202 | 123 | ▶ | if ( exists $loading_conflicts{$module} ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 203 | 1 | foreach my $mod1 ( @{ $loading_conflicts{$module} } ) { | |||||||||||||||||||||||||||||||||||||||
| 204 | 1 | my $file = "$mod1.pm"; | |||||||||||||||||||||||||||||||||||||||
| 205 | 1 | $file =~ s{::}{/}g; | |||||||||||||||||||||||||||||||||||||||
| 206 | 1 | ▶ | if (exists $INC{$file}) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 207 | 1 | return 1; | |||||||||||||||||||||||||||||||||||||||
| 208 | } | ||||||||||||||||||||||||||||||||||||||||
| 209 | } | ||||||||||||||||||||||||||||||||||||||||
| 210 | } | ||||||||||||||||||||||||||||||||||||||||
| 211 | |||||||||||||||||||||||||||||||||||||||||
| 212 | 122 | ▶ | if (exists $load_before{$module}) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 213 | 1 | eval "require $load_before{$module};1;"; | |||||||||||||||||||||||||||||||||||||||
| 214 | } | ||||||||||||||||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||||||||||||||
| 216 | 122 | my $file = "$module.pm"; | |||||||||||||||||||||||||||||||||||||||
| 217 | 122 | $file =~ s{::}{/}g; | |||||||||||||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||||||||||||||
| 219 | 122 | return eval {require $file; 1}; ## no critic | |||||||||||||||||||||||||||||||||||||||
| 220 | } | ||||||||||||||||||||||||||||||||||||||||
| 221 | |||||||||||||||||||||||||||||||||||||||||
| 222 | 35 | 1; | |||||||||||||||||||||||||||||||||||||||
| 223 | |||||||||||||||||||||||||||||||||||||||||
| 224 | # ABSTRACT: Modulino for prerequisite tests | ||||||||||||||||||||||||||||||||||||||||
| 225 | |||||||||||||||||||||||||||||||||||||||||
| 226 | __END__ | ||||||||||||||||||||||||||||||||||||||||