Cope with non-digit version strings

This commit is contained in:
Petr Písař 2016-10-12 15:20:50 +02:00
parent e19cb9de3c
commit 58510aed74
2 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,35 @@
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

View File

@ -24,6 +24,8 @@ Patch5: CPAN-2.14-URL-schemes-are-case-tolerant-so-the-regexp-should-h.p
Patch6: CPAN-2.14-CVE-2016-1238-don-t-load-optional-modules-from-defau.patch
# Recognize exact version dependency operator, CPAN RT#47934, fixed after 2.14
Patch7: CPAN-2.14-Bugfix-47934-version-requirement-with-was-ignored.patch
# Cope with non-digit version strings, fixed after 2.14
Patch8: CPAN-2.14-accepts_module-must-be-protected-with-an-eval.patch
BuildArch: noarch
BuildRequires: coreutils
BuildRequires: findutils
@ -207,6 +209,7 @@ external download clients to fetch distributions from the net.
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
# Change configuration name
find -type f -exec sed -i -e 's/XCPANCONFIGNAMEX/cpan/g' {} \;
# Remove bundled modules
@ -242,6 +245,7 @@ make test
- Recognize URL schemata disregarding the case
- Fix CVE-2016-1238 (loading optional modules from current working directory)
- Recognize exact version dependency operator (CPAN RT#47934)
- Cope with non-digit version strings
* Wed May 18 2016 Jitka Plesnikova <jplesnik@redhat.com> - 2.11-366
- Perl 5.24 re-rebuild of bootstrapped packages