summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <daniel.silverstone@codethink.co.uk>2013-02-26 16:51:49 +0000
committerDaniel Silverstone <daniel.silverstone@codethink.co.uk>2013-02-26 16:51:49 +0000
commit1ad0e599c173f90b193c717f569252364d64b1cd (patch)
treeffb935c909c58396c5e1d95b3b421dc1c97e8fbf
parent969b382cbce96f2fa2d108a650dca3bb210f74b1 (diff)
downloadlorry-1ad0e599c173f90b193c717f569252364d64b1cd.tar.gz
Various fixes to improve reliability
-rwxr-xr-xlorry16
1 files changed, 8 insertions, 8 deletions
diff --git a/lorry b/lorry
index e1d2cf4..e2fed04 100755
--- a/lorry
+++ b/lorry
@@ -269,19 +269,18 @@ class Lorry(cliapp.Application):
assert os.path.exists(sourceobjects), "No source objects"
objectspath = os.path.join(dest, 'objects')
os.mkdir(objectspath)
- for dirpath, dirnames, filenames in os.walk(objectspath):
- assert dirpath.startswith(objectspath)
- # strip objectspath and / from relpath
- relpath = dirpath[len(objectspath)+1:]
+ for dirpath, dirnames, filenames in os.walk(sourceobjects):
+ assert dirpath.startswith(sourceobjects)
+ # strip sourceobjects and / from relpath
+ relpath = dirpath[len(sourceobjects)+1:]
for dirname in dirnames:
- os.mkdir(os.path.join(dest, relpath, dirname))
+ os.mkdir(os.path.join(objectspath, relpath, dirname))
for filename in filenames:
- assert os.path.exists(os.path.join(dest, relpath))
+ assert os.path.exists(os.path.join(objectspath, relpath))
os.link(os.path.join(dirpath, filename),
- os.path.join(dest, relpath, filename))
+ os.path.join(objectspath, relpath, filename))
return dest
-
def mirror_git(self, project_name, dirname, gitdir, spec):
if not os.path.exists(gitdir):
self.progress('.. initialising git dir')
@@ -462,6 +461,7 @@ class Lorry(cliapp.Application):
kwargs['stdout'] = open(self.settings['command-stdout'], 'a')
if self.settings['command-stderr']:
kwargs['stderr'] = open(self.settings['command-stderr'], 'a')
+ kwargs['stdin'] = open('/dev/null', 'r')
logging.debug('Running: argv=%s kwargs=%s' %
(repr(argv), repr(kwargs)))
exit, out, err = self.runcmd_unchecked(argv, **kwargs)