mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-04 14:30:11 +01:00
Improve checkupdates regex, support quotes better for build.gradle
This commit is contained in:
parent
525fc14407
commit
7f6761c436
@ -197,7 +197,11 @@ def check_repomanifest(app, branch=None):
|
||||
if not vercode:
|
||||
return (None,"Couldn't find latest version code")
|
||||
|
||||
return (version, str(int(vercode)))
|
||||
vercode = str(int(vercode))
|
||||
|
||||
print "Manifest exists. Found version %s (%s)" % (version, vercode)
|
||||
|
||||
return (version, vercode)
|
||||
|
||||
except BuildException as be:
|
||||
msg = "Could not scan app %s due to BuildException: %s" % (app['id'], be)
|
||||
|
@ -683,9 +683,9 @@ def parse_androidmanifests(paths):
|
||||
vnsearch = re.compile(r'.*android:versionName="([^"]+?)".*').search
|
||||
psearch = re.compile(r'.*package="([^"]+)".*').search
|
||||
|
||||
vcsearch_g = re.compile(r'.*versionCode[ =]*([0-9]+?)[^\d].*').search
|
||||
vnsearch_g = re.compile(r'.*versionName[ =]*"([^"]+?)".*').search
|
||||
psearch_g = re.compile(r'.*packageName[ =]*"([^"]+)".*').search
|
||||
vcsearch_g = re.compile(r'.*versionCode[ ]*=[ ]*["\']*([0-9]+?)[^\d].*').search
|
||||
vnsearch_g = re.compile(r'.*versionName[ ]*=[ ]*(["\'])((?:(?=(\\?))\3.)*?)\1.*').search
|
||||
psearch_g = re.compile(r'.*packageName[ ]*=[ ]*["\']([^"]+)["\'].*').search
|
||||
|
||||
max_version = None
|
||||
max_vercode = None
|
||||
@ -713,7 +713,7 @@ def parse_androidmanifests(paths):
|
||||
else:
|
||||
matches = vnsearch(line)
|
||||
if matches:
|
||||
version = matches.group(1)
|
||||
version = matches.group(2 if gradle else 1)
|
||||
if not vercode:
|
||||
if gradle:
|
||||
matches = vcsearch_g(line)
|
||||
|
Loading…
Reference in New Issue
Block a user