From: Hans-Christoph Steiner Date: Thu, 13 Oct 2016 14:50:31 +0000 (+0200) Subject: support all valid versionCode values, i.e. Java Integer values X-Git-Tag: 0.8~150^2~4 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=5faef55d67788331f362b42f6a5a8e5cd509a055;p=fdroidserver.git support all valid versionCode values, i.e. Java Integer values versionCode can be any Java Integer value, from Integer.MAX_VALUE (2147483648) to Integer.MIN_VALUE (-2147483647) --- diff --git a/fdroidserver/update.py b/fdroidserver/update.py index 7e1181d1..d18f0fd3 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -1444,12 +1444,15 @@ def main(): else: archapks = [] + # less than the valid range of versionCode, i.e. Java's Integer.MIN_VALUE + UNSET_VERSION_CODE = -0x100000000 + # Some information from the apks needs to be applied up to the application # level. When doing this, we use the info from the most recent version's apk. # We deal with figuring out when the app was added and last updated at the # same time. for appid, app in apps.items(): - bestver = 0 + bestver = UNSET_VERSION_CODE for apk in apks + archapks: if apk['id'] == appid: if apk['versioncode'] > bestver: @@ -1467,7 +1470,7 @@ def main(): if not app.lastupdated: logging.debug("Don't know when " + appid + " was last updated") - if bestver == 0: + if bestver == UNSET_VERSION_CODE: if app.Name is None: app.Name = app.AutoName or appid app.icon = None