chiark / gitweb /
Don't assume that Result: will be in the first line
authorDaniel Martí <mvdan@mvdan.cc>
Sun, 10 Aug 2014 17:56:45 +0000 (19:56 +0200)
committerDaniel Martí <mvdan@mvdan.cc>
Sun, 10 Aug 2014 17:56:45 +0000 (19:56 +0200)
Fixes nasty bugs with _JAVA_OPTIONS

fdroidserver/update.py

index 87b5e54f66dea25a4da34ae8ec154555eaab21e6..4d55f43379d92cb13360bc1ff35a3bc4614b4248 100644 (file)
@@ -468,10 +468,14 @@ def scan_apks(apps, apkcache, repodir, knownapks):
                 sys.exit(1)
             p = FDroidPopen(['java', '-cp', os.path.join(os.path.dirname(__file__), 'getsig'),
                              'getsig', os.path.join(os.getcwd(), apkfile)])
-            if p.returncode != 0 or not p.output.startswith('Result:'):
+            thisinfo['sig'] = None
+            for line in p.output.splitlines():
+                if line.startswith('Result:'):
+                    thisinfo['sig'] = line[7:].strip()
+                    break
+            if p.returncode != 0 or not thisinfo['sig']:
                 logging.critical("Failed to get apk signature")
                 sys.exit(1)
-            thisinfo['sig'] = p.output[7:].strip()
 
             apk = zipfile.ZipFile(apkfile, 'r')