Skip to content

Commit

Permalink
fix M::B::Compat dying on dotted-decimal requires->perl
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.perl.org/modules/Module-Build/trunk@13742 50811bd7-b8ce-0310-adc1-d9db26280581
  • Loading branch information
xdg committed Jan 19, 2010
1 parent 16fda3a commit 6f40817
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Changes
Expand Up @@ -2,6 +2,14 @@ Revision history for Perl extension Module::Build.

0.3603 -

Bug fixes:

- Module::Build::Compat would croak on distibutions that set requires
'perl' to a dotted decimal like '5.6.2'. We now skip that key
since it doesn't go into PREREQ_PM and we numify it properly for
'use 5.006002' in the generated Makefile.PL (RT#53409)
[David Golden, adapted from patch by G. Allen Morris III]

0.3602 - Mon Jan 18 22:09:54 EST 2010

Bug fixes:
Expand Down
5 changes: 4 additions & 1 deletion lib/Module/Build/Compat.pm
Expand Up @@ -10,6 +10,7 @@ use IO::File;
use Config;
use Module::Build;
use Module::Build::ModuleInfo;
use Module::Build::Version;
use Data::Dumper;

my %convert_installdirs = (
Expand Down Expand Up @@ -76,6 +77,7 @@ sub _merge_prereq {
# validate formats
for my $p ( $req, $breq ) {
for my $k (keys %$p) {
next if $k eq 'perl';
die "Prereq '$p->{$k}' for '$k' is not supported by Module::Build::Compat\n"
unless _simple_prereq($p->{$k});
}
Expand Down Expand Up @@ -124,7 +126,8 @@ HERE
# Makefile.PL
my $requires = $build->requires;
if ( my $minimum_perl = $requires->{perl} ) {
print {$fh} "require $minimum_perl;\n";
my $min_ver = Module::Build::Version->new($minimum_perl)->numify;
print {$fh} "require $min_ver;\n";
}

# If a *bundled* custom subclass is being used, make sure we add its
Expand Down

0 comments on commit 6f40817

Please sign in to comment.