1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-08-15 10:50:09 +02:00

UpdateCheckIgnore: Exception if version not matched

Ignoreversions were checked also if version did not match which raised the exception
The 'version check' runs in some unexpected situations like just
to find directories where to find the AutoName.
This commit is contained in:
Gerhard Olsson 2019-07-23 00:21:28 +02:00
parent 1ccd839a77
commit 7c4bed0558
2 changed files with 7 additions and 3 deletions

View File

@ -43,6 +43,9 @@ from .exception import VCSException, NoSubmodulesException, FDroidException, Met
# required.
def check_http(app):
ignoreversions = app.UpdateCheckIgnore
ignoresearch = re.compile(ignoreversions).search if ignoreversions else None
try:
if not app.UpdateCheckData:
@ -82,8 +85,9 @@ def check_http(app):
raise FDroidException("No RE match for version")
version = m.group(1)
return (version, vercode)
if version and ignoresearch and not ignoresearch(version):
return (version, vercode)
return (None, ("Version {version} is ignored").format(version=version))
except FDroidException:
msg = "Could not complete http check for app {0} due to unknown error: {1}".format(app.id, traceback.format_exc())
return (None, msg)

View File

@ -1508,7 +1508,7 @@ def parse_androidmanifests(paths, app):
if vercode is not None \
and (max_vercode is None or vercode > max_vercode):
if not ignoresearch or not ignoresearch(version):
if version and (not ignoresearch or not ignoresearch(version)):
if version is not None:
max_version = version
if vercode is not None: