Author: stevehay Date: Fri Jul 21 09:12:50 2023 New Revision: 1911161 URL: http://svn.apache.org/viewvc?rev=1911161&view=rev Log: Fix unnecessary FAIL reports on CPAN Testers by checking for mod_perl or mod_perl2
Fix by Andreas Koenig <a...@cpan.org> on CPAN RT#34316 Modified: perl/Apache-Reload/trunk/Makefile.PL Modified: perl/Apache-Reload/trunk/Makefile.PL URL: http://svn.apache.org/viewvc/perl/Apache-Reload/trunk/Makefile.PL?rev=1911161&r1=1911160&r2=1911161&view=diff ============================================================================== --- perl/Apache-Reload/trunk/Makefile.PL (original) +++ perl/Apache-Reload/trunk/Makefile.PL Fri Jul 21 09:12:50 2023 @@ -122,13 +122,14 @@ sub satisfy_mp_generation { unless ($wanted == 1 || $wanted == 2) { die "don't know anything about mod_perl generation: $wanted\n" . - "currently supporting only generations 1 and 2"; + "currently supporting only generations 1 and 2.\n" . + "Please specify MOD_PERL=1 or MOD_PERL=2 on the commandline\n"; } my $selected = 0; if ($wanted == 1) { - require_mod_perl(); + require_mod_perl(1); if ($mod_perl::VERSION >= 1.99) { # so we don't pick 2.0 version if 1.0 is wanted die "You don't seem to have mod_perl 1.0 installed"; @@ -137,7 +138,7 @@ sub satisfy_mp_generation { } elsif ($wanted == 2) { #warn "Looking for mod_perl 2.0"; - require_mod_perl(); + require_mod_perl(2); if ($mod_perl::VERSION < 2.0) { die "You don't seem to have mod_perl 2.0 installed"; } @@ -153,8 +154,25 @@ sub satisfy_mp_generation { } sub require_mod_perl { - eval { require mod_perl }; - eval { require mod_perl2 } if ($@); + my($rversion) = @_; + if (!$rversion || $rversion==1){ + eval { require mod_perl }; + if ($rversion == 1){ + if ($@){ + warn "Note: Did not find mod_perl installed\n"; + } + return; # do not die, let PREREQ_PM handle it + } + } + if ($@ || !$rversion || $rversion==2){ + eval { require mod_perl2 }; + if ($rversion == 2){ + if ($@){ + warn "Note: Did not find mod_perl2 installed\n"; + } + return; # do not die, let PREREQ_PM handle it + } + } die "Can't find mod_perl installed\nThe error was: $@" if $@; }