diff --git a/fdroidserver/checkupdates.py b/fdroidserver/checkupdates.py index fc525789..590949a2 100644 --- a/fdroidserver/checkupdates.py +++ b/fdroidserver/checkupdates.py @@ -134,7 +134,8 @@ def check_tags(app, pattern): # Only process tags where the manifest exists... paths = common.manifest_paths(build_dir, flavour) - version, vercode, package = common.parse_androidmanifests(paths) + version, vercode, package = common.parse_androidmanifests(paths, + app['Update Check Ignore']) if not package or package != appid or not version or not vercode: continue @@ -209,7 +210,8 @@ def check_repomanifest(app, branch=None): paths = common.manifest_paths(build_dir, flavour) - version, vercode, package = common.parse_androidmanifests(paths) + version, vercode, package = common.parse_androidmanifests(paths, + app['Update Check Ignore']) if not package: return (None, "Couldn't find package ID") if package != appid: @@ -217,6 +219,8 @@ def check_repomanifest(app, branch=None): if not version: return (None, "Couldn't find latest version name") if not vercode: + if "Ignore" == version: + return (None, "Latest version is ignored") return (None, "Couldn't find latest version code") vercode = str(int(vercode)) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 157b82dc..93ec3531 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -823,7 +823,7 @@ def remove_debuggable_flags(root_dir): # Extract some information from the AndroidManifest.xml at the given path. # Returns (version, vercode, package), any or all of which might be None. # All values returned are strings. -def parse_androidmanifests(paths): +def parse_androidmanifests(paths, ignoreversions=None): if not paths: return (None, None, None) @@ -836,6 +836,8 @@ def parse_androidmanifests(paths): vnsearch_g = re.compile(r'.*versionName *=* *(["\'])((?:(?=(\\?))\3.)*?)\1.*').search psearch_g = re.compile(r'.*packageName *=* *["\']([^"]+)["\'].*').search + ignoresearch = re.compile(ignoreversions).search if ignoreversions else None + max_version = None max_vercode = None max_package = None @@ -876,9 +878,12 @@ def parse_androidmanifests(paths): max_package = package if max_vercode is None or (vercode is not None and vercode > max_vercode): - max_version = version - max_vercode = vercode - max_package = package + if not ignoresearch or not ignoresearch(version): + max_version = version + max_vercode = vercode + max_package = package + else: + max_version = "Ignore" if max_version is None: max_version = "Unknown" diff --git a/fdroidserver/metadata.py b/fdroidserver/metadata.py index 820ce05b..441a20ed 100644 --- a/fdroidserver/metadata.py +++ b/fdroidserver/metadata.py @@ -51,6 +51,7 @@ app_defaults = { 'AntiFeatures': None, 'Archive Policy': None, 'Update Check Mode': 'None', + 'Update Check Ignore': None, 'Update Check Name': None, 'Update Check Data': None, 'Vercode Operation': None, @@ -808,6 +809,8 @@ def write_metadata(dest, app): writefield('Archive Policy') writefield('Auto Update Mode') writefield('Update Check Mode') + if app['Update Check Ignore']: + writefield('Update Check Ignore') if app['Vercode Operation']: writefield('Vercode Operation') if app['Update Check Data']: