From 8cb00b289fbbb5aeade216c71c6bbcf52aa419af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Wed, 8 Jan 2014 09:00:40 +0100 Subject: [PATCH] Avoid crashes on package: group() calls --- fdroidserver/build.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/fdroidserver/build.py b/fdroidserver/build.py index e244e2df..03289b19 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -690,11 +690,18 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d for line in output.splitlines(): if line.startswith("package:"): pat = re.compile(".*name='([a-zA-Z0-9._]*)'.*") - foundid = re.match(pat, line).group(1) + m = pat.match(line) + if m: + foundid = m.group(1) pat = re.compile(".*versionCode='([0-9]*)'.*") - vercode = re.match(pat, line).group(1) + m = pat.match(line) + if m: + vercode = m.group(1) pat = re.compile(".*versionName='([^']*)'.*") - version = re.match(pat, line).group(1) + m = pat.match(line) + if m: + version = m.group(1) + if thisbuild['novcheck']: vercode = thisbuild['vercode'] version = thisbuild['version']