mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 23:10:29 +03:00
Improve checkupdates regex, support quotes better for build.gradle
This commit is contained in:
parent
e0061c69bd
commit
1cf40636d3
2 changed files with 9 additions and 5 deletions
|
|
@ -197,7 +197,11 @@ def check_repomanifest(app, branch=None):
|
||||||
if not vercode:
|
if not vercode:
|
||||||
return (None,"Couldn't find latest version code")
|
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:
|
except BuildException as be:
|
||||||
msg = "Could not scan app %s due to BuildException: %s" % (app['id'], 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
|
vnsearch = re.compile(r'.*android:versionName="([^"]+?)".*').search
|
||||||
psearch = re.compile(r'.*package="([^"]+)".*').search
|
psearch = re.compile(r'.*package="([^"]+)".*').search
|
||||||
|
|
||||||
vcsearch_g = re.compile(r'.*versionCode[ =]*([0-9]+?)[^\d].*').search
|
vcsearch_g = re.compile(r'.*versionCode[ ]*=[ ]*["\']*([0-9]+?)[^\d].*').search
|
||||||
vnsearch_g = re.compile(r'.*versionName[ =]*"([^"]+?)".*').search
|
vnsearch_g = re.compile(r'.*versionName[ ]*=[ ]*(["\'])((?:(?=(\\?))\3.)*?)\1.*').search
|
||||||
psearch_g = re.compile(r'.*packageName[ =]*"([^"]+)".*').search
|
psearch_g = re.compile(r'.*packageName[ ]*=[ ]*["\']([^"]+)["\'].*').search
|
||||||
|
|
||||||
max_version = None
|
max_version = None
|
||||||
max_vercode = None
|
max_vercode = None
|
||||||
|
|
@ -713,7 +713,7 @@ def parse_androidmanifests(paths):
|
||||||
else:
|
else:
|
||||||
matches = vnsearch(line)
|
matches = vnsearch(line)
|
||||||
if matches:
|
if matches:
|
||||||
version = matches.group(1)
|
version = matches.group(2 if gradle else 1)
|
||||||
if not vercode:
|
if not vercode:
|
||||||
if gradle:
|
if gradle:
|
||||||
matches = vcsearch_g(line)
|
matches = vcsearch_g(line)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue