mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-14 02:50:12 +01:00
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)
This commit is contained in:
parent
f90adcc912
commit
5faef55d67
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user