Commit aa47e93f authored by Hans-Christoph Steiner's avatar Hans-Christoph Steiner
Browse files

Revert "Revert "lint: check if CurrentVersion is older than oldest build entry""

This reverts commit a5ec1703.

parent 1174b14d
Pipeline #44224519 passed with stage
in 19 minutes and 37 seconds
......@@ -527,6 +527,35 @@ def check_for_unsupported_metadata_files(basedir=""):
return return_value
def check_current_version_code(app):
"""Check that the CurrentVersionCode is currently available"""
archive_policy = app.get('ArchivePolicy')
if archive_policy and archive_policy.split()[0] == "0":
cv = app.get('CurrentVersionCode')
if cv is not None and int(cv) == 0:
builds = app.get('builds')
active_builds = 0
min_versionCode = None
if builds:
for build in builds:
vc = int(build['versionCode'])
if min_versionCode is None or min_versionCode > vc:
min_versionCode = vc
if not build.get('disable'):
active_builds += 1
if cv == build['versionCode']:
if active_builds == 0:
return # all builds are disabled
if cv is not None and int(cv) < min_versionCode:
yield(_('CurrentVersionCode {cv} is less than oldest build entry {versionCode}')
.format(cv=cv, versionCode=min_versionCode))
def main():
global config, options
......@@ -581,6 +610,7 @@ def main():
for check_func in app_check_funcs:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment