Subject: | Convert complex versions in Module::Build::Compat rather than dieing |
It would be very helpful is Module::Build::Compat would convert complex
versions to numeric form rather than just dieing when it sees them.
This change made some modules like Mail::SPF uninstallable.
Thanks for the great work you're doing with Module::Build
Subject: | mbc_complex_versions.diff |
diff -Nur Module-Build-0.3603.orig/lib/Module/Build/Compat.pm Module-Build-0.3603/lib/Module/Build/Compat.pm
--- Module-Build-0.3603.orig/lib/Module/Build/Compat.pm 2010-01-18 21:30:59.000000000 -0600
+++ Module-Build-0.3603/lib/Module/Build/Compat.pm 2010-01-27 10:42:35.000000000 -0600
@@ -12,6 +12,7 @@
use Module::Build::ModuleInfo;
use Module::Build::Version;
use Data::Dumper;
+use version;
my %convert_installdirs = (
PERL => 'core',
@@ -78,8 +79,10 @@
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});
+ unless (_simple_prereq($p->{$k})) {
+ my $ver_obj = version->new($p->{$k}) || die "Prereq '$p->{$k}' for '$k' is not supported by Module::Build::Compat\n";
+ $p->{$k} = $ver_obj->numify();
+ }
}
}
# merge