From 1ad0e599c173f90b193c717f569252364d64b1cd Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Tue, 26 Feb 2013 16:51:49 +0000 Subject: Various fixes to improve reliability --- lorry | 16 ++++++++-------- 1 file 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) -- cgit v1.2.1