chiark / gitweb /
Don't except if already installed on fdroid install
authorDaniel Martí <mvdan@mvdan.cc>
Thu, 19 Dec 2013 16:58:10 +0000 (17:58 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Thu, 19 Dec 2013 17:01:58 +0000 (18:01 +0100)
fdroidserver/common.py
fdroidserver/install.py

index 9325c987ae5931bc6651f56c03c1490626110381..d43aa1a2419ffa32f9a58dac970a77d12209dd32 100644 (file)
@@ -163,15 +163,16 @@ def read_app_args(args, options, allapps, allow_vercodes=False):
 
 apk_regex = None
 
-def apknameinfo(basename):
+def apknameinfo(filename):
     global apk_regex
+    filename = os.path.basename(filename)
     if apk_regex is None:
         apk_regex = re.compile(r"^([a-zA-Z\.]+)_([0-9]+)\.apk$")
-    m = apk_regex.match(basename)
+    m = apk_regex.match(filename)
     try:
         result = (m.group(1), m.group(2))
     except AttributeError:
-        raise Exception("Invalid apk name: %s" % basename)
+        raise Exception("Invalid apk name: %s" % filename)
     return result
 
 def getapkname(app, build):
@@ -1428,7 +1429,7 @@ def FDroidPopen(commands, cwd=None):
                 sys.stderr.write(line)
                 sys.stderr.flush()
             result.stderr += line
-        time.sleep(0.2)
+        time.sleep(0.1)
 
     p.communicate()
     result.returncode = p.returncode
index 79ee30c7a6855de068a44b3d9e21afe2d0a59420..9a4cd3b7e301b8b25f1c41a8bb8c4f6feadadb9d 100644 (file)
@@ -65,8 +65,7 @@ def main():
         # Get the signed apk with the highest vercode
         for apkfile in sorted(glob.glob(os.path.join(output_dir, '*.apk'))):
 
-            apkfilename = os.path.basename(apkfile)
-            appid, vercode = common.apknameinfo(apkfilename)
+            appid, vercode = common.apknameinfo(apkfile)
             if appid not in apks:
                 continue
             if vercodes[appid] and vc not in vercodes[appid]:
@@ -81,8 +80,7 @@ def main():
 
         for apkfile in sorted(glob.glob(os.path.join(output_dir, '*.apk'))):
 
-            apkfilename = os.path.basename(apkfile)
-            appid, vercode = common.apknameinfo(apkfilename)
+            appid, vercode = common.apknameinfo(apkfile)
             apks[appid] = apkfile
 
     else:
@@ -103,8 +101,11 @@ def main():
                 if line.startswith("Failure"):
                     fail = line[9:-1]
             if fail:
-                raise Exception("Failed to install %s on %s: %s" % (
-                    apk, dev, fail))
+                if fail == "INSTALL_FAILED_ALREADY_EXISTS":
+                    print "%s is already installed on %s." % (apk, dev)
+                else:
+                    raise Exception("Failed to install %s on %s: %s" % (
+                        apk, dev, fail))
 
     print "\nFinished"