details:   https://code.openbravo.com/erp/devel/pi/rev/0619603e5e54
changeset: 17980:0619603e5e54
user:      Augusto Mauch <augusto.mauch <at> openbravo.com>
date:      Wed Sep 19 14:38:29 2012 +0200
summary:   Fixes issue 15721: Module dependency validation has been fixed

The process that the modules dependencies was not working properly with modules 
that had major dependencies having defined a last version.

diffstat:

 src/org/openbravo/erpCommon/modules/VersionUtility.java |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (26 lines):

diff -r f95e6cf72b42 -r 0619603e5e54 
src/org/openbravo/erpCommon/modules/VersionUtility.java
--- a/src/org/openbravo/erpCommon/modules/VersionUtility.java   Wed Sep 19 
13:02:06 2012 +0200
+++ b/src/org/openbravo/erpCommon/modules/VersionUtility.java   Wed Sep 19 
14:38:29 2012 +0200
@@ -134,8 +134,8 @@
       }
       if (dep.maxVer != null && !dep.maxVer.isEmpty()) {
         // if lastVersion!=null, firstVersion >= installedVersion >= 
lastVersion
-        if (versionCompare(dep.minVer, dep.maxVer, false) == 1
-            && versionCompare(mod.availableMinVer, dep.maxVer, true) == 1) {
+        if (versionCompare(dep.minVer, mod.availableMaxVer, false) == 1
+            || versionCompare(mod.availableMinVer, dep.maxVer, true) == 1) {
           errors.add(depParentMod + " @CR_DependensOnModule@ \"" + strModName
               + "\" @CR_InVersion@ \"" + dep.maxVer + "\", 
@CR_MaxAvailableVersion@ \""
               + mod.availableMinVer + "\". ");
@@ -493,8 +493,9 @@
         n2[i] = Integer.parseInt(s2[i]);
     }
 
-    if (n1[0] > n2[0] || (n1[0] == n2[0] && n1[1] > n2[1])
-        || (n1[0] == n2[0] && n1[1] == n2[1] && n1[2] > n2[2]))
+    if ((!onlyMayorVersion && (n1[0] > n2[0] || (n1[0] == n2[0] && n1[1] > 
n2[1]) || (n1[0] == n2[0]
+        && n1[1] == n2[1] && n1[2] > n2[2])))
+        || (onlyMayorVersion && (n1[0] > n2[0] || (n1[0] == n2[0] && n1[1] > 
n2[1]))))
       return 1;
     else if ((onlyMayorVersion && n1[0] == n2[0] && n1[1] == n2[1] && n1[2] <= 
n2[2])
         || (!onlyMayorVersion && n1[0] == n2[0] && n1[1] == n2[1] && n1[2] == 
n2[2]))

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to