CPAN-Reporter
view release on metacpan or search on metacpan
lib/CPAN/Reporter/PrereqCheck.pm view on Meta::CPAN
}
next RQ;
} elsif ($rq =~ s|!=\s*||) {
if (CPAN::Version->vcmp($have,$rq)) {
$passes++; # didn't match
}
next RQ;
} elsif ($rq =~ s|<=\s*||) {
if (! CPAN::Version->vgt($have,$rq)){
$passes++;
}
next RQ;
} elsif ($rq =~ s|<\s*||) {
if (CPAN::Version->vlt($have,$rq)){
$passes++;
}
next RQ;
}
# if made it here, then it's a normal >= comparison
if (! CPAN::Version->vlt($have, $rq)){
$passes++;
}
}
my $ok = $passes == @requirements ? 1 : 0;
print "$mod $ok $have\n"
}
return;
}
sub _try_load {
my ($module, $have) = @_;
my @do_not_load = (
# should not be loaded directly
qw/Term::ReadLine::Perl Term::ReadLine::Gnu MooseX::HasDefaults Readonly::XS
POE::Loop::Event SOAP::Constants
Moose::Meta::TypeConstraint::Parameterizable Moose::Meta::TypeConstraint::Parameterized/,
'Devel::Trepan', #"require Enbugger; require Devel::Trepan;" starts debugging session
'Test::BDD::Cucumber::Loader', #by doing something to Test::Builder breaks Test::SharedFork and any module that uses it
#removed modules, they still exist but die
qw/Pegex::Mo YAML::LibYAML Params::CheckCompiler/,
#have additional prereqs
qw/Log::Dispatch::Email::MailSender RDF::NS::Trine Plack::Handler::FCGI Web::Scraper::LibXML
DBIx::Class::EncodedColumn::Crypt::Eksblowfish::Bcrypt/,
#modify @INC. 'lib' appearing in @INC will prevent correct
#checking of modules with XS part, for ex. List::Util
qw/ExtUtils::ParseXS ExtUtils::ParseXS::Utilities/,
#require special conditions to run
qw/mylib Test::YAML Cache::Reddit Dist::Zilla::Plugin::TestMLIncluder/,
#print text to STDOUT which C::R::PC cannot intercept
qw/Test::Sys::Info Test::Subs/,
#do not return true value
qw/perlsecret Alt::Crypt::RSA::BigInt/,
#Try::Tiny::Tiny and modules that use it conflict with several modules
'Try::Tiny::Tiny',
'Date::Lectionary::Time',
);
my %loading_conflicts = (
'signatures' => ['Catalyst'],
'Dancer::Plugin::FlashMessage' => ['Dancer::Plugin::FlashNote'],
'Dancer::Plugin::FlashNote' => ['Dancer::Plugin::FlashMessage'],
'Dancer::Plugin::Mongoose' => ['Dancer::Plugin::DBIC'],
'Dancer::Plugin::DBIC' => ['Dancer::Plugin::Mongoose'],
'Test::Mock::LWP::UserAgent' => ['HTTP::Response'],
'Test::BDD::Cucumber::Loader' => ['Test::Exception', 'Test::MockObject', 'Test::SharedFork'], #works in different order
'Test::SharedFork' => ['threads'], #dies if $INC{'threads.pm'}
'Test::TCP' => ['threads'], #loads Test::SharedFork
'Test::Fake::HTTPD' => ['threads'], #loads Test::SharedFork
'Plack::Test::Suite' => ['threads'], #loads Test::SharedFork
#Note: Test::Perl::Critic and other modules load threads, so reordering will not help
'App::Sqitch' => ['Moose'], #has "no Moo::sification"
); #modules that conflict with each other
my %load_before = (
'Tk::Font' => 'Tk',
'Tk::Widget' => 'Tk',
'Tk::Label' => 'Tk',
'Tk::Menubutton' => 'Tk',
'Tk::Entry' => 'Tk',
'Class::MOP::Class' => 'Class::MOP',
'Moose::Meta::TypeConstraint::Role' => 'Moose',
'Moose::Meta::TypeConstraint::Union' => 'Moose',
'Moose::Meta::Attribute::Native' => 'Class::MOP',
'Moose::Meta::Role::Attribute' => 'Class::MOP',
'Moose::Util::TypeConstraints' => 'Moose',
'Test::More::Hooks' => 'Test::More',
'Net::HTTP::Spore::Middleware::DefaultParams' => 'Net::HTTP::Spore::Meta::Method',
'Log::Log4perl::Filter' => 'Log::Log4perl',
'RDF::DOAP::Project' => 'RDF::Trine', #or other modules that use RDF::Trine will fail
'Win32::API::Type' => 'Win32::API',
'Dancer2::Plugin::DBIC' => 'Dancer2', #or later Strehler::API will fail
'Wx::AUI' => 'Wx',
'Dist::Zilla::Role::Tempdir' => 'Dist::Zilla', # or it would not be possible to check Dist::Zilla
'Pod::Perldoc::ToMan' => 'Pod::Perldoc',
);
# M::I < 0.95 dies in require, so we can't check if it loads
# Instead we just pretend that it works
if ( $module eq 'Module::Install' && $have < 0.95 ) {
return 1;
}
# circular dependency with Catalyst::Runtime, so this module
# does not depends on it, but still does not work without it.
elsif ( $module eq 'Catalyst::DispatchType::Regex' && $have <= 5.90032 ) {
return 1;
}
elsif ( grep { $_ eq $module } @do_not_load ) {
return 1;
}
# loading Acme modules like Acme::Bleach can do bad things,
# so never try to load them; just pretend that they work
elsif( $module =~ /^Acme::/ ) {
return 1;
}
( run in 0.991 second using v1.01-cache-2.11-cpan-39bf76dae61 )