From 9936d08c7d7f048ac6a438dad99f24b22fd517e8 Mon Sep 17 00:00:00 2001 From: Mason James Date: Fri, 27 Jan 2017 16:41:57 +1300 Subject: [PATCH] Revert "Bug 17880 - Use version.pm to parse version numbers in C4::Installer::PerlModules" This reverts commit 8ecc75fb2498a55c98aad7743d8cb38ac5843f17. --- C4/Installer/PerlModules.pm | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/C4/Installer/PerlModules.pm b/C4/Installer/PerlModules.pm index 9d8d1c8825..fac0fec2bd 100644 --- a/C4/Installer/PerlModules.pm +++ b/C4/Installer/PerlModules.pm @@ -68,12 +68,10 @@ sub version_info { if ($params{'module'}) { return -1 unless grep {m/$params{'module'}/} keys(%$PERL_DEPS); eval "require $params{'module'}"; - my $pkg_version = $params{'module'} && $params{'module'}->can("VERSION") ? $params{'module'}->VERSION : 0; - my $min_version = $PERL_DEPS->{$params{'module'}}->{'min_ver'} // 0; if ($@) { return {$params{'module'} => {cur_ver => 0, min_ver => $PERL_DEPS->{$_}->{'min_ver'}, upgrade => 0, required => $PERL_DEPS->{$_}->{'required'}, usage => $PERL_DEPS->{$_}->{'usage'}}}; } - elsif (version->parse("$pkg_version") < version->parse("$min_version")) { + elsif ($params{'module'}->VERSION lt $PERL_DEPS->{$params{'module'}}->{'min_ver'}) { return {$params{'module'} => {cur_ver => $params{'module'}->VERSION, min_ver => $PERL_DEPS->{$params{'module'}}->{'min_ver'}, upgrade => 1, required => $PERL_DEPS->{$params{'module'}}->{'required'}, usage => $PERL_DEPS->{$_}->{'usage'}}}; } else { @@ -84,12 +82,10 @@ 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 $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'}}}); } - elsif (version->parse("$pkg_version") < version->parse("$min_version")) { + elsif ($pkg->VERSION lt $PERL_DEPS->{$_}->{'min_ver'}) { push (@{$self->{'upgrade_pm'}}, {$_ => {cur_ver => $pkg->VERSION, min_ver => $PERL_DEPS->{$_}->{'min_ver'}, required => $PERL_DEPS->{$_}->{'required'}, usage => $PERL_DEPS->{$_}->{'usage'}}}); } else { -- 2.39.5