chiark / gitweb /
checkupdates: don't auto update to older versions
authorDaniel Martí <mvdan@mvdan.cc>
Wed, 9 Sep 2015 16:27:18 +0000 (09:27 -0700)
committerDaniel Martí <mvdan@mvdan.cc>
Wed, 9 Sep 2015 16:27:18 +0000 (09:27 -0700)
If for whatever reason the update check results in an older version that we
didn't package, don't "update" to that version if we already packaged newer
versions.

fdroidserver/checkupdates.py

index 1962dded82df9be449c7b468d655b0bfe41296f5..81137a0fae433681a04a24d80be61c1a0a019387 100644 (file)
@@ -474,6 +474,9 @@ def checkupdates_app(app, first=True):
                 if not latest or int(build['vercode']) > int(latest['vercode']):
                     latest = build
 
+            if int(latest['vercode']) > int(app['Current Version Code']):
+                logging.info("Refusing to auto update, since the latest build is newer")
+
             if not gotcur:
                 newbuild = latest.copy()
                 if 'origlines' in newbuild: