From 2686fa6faaec3862038e9f4d54aed98b4412722a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Sun, 22 Jun 2014 17:36:00 +0200 Subject: [PATCH] A bit more None magic to fix some UCMs --- fdroidserver/common.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 5db9f540..75968635 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -893,15 +893,21 @@ def parse_androidmanifests(paths, ignoreversions=None): if matches: vercode = matches.group(1) - # Better some package name than nothing - if max_package is None: + # Always grab the package name and version name in case they are not + # together with the highest version code + if max_package is None and package is not None: max_package = package + if max_version is None and version is not None: + max_version = version if max_vercode is None or (vercode is not None and vercode > max_vercode): if not ignoresearch or not ignoresearch(version): - max_version = version - max_vercode = vercode - max_package = package + if version is not None: + max_version = version + if vercode is not None: + max_vercode = vercode + if package is not None: + max_package = package else: max_version = "Ignore"