Author: mherger
Date: Wed Apr  4 12:59:07 2012
New Revision: 9704

URL: http://svn.slimdevices.com/jive?rev=9704&view=rev
Log:
Bug: n/a
Description: fix reverted version string comparison, use numeric comparison for 
revision

Please note that users running a 7.8.x firmware will have to run the update 
manually form the firmware update menu, as that open issue in the published 
firmwares prevents the forced update.

Modified:
    7.8/trunk/squeezeplay/src/squeezeplay/share/jive/slim/SlimServer.lua

Modified: 7.8/trunk/squeezeplay/src/squeezeplay/share/jive/slim/SlimServer.lua
URL: 
http://svn.slimdevices.com/jive/7.8/trunk/squeezeplay/src/squeezeplay/share/jive/slim/SlimServer.lua?rev=9704&r1=9703&r2=9704&view=diff
==============================================================================
--- 7.8/trunk/squeezeplay/src/squeezeplay/share/jive/slim/SlimServer.lua 
(original)
+++ 7.8/trunk/squeezeplay/src/squeezeplay/share/jive/slim/SlimServer.lua Wed 
Apr  4 12:59:07 2012
@@ -340,6 +340,9 @@
                local versionNew, revisionNew = string.match(url, "\/" .. 
machine .. "_([^_]+)_r([^_]+)\.bin")
                local versionOld, revisionOld = string.match(JIVE_VERSION, 
"(.+) r(.+)")
                local versionOldest, revisionOldest = 
string.match(MINIMUM_COMPATIBLE_FIRMWARE, "(.+) r(.+)")
+
+               log:debug("old version:  ", versionOld,  ", new version:  ", 
versionNew)
+               log:debug("old revision: ", revisionOld, ", new revision: ", 
revisionNew)
                
                if (not versionNew) or (not revisionNew) then
                        log:info("missing firmware version/revision - ignoring")
@@ -350,11 +353,11 @@
                elseif self:isMoreRecent(versionOld, versionNew) then
                        log:info("we don't downgrade, even if lower versioned 
firmware is of more recent revision - ignoring")
 
-               elseif self:isMoreRecent(versionNew, versionOld) or 
self:isMoreRecent(revisionNew, revisionOld) then
+               elseif self:isMoreRecent(versionNew, versionOld) or revisionNew 
> revisionOld then
                        log:info("there's a new firmware available - update!")
                        self.upgradeForce = true
 
-               elseif self:isMoreRecent(versionOldest, versionNew) or 
self:isMoreRecent(revisionOldest, revisionNew) then
+               elseif self:isMoreRecent(versionOldest, versionNew) or 
revisionOldest > revisionNew then
                        log:info("firmware offered is older than oldest known 
compatible - downgrade")
                        self.upgradeForce = true
                end
@@ -1253,12 +1256,12 @@
        local oldVer = string.split("%.", old)
 
        for i,v in ipairs(newVer) do
-               if oldVer[i] and v < oldVer[i] then
-                       return false
-               end
-       end
-
-       return true
+               if oldVer[i] and v > oldVer[i] then
+                       return true
+               end
+       end
+
+       return false
 end
 
 

_______________________________________________
Jive-checkins mailing list
Jive-checkins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/jive-checkins

Reply via email to