chiark / gitweb /
makebuildserver: add ndk r16
[fdroidserver.git] / fdroidserver / common.py
index a6afc8b67422557b750be47c96acaa06a342eb28..89c1a1d5ac84414f353f62f53d61a0a8eb04af4f 100644 (file)
@@ -80,6 +80,7 @@ default_config = {
         'r13b': None,
         'r14b': None,
         'r15c': None,
+        'r16': None,
     },
     'qt_sdk_path': None,
     'build_tools': "25.0.2",
@@ -802,7 +803,14 @@ class vcs_git(vcs):
             git_config.append('url.https://u:p@' + domain + '.insteadOf=git://' + domain)
             git_config.append('-c')
             git_config.append('url.https://u:p@' + domain + '.insteadOf=https://' + domain)
-        envs.update({'GIT_TERMINAL_PROMPT': '0'})  # supported in git >= 2.3
+        # add helpful tricks supported in git >= 2.3
+        ssh_command = 'ssh -oBatchMode=yes -oStrictHostKeyChecking=yes'
+        git_config.append('-c')
+        git_config.append('core.sshCommand="' + ssh_command + '"')  # git >= 2.10
+        envs.update({
+            'GIT_TERMINAL_PROMPT': '0',
+            'GIT_SSH_COMMAND': ssh_command,  # git >= 2.3
+        })
         return FDroidPopen(['git', ] + git_config + gitargs,
                            envs=envs, cwd=cwd, output=output)
 
@@ -1605,10 +1613,11 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver=
             dest = os.path.join(build_dir, part)
             logging.info("Removing {0}".format(part))
             if os.path.lexists(dest):
-                if os.path.islink(dest):
-                    FDroidPopen(['unlink', dest], output=False)
+                # rmtree can only handle directories that are not symlinks, so catch anything else
+                if not os.path.isdir(dest) or os.path.islink(dest):
+                    os.remove(dest)
                 else:
-                    FDroidPopen(['rm', '-rf', dest], output=False)
+                    shutil.rmtree(dest)
             else:
                 logging.info("...but it didn't exist")