[Koha-bugs] [Bug 5599] New: koha_perl_deps.pl and PerlDependencies.pm don't compare $VERSION numbers correctly

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jan 7 23:15:44 CET 2011


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5599

           Summary: koha_perl_deps.pl and PerlDependencies.pm don't
                    compare $VERSION numbers correctly
 Change sponsored?: ---
           Product: Koha
           Version: HEAD
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Installation and upgrade (command-line installer)
        AssignedTo: gmcharlt at gmail.com
        ReportedBy: ohiocore at gmail.com
         QAContact: koha-bugs at lists.koha-community.org
   Estimated Hours: 0.0


Normal perl $VERSION numbers are not string sortable/comparable.  This is
because they do not use leading zeroes or static numbers of digits for each
part.  

But our logic in C4/Installer/PerlModules.pm relies on string comparison, so it
does not regard 1.3.12 as being greater than 1.3.5, when in reality it is 7
iterations later.

Example:

$ ./koha_perl_deps.pl -u 

Module Name                                 Current Version                    
  Required Version         Module Required
--------------------------------------------------------------------------------------------------------------------------
Graphics::Magick                            1.3.12 *                           
  1.3.5                    No

--------------------------------------------------------------------------------------------------------------------------
Total modules reported: 1                                                     *
Module is missing or requires an upgrade.



Specifically, these comparisons from lines 75 and 89 of
C4/Installer/PerlModules.pm are incorrect:

 $params{'module'}->VERSION lt $PERL_DEPS->{$params{'module'}}->{'min_ver'}
...
 $pkg->VERSION lt $PERL_DEPS->{$_}->{'min_ver'}


I don't like the approach used by PerlModules.pm because the code is
overwrought and it tries to reproduce core perl logic.  

The definitive test would rely on, for example, $pkg->VERSION($min) since
VERSION() is a part of UNIVERSAL and it actually understands perl's lax version
strings (and always will, even if they change format).  We can access that via
UNIVERSAL::require($min).

-- 
Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the Koha-bugs mailing list