chiark / gitweb /
Avoid crashes on package: group() calls
authorDaniel Martí <mvdan@mvdan.cc>
Wed, 8 Jan 2014 08:00:40 +0000 (09:00 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Thu, 9 Jan 2014 15:23:49 +0000 (16:23 +0100)
fdroidserver/build.py

index e244e2df27e35276d153f1ffd91176f97b5d41c2..03289b19d12400f2fffe32cfbfcda6e547ce915f 100644 (file)
@@ -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']