chiark / gitweb /
build: better logging output on rsync failures
[fdroidserver.git] / fdroidserver / build.py
index 8e59553e62404f8f9b90b4fe022245cacbd9f791..b1b744643451af2f6e90b13052d777bb27f557f9 100644 (file)
@@ -100,18 +100,22 @@ def build_server(app, build, vcs, build_dir, output_dir, log_dir, force):
         # Helper to copy the contents of a directory to the server...
         def send_dir(path):
             logging.debug("rsyncing " + path + " to " + ftp.getcwd())
-            subprocess.check_call(['rsync', '-rple',
-                                   'ssh -o StrictHostKeyChecking=no' +
-                                   ' -o UserKnownHostsFile=/dev/null' +
-                                   ' -o LogLevel=FATAL' +
-                                   ' -o IdentitiesOnly=yes' +
-                                   ' -o PasswordAuthentication=no' +
-                                   ' -p ' + str(sshinfo['port']) +
-                                   ' -i ' + sshinfo['idfile'],
-                                   path,
-                                   sshinfo['user'] +
-                                   "@" + sshinfo['hostname'] +
-                                   ":" + ftp.getcwd()])
+            try:
+                subprocess.check_output(['rsync', '-rplqe',
+                                         'ssh -o StrictHostKeyChecking=no' +
+                                         ' -o UserKnownHostsFile=/dev/null' +
+                                         ' -o LogLevel=FATAL' +
+                                         ' -o IdentitiesOnly=yes' +
+                                         ' -o PasswordAuthentication=no' +
+                                         ' -p ' + str(sshinfo['port']) +
+                                         ' -i ' + sshinfo['idfile'],
+                                         path,
+                                         sshinfo['user'] +
+                                         "@" + sshinfo['hostname'] +
+                                         ":" + ftp.getcwd()],
+                                        stderr=subprocess.STDOUT)
+            except subprocess.CalledProcessError as e:
+                raise FDroidException(str(e), e.output.decode())
 
         logging.info("Preparing server for build...")
         serverpath = os.path.abspath(os.path.dirname(__file__))
@@ -1167,9 +1171,9 @@ def main():
                 # there are any.
                 if first:
                     vcs, build_dir = common.setup_vcs(app)
-                    logging.info("Using %s" % vcs.clientversion())
                     first = False
 
+                logging.info("Using %s" % vcs.clientversion())
                 logging.debug("Checking " + build.versionName)
                 if trybuild(app, build, build_dir, output_dir, log_dir,
                             also_check_dir, srclib_dir, extlib_dir,