mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-09-19 03:30:12 +02:00
Verify correct package ID in build output
This commit is contained in:
parent
b79ba3c630
commit
3477400b01
@ -237,14 +237,21 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, extlib_dir, tmp_dir,
|
|||||||
else:
|
else:
|
||||||
vercode = None
|
vercode = None
|
||||||
version = None
|
version = None
|
||||||
|
foundid = None
|
||||||
for line in output.splitlines():
|
for line in output.splitlines():
|
||||||
if line.startswith("package:"):
|
if line.startswith("package:"):
|
||||||
|
pat = re.compile(".*name='([a-zA-Z0-9._]*)'.*")
|
||||||
|
foundid = re.match(pat, line).group(1)
|
||||||
pat = re.compile(".*versionCode='([0-9]*)'.*")
|
pat = re.compile(".*versionCode='([0-9]*)'.*")
|
||||||
vercode = re.match(pat, line).group(1)
|
vercode = re.match(pat, line).group(1)
|
||||||
pat = re.compile(".*versionName='([^']*)'.*")
|
pat = re.compile(".*versionName='([^']*)'.*")
|
||||||
version = re.match(pat, line).group(1)
|
version = re.match(pat, line).group(1)
|
||||||
if version == None or vercode == None:
|
if not version or not vercode:
|
||||||
raise BuildException("Could not find version information in build in output")
|
raise BuildException("Could not find version information in build in output")
|
||||||
|
if not foundid:
|
||||||
|
raise BuildException("Could not find package ID in output")
|
||||||
|
if foundid != app['id']:
|
||||||
|
raise BuildException("Wrong package ID - build " + foundid + " but expected " + app['id'])
|
||||||
|
|
||||||
# Some apps (e.g. Timeriffic) have had the bonkers idea of
|
# Some apps (e.g. Timeriffic) have had the bonkers idea of
|
||||||
# including the entire changelog in the version number. Remove
|
# including the entire changelog in the version number. Remove
|
||||||
|
Loading…
Reference in New Issue
Block a user