mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-09-17 18:50:11 +02:00
lint: move lastbuild into separate function
This commit is contained in:
parent
a5c2e503b2
commit
acfc48970d
@ -131,6 +131,19 @@ categories = Set([
|
|||||||
desc_url = re.compile("[^[]\[([^ ]+)( |\]|$)")
|
desc_url = re.compile("[^[]\[([^ ]+)( |\]|$)")
|
||||||
|
|
||||||
|
|
||||||
|
def get_lastbuild(builds):
|
||||||
|
lowest_vercode = -1
|
||||||
|
lastbuild = None
|
||||||
|
for build in builds:
|
||||||
|
if not build['disable']:
|
||||||
|
vercode = int(build['vercode'])
|
||||||
|
if lowest_vercode == -1 or vercode < lowest_vercode:
|
||||||
|
lowest_vercode = vercode
|
||||||
|
if not lastbuild or int(build['vercode']) > int(lastbuild['vercode']):
|
||||||
|
lastbuild = build
|
||||||
|
return lastbuild
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
global config, options, curid, count
|
global config, options, curid, count
|
||||||
@ -171,25 +184,18 @@ def main():
|
|||||||
curid = appid
|
curid = appid
|
||||||
count['app_total'] += 1
|
count['app_total'] += 1
|
||||||
|
|
||||||
lowest_vercode = -1
|
lastbuild = get_lastbuild(app['builds'])
|
||||||
curbuild = None
|
|
||||||
for build in app['builds']:
|
|
||||||
if not build['disable']:
|
|
||||||
vercode = int(build['vercode'])
|
|
||||||
if lowest_vercode == -1 or vercode < lowest_vercode:
|
|
||||||
lowest_vercode = vercode
|
|
||||||
if not curbuild or int(build['vercode']) > int(curbuild['vercode']):
|
|
||||||
curbuild = build
|
|
||||||
|
|
||||||
# Incorrect UCM
|
# Incorrect UCM
|
||||||
if (curbuild and curbuild['commit']
|
if (lastbuild is not None
|
||||||
|
and lastbuild['commit']
|
||||||
and app['Update Check Mode'] == 'RepoManifest'
|
and app['Update Check Mode'] == 'RepoManifest'
|
||||||
and not curbuild['commit'].startswith('unknown')
|
and not lastbuild['commit'].startswith('unknown')
|
||||||
and curbuild['vercode'] == app['Current Version Code']
|
and lastbuild['vercode'] == app['Current Version Code']
|
||||||
and not curbuild['forcevercode']
|
and not lastbuild['forcevercode']
|
||||||
and any(s in curbuild['commit'] for s in '.,_-/')):
|
and any(s in lastbuild['commit'] for s in '.,_-/')):
|
||||||
warn("Last used commit '%s' looks like a tag, but Update Check Mode is '%s'" % (
|
warn("Last used commit '%s' looks like a tag, but Update Check Mode is '%s'" % (
|
||||||
curbuild['commit'], app['Update Check Mode']))
|
lastbuild['commit'], app['Update Check Mode']))
|
||||||
|
|
||||||
# Summary size limit
|
# Summary size limit
|
||||||
summ_chars = len(app['Summary'])
|
summ_chars = len(app['Summary'])
|
||||||
|
Loading…
Reference in New Issue
Block a user