Permalink
Browse files

Add visible warnings for missing bootstrap prereqs

Because certain bootstrap prereqs are satisfied out of inc/,
Module::Build will not report them as missing.  This confuses
users who are manually building Module::Build and lack these
prerequisites.

This commit ensures that Build.PL warns the user when they also
need to install prerequisites that were bootstrapped in inc/
  • Loading branch information...
1 parent b9fa3ec commit fd419683d1f967a3a5966c859dce3f1700a7e349 @xdg xdg committed Jan 25, 2011
Showing with 13 additions and 0 deletions.
  1. +13 −0 Build.PL
View
@@ -9,21 +9,34 @@ use lib File::Spec->catdir('lib'); # use our self to install
use lib File::Spec->catdir('t', 'bundled'); # use bundled modules
use lib File::Spec->catdir('t', 'lib'); # our utilities
+my @exit_warn;
+END {
+ warn "\nThese additional prerequisites must be installed:\n requires:\n"
+ if @exit_warn;
+ for my $h ( @exit_warn ) {
+ my ($mod, $min) = @$h;
+ warn " ! $mod (we need version $min)\n";
+ }
+}
+
# System installed configuration prereqs should take precedence
BEGIN {
if ( ! eval "use Perl::OSType 1 (); 1" ) {
+ push @exit_warn, [ 'Perl::OSType', '1.00' ];
delete $INC{'Perl/OSType.pm'};
eval "require inc::Perl::OSType; 1"
and $INC{'Perl/OSType.pm'} = {'inc/Perl/OSType.pm'};
die $@ if $@;
}
if ( ! eval "use version 0.87 (); 1" ) {
+ push @exit_warn, [ 'version', '0.87' ];
delete $INC{'version.pm'};
eval "require inc::MBVersion; 1"
and $INC{'version.pm'} = {'inc/MBVersion.pm'};
die $@ if $@;
}
if ( ! eval "use Module::Metadata 1.000002 (); 1" ) {
+ push @exit_warn, [ 'Module::Metadata', '1.000002' ];
delete $INC{'Module/Metadata.pm'};
eval "require inc::Module::Metadata; 1"
and $INC{'Module/Metadata.pm'} = {'inc/Module/Metadata.pm'};

0 comments on commit fd41968

Please sign in to comment.