Blob Blame History Raw
From 0bae2227c75b922a1d7441bf7bee58d01afb1dc8 Mon Sep 17 00:00:00 2001
From: Andreas Koenig <andk@cpan.org>
Date: Mon, 29 Aug 2016 22:04:52 +0200
Subject: [PATCH] accepts_module must be protected with an eval
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

- otherwise cannot tolerate version numbers like 2.08a
- could run into endless loop with "test Dancer::Plugin::SimpleCRUD"
  which depended on HTML::Table 2.08a which was installed

Signed-off-by: Petr Písař <ppisar@redhat.com>
---
 lib/CPAN/Distribution.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/CPAN/Distribution.pm b/lib/CPAN/Distribution.pm
index fa9300d..ef85a3c 100644
--- a/lib/CPAN/Distribution.pm
+++ b/lib/CPAN/Distribution.pm
@@ -2842,7 +2842,9 @@ sub unsat_prereq {
             $available_file = $nmo->available_file || '';
             $available_version = $nmo->available_version;
             if ($nmo->uptodate) {
-                my $accepts = $merged->accepts_module($need_module, $available_version);
+                my $accepts = eval {
+                    $merged->accepts_module($need_module, $available_version);
+                };
                 unless ($accepts) {
                     my $rq = $merged->requirements_for_module( $need_module );
                     $CPAN::Frontend->mywarn(
-- 
2.7.4