From 20cdb1ffd8ac90e1ea41949d887b7bf27d855317 Mon Sep 17 00:00:00 2001 From: Andreas Koenig Date: Sat, 27 Aug 2016 17:45:46 +0200 Subject: [PATCH] Bugfix #47934: version requirement with "==" was ignored MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - reason was that uptodateness was checked earlier and considered sufficient - adding a check where the uptodateness check appears - resolving with a warning that continues, we cannot downgrade anyway Signed-off-by: Petr Písař --- lib/CPAN/Distribution.pm | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/CPAN/Distribution.pm b/lib/CPAN/Distribution.pm index ac62b65..fa9300d 100644 --- a/lib/CPAN/Distribution.pm +++ b/lib/CPAN/Distribution.pm @@ -2838,9 +2838,21 @@ sub unsat_prereq { $CPAN::SQLite->search("CPAN::Module",$need_module); } $nmo = $CPAN::META->instance("CPAN::Module",$need_module); - next if $nmo->uptodate; $inst_file = $nmo->inst_file || ''; $available_file = $nmo->available_file || ''; + $available_version = $nmo->available_version; + if ($nmo->uptodate) { + my $accepts = $merged->accepts_module($need_module, $available_version); + unless ($accepts) { + my $rq = $merged->requirements_for_module( $need_module ); + $CPAN::Frontend->mywarn( + "Warning: Version '$available_version' of ". + "'$need_module' is up to date but does not ". + "fulfill requirements ($rq). I will continue, ". + "but chances to succeed are low.\n"); + } + next NEED; + } # if they have not specified a version, we accept any installed one if ( $available_file @@ -2853,8 +2865,6 @@ sub unsat_prereq { next NEED; } } - - $available_version = $nmo->available_version; } # We only want to install prereqs if either they're not installed -- 2.7.4