checkupdates: split out vercode parsing into testable function

This commit is contained in:
Hans-Christoph Steiner 2019-12-03 23:51:48 +01:00
parent bbee2cf707
commit 7d40e89341
No known key found for this signature in database
GPG key ID: 3E177817BA1B9BFA
3 changed files with 18 additions and 9 deletions

View file

@ -168,15 +168,8 @@ def check_tags(app, pattern):
if vercode:
logging.debug("Manifest exists in subdir '{0}'. Found version {1} ({2})"
.format(subdir, version, vercode))
try:
i_vercode = int(vercode, 0)
except ValueError:
i_vercode = int(vercode)
try:
i_hcode = int(hcode, 0)
except ValueError:
i_hcode = int(hcode)
if i_vercode > i_hcode:
i_vercode = common.version_code_string_to_int(vercode)
if i_vercode > common.version_code_string_to_int(hcode):
hpak = package
htag = tag
hcode = str(i_vercode)