mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-16 07:52:35 +03:00
Add ability to ignore updates based on version name matching
This commit is contained in:
parent
751daf0cda
commit
0113f85448
3 changed files with 18 additions and 6 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue