summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2014-04-23 16:36:55 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2014-04-23 16:36:55 +0000
commitede3f337e9769b0e6756d4b9cc37d33aa62b82ba (patch)
tree994f0723f177eb5ac279b0a0b28beb611963070e
parent5afef32028fbcacb7acc3d0318407169dd2353de (diff)
parent89974c3363a3f8467e471aa0bf78ea65e6e03929 (diff)
downloadlorry-ede3f337e9769b0e6756d4b9cc37d33aa62b82ba.tar.gz
Merge branch 'baserock/liw/new-lc-2'
Daniel and Richard reviewed the original set of changes, and Richard my further changes based on review feedback. Reviewed-by: Daniel Silverstone Reviewed-by: Richard Maw
-rwxr-xr-xlorry32
-rwxr-xr-xlorry-ssh-wrapper5
-rw-r--r--setup.py2
3 files changed, 28 insertions, 11 deletions
diff --git a/lorry b/lorry
index 2339c9f..853c65d 100755
--- a/lorry
+++ b/lorry
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# Copyright (C) 2013 Codethink Limited
+# Copyright (C) 2013-2014 Codethink Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -299,6 +299,11 @@ class Lorry(cliapp.Application):
return dest
def mirror_git(self, project_name, dirname, gitdir, spec):
+ # Turn off git's SSL/TLS certificate verification, until Baserock
+ # has an CA management infrastructure.
+ env = dict(os.environ)
+ env['GIT_SSL_NO_VERIFY'] = 'true'
+
if not os.path.exists(gitdir):
self.progress('.. initialising git dir')
self.run_program(['git', 'init', '--bare', gitdir])
@@ -317,12 +322,12 @@ class Lorry(cliapp.Application):
'+refs/tags/*:refs/tags/*'], cwd=gitdir)
try:
self.run_program(['git', 'remote', 'update', 'origin', '--prune'],
- cwd=gitdir)
+ cwd=gitdir, env=env)
except:
self.run_program(['git', 'remote', 'prune', 'origin'],
- cwd=gitdir)
+ cwd=gitdir, env=env)
self.run_program(['git', 'remote', 'update', 'origin', '--prune'],
- cwd=gitdir)
+ cwd=gitdir, env=env)
def gitify_bzr(self, project_name, dirname, gitdir, spec):
bzrdir = os.path.join(dirname, 'bzr')
@@ -350,12 +355,15 @@ class Lorry(cliapp.Application):
branchdir = os.path.join(bzrdir, branch)
if not os.path.exists(branchdir):
self.progress('.. doing initial bzr branch')
- self.run_program(['bzr', 'branch', '--quiet', address,
- branchdir])
+ self.run_program(
+ ['bzr', 'branch', '--quiet', '-Ossl.cert_reqs=none',
+ address, branchdir])
else:
self.progress('.. updating bzr branch')
- self.run_program(['bzr', 'pull', '--quiet', address],
- cwd=branchdir)
+ self.run_program(
+ ['bzr', 'pull', '--quiet', '-Ossl.cert_reqs=none',
+ address],
+ cwd=branchdir)
exports = {}
bzrmarks = os.path.join(gitdir, 'marks.bzr')
@@ -424,8 +432,12 @@ class Lorry(cliapp.Application):
def gitify_cvs(self, project_name, dirname, gitdir, spec):
self.needs_aggressive = True
- self.run_program(['git', 'cvsimport', '-a', '-d', spec['url'],
- '-C', gitdir, spec['module']])
+ env = dict(os.environ)
+ env['CVS_RSH'] = 'lorry-ssh-wrapper'
+ self.run_program(
+ ['git', 'cvsimport', '-a', '-d', spec['url'],
+ '-C', gitdir, spec['module']],
+ env=env)
def gitify_hg(self, project_name, dirname, gitdir, spec):
hgdir = os.path.join(dirname, 'hg')
diff --git a/lorry-ssh-wrapper b/lorry-ssh-wrapper
new file mode 100755
index 0000000..c4e2c1d
--- /dev/null
+++ b/lorry-ssh-wrapper
@@ -0,0 +1,5 @@
+#!/bin/sh
+# Run ssh without strict host key checking.
+
+set -eu
+exec ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "$@"
diff --git a/setup.py b/setup.py
index 811c727..cf172ea 100644
--- a/setup.py
+++ b/setup.py
@@ -85,7 +85,7 @@ FIXME
author='Baserock',
author_email='baserock-dev@baserock.org',
url='http://wiki.baserock.org/',
- scripts=['lorry', 'lorry.tar-importer'],
+ scripts=['lorry', 'lorry.tar-importer', 'lorry-ssh-wrapper'],
data_files=[('share/man/man1', glob.glob('*.[1-8]'))],
cmdclass={
'build': GenerateManpage,