Bug 17986: Perl dependency evaluation incorrect

It looks like I made a copy/paste error in a previous patch.

While the fix was working when you pass the param "module" to
version_info, it wasn't populating the version correctly
for the "all" param, which causes koha_perl_deps.pl to
think all OK modules actually need an upgrade.

TEST PLAN

0) Be on a system where you know your Koha Perl dependencies are
mostly up-to-date

1) Run ./koha_perl_deps.pl -a -c
2) Note that most modules say they need an upgrade even when
the installed version is the same as the minimum version

3) Apply patch

4) Run ./koha_perl_deps.pl -a -c
5) Note that most moduls say they're OK, especially when the
installed version is the same or greater than the minimum version

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Running koha_perl_deps.pl -u convinced me.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
David Cook 2017-01-25 09:58:40 +11:00 committed by Kyle M Hall
parent bcf9fdafab
commit 4ff78a9a0d
1 changed files with 1 additions and 1 deletions

View File

@ -84,7 +84,7 @@ sub version_info {
for (sort keys(%{$PERL_DEPS})) {
my $pkg = $_; # $_ holds the string
eval "require $pkg";
my $pkg_version = $params{'module'} && $params{'module'}->can("VERSION") ? $params{'module'}->VERSION : 0;
my $pkg_version = $pkg && $pkg->can("VERSION") ? $pkg->VERSION : 0;
my $min_version = $PERL_DEPS->{$_}->{'min_ver'} // 0;
if ($@) {
push (@{$self->{'missing_pm'}}, {$_ => {cur_ver => 0, min_ver => $PERL_DEPS->{$_}->{'min_ver'}, required => $PERL_DEPS->{$_}->{'required'}, usage => $PERL_DEPS->{$_}->{'usage'}}});