On Tue, Mar 13, 2012 at 09:51:51PM -0400, Michael G Schwern via RT wrote:
Show quoted text> <URL:
https://rt.cpan.org/Ticket/Display.html?id=75758 >
>
> On 2012.3.13 5:54 PM, Martin Becker via RT wrote:
> > EUMM should accept the same kind of version information CPAN::Meta does.
>
> I'm open to that, especially if the prereq parsing can be handled by
> CPAN::Meta or one of its dependencies we already have bundled. I'd rather
> avoid duplicating the version range parsing code.
This is fairly straightforward with a recent version of CPAN-Meta such
as CPAN-Meta-2.120630:
Show quoted text----- cut here -----
use CPAN::Meta::Requirements;
my $prereq = 'Math::BigInt';
my $required_version = '>= 1.58, != 1.99';
my $pr_version = '1.99';
my $req = CPAN::Meta::Requirements->new;
$req->add_string_requirement($prereq => $required_version);
if (!$req->accepts_module($prereq, $pr_version)) {
warn sprintf "Warning: prerequisite %s %s not found. We have %s.\n",
$prereq, $required_version, ($pr_version || 'unknown version');
}
----- cut here -----
By the way, I'd also like EUMM to arrange for another run of the build
requirements check in a make rule. That way module authors could trust
BUILD_REQUIRES to reliably prevent their distro from being built under
certain conditions. Warnings alone may get overlooked by admins doing
a manual installation, and the state of available modules may change
between Makefile.PL runtime and actual build time.
-Martin