You are here: Foswiki>Tasks Web>Item8826 (03 Dec 2012, GeorgeClark)Edit Attach

Item8826: Dependency.pm fails to match some Foswiki dependencies

pencil
Priority: Urgent
Current State: Closed
Released In: 1.1.0
Target Release: major
Applies To: Engine
Component: Configure
Branches:
Reported By: GeorgeClark
Waiting For:
Last Change By: GeorgeClark
Some dependencies are reported as not satisfied and re-installed even though they are installed.

Example: DBCachePlugin has the following dependency in the installer:

Foswiki::Contrib::DBCacheContrib,>=4324,1,perl,Required. Database module.

The Dependency.pm function to determine if the dependency is met reports:
Foswiki::Contrib::DBCacheContrib version >= 4324 required
 -- installed version is 17 Nov 2009                     

This "missing dependency" is installed, with version string 5538 (2009-11-17) and should have satisfied the dependency.

The function Configure::Dependency->check reports the dependency as not satisfied.

-- GeorgeClark - 02 Apr 2010

Note also that Dependency.pm appears to be missing the required/optional checks. It reports dependencies as Required even though they are flagged as optional in the description.

-- GeorgeClark - 05 Apr 2010

The problem appears to be that if the extension has a correctly formatted version string, then it is compared, not the SVN release number. So dependencies in the format of Foswiki::Contrib::DBCacheContrib,>=4324 can never be satisfied.

A hack that resolves the problem but is not a good long term fix is to test if the compared version is a simple 4-5 digit number and if so, fall back to use the SVN release for comparsion instead of the version string. If extensions are free to write dependencies as either a SVN release number or a version string, it might be better to encode the SVN version to make the comparison more specific, such as >=r1234 instead of >=1234.

This is probably related to
Item1838: more robust version comparison using the RELEASE instead of the version. Depends on extension authors observing the standards for release naming. Rearranged Find More Extensions UI to improve presentation in the new Configure

@@ -352,21 +359,23 @@
             # otherwise format not recognised; fall through to using $aVERSION
         }
     }
+    $expect = 'svn' if ($b =~ m/[0-9]{4,5}/);  # If we are looking for a 4-5 digit number, assume SVN

     if ( $expect eq 'svn' ) {

         # Didn't get a good RELEASE; fall back to subversion
         return 0 unless defined $aVERSION;
+        print " - Using SVN $aVERSION for comparison\n";

-- GeorgeClark - 10 Apr 2010

After brief IRC discussion:
  • Adding an assumption that a test for a 4 digit number is probably a SVN release number.
  • Adding an explicit rnnnn syntax for dependencies. If 1-6 digit number prefixed by r, compare to SVN
  • Updated unit tests for these cases.
 

ItemTemplate edit

Summary Dependency.pm fails to match some Foswiki dependencies
ReportedBy GeorgeClark
Codebase trunk
SVN Range
AppliesTo Engine
Component Configure
Priority Urgent
CurrentState Closed
WaitingFor
Checkins distro:76e8a7071132 distro:c937ad1a639d
TargetRelease major
ReleasedIn 1.1.0
CheckinsOnBranches
trunkCheckins
Release01x01Checkins
Topic revision: r8 - 03 Dec 2012, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy