mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-08-18 04:10:10 +02:00
[checkupdates] move gradle var check to parser
3638acddc
added a check if the version name string is actually a
unresolved gradle variable. This moves the check into the
common.parse_androidmanifests() as it is the only where the it could
happen. This also resolves the case where checkupdates returns
"Unknown".
Closes: #751
This commit is contained in:
parent
ea567b0b5a
commit
c19f46b706
@ -455,12 +455,6 @@ def checkupdates_app(app):
|
|||||||
vercode = str(common.calculate_math_string(op))
|
vercode = str(common.calculate_math_string(op))
|
||||||
logging.debug("Applied vercode operation: %s -> %s" % (oldvercode, vercode))
|
logging.debug("Applied vercode operation: %s -> %s" % (oldvercode, vercode))
|
||||||
|
|
||||||
if version and any(version.startswith(s) for s in [
|
|
||||||
'${', # Gradle variable names
|
|
||||||
'@string/', # Strings we could not resolve
|
|
||||||
]):
|
|
||||||
version = "Unknown"
|
|
||||||
|
|
||||||
updating = False
|
updating = False
|
||||||
if version is None:
|
if version is None:
|
||||||
raise FDroidException(_('no version information found'))
|
raise FDroidException(_('no version information found'))
|
||||||
|
@ -1703,6 +1703,18 @@ def parse_androidmanifests(paths, app):
|
|||||||
max_vercode = None
|
max_vercode = None
|
||||||
max_package = None
|
max_package = None
|
||||||
|
|
||||||
|
def vnsearch(line):
|
||||||
|
matches = vnsearch_g(line)
|
||||||
|
if matches and not any(
|
||||||
|
matches.group(2).startswith(s)
|
||||||
|
for s in [
|
||||||
|
'${', # Gradle variable names
|
||||||
|
'@string/', # Strings we could not resolve
|
||||||
|
]
|
||||||
|
):
|
||||||
|
return matches.group(2)
|
||||||
|
return None
|
||||||
|
|
||||||
for path in paths:
|
for path in paths:
|
||||||
# TODO: Remove this in Python3.6
|
# TODO: Remove this in Python3.6
|
||||||
path = str(path)
|
path = str(path)
|
||||||
@ -1735,9 +1747,9 @@ def parse_androidmanifests(paths, app):
|
|||||||
temp_app_id = matches.group(2)
|
temp_app_id = matches.group(2)
|
||||||
|
|
||||||
if "versionName" in line and not temp_version_name:
|
if "versionName" in line and not temp_version_name:
|
||||||
matches = vnsearch_g(line)
|
matches = vnsearch(line)
|
||||||
if matches:
|
if matches:
|
||||||
temp_version_name = matches.group(2)
|
temp_version_name = matches
|
||||||
|
|
||||||
if inside_flavour_group > 0:
|
if inside_flavour_group > 0:
|
||||||
if inside_required_flavour > 1:
|
if inside_required_flavour > 1:
|
||||||
@ -1755,9 +1767,10 @@ def parse_androidmanifests(paths, app):
|
|||||||
if app_matches_packagename(app, temp_app_id):
|
if app_matches_packagename(app, temp_app_id):
|
||||||
package = temp_app_id
|
package = temp_app_id
|
||||||
|
|
||||||
matches = vnsearch_g(line)
|
matches = vnsearch(line)
|
||||||
if matches:
|
if matches:
|
||||||
version = matches.group(2)
|
version = matches
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# If build.gradle contains applicationNameSuffix add it to the end of version name
|
# If build.gradle contains applicationNameSuffix add it to the end of version name
|
||||||
matches = vnssearch_g(line)
|
matches = vnssearch_g(line)
|
||||||
@ -1799,9 +1812,9 @@ def parse_androidmanifests(paths, app):
|
|||||||
if app_matches_packagename(app, s):
|
if app_matches_packagename(app, s):
|
||||||
package = s
|
package = s
|
||||||
if not version:
|
if not version:
|
||||||
matches = vnsearch_g(line)
|
matches = vnsearch(line)
|
||||||
if matches:
|
if matches:
|
||||||
version = matches.group(2)
|
version = matches
|
||||||
if not vercode:
|
if not vercode:
|
||||||
matches = vcsearch_g(line)
|
matches = vcsearch_g(line)
|
||||||
if matches:
|
if matches:
|
||||||
|
Loading…
Reference in New Issue
Block a user