mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-09-11 15:13:27 +02:00
Add ability to ignore updates based on version name matching
This commit is contained in:
parent
751daf0cda
commit
0113f85448
@ -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))
|
||||
|
@ -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"
|
||||
|
@ -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']:
|
||||
|
Loading…
Reference in New Issue
Block a user