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)