summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2014-10-02 13:02:11 (GMT)
committerRichard Maw <richard.maw@codethink.co.uk>2014-10-02 13:10:22 (GMT)
commitb98cfd4e0673cee64e61abee714f12dd220c8a2e (patch)
tree3380d3a0e8b4bc3d2b501f398b74d0be5a4e3844
parent73df0d4ff32bf0f472eb81b16b36ae3fb18bae8f (diff)
downloadmorph-baserock/richardmaw/fix-distbuild.tar.gz
Allow distbuilds to choose where to put logsbaserock/richardmaw/fix-distbuild
-rw-r--r--distbuild/initiator.py8
-rw-r--r--morphlib/plugins/distbuild_plugin.py5
-rw-r--r--yarns/implementations.yarn2
3 files changed, 14 insertions, 1 deletions
diff --git a/distbuild/initiator.py b/distbuild/initiator.py
index a803c78..697f48a 100644
--- a/distbuild/initiator.py
+++ b/distbuild/initiator.py
@@ -19,6 +19,7 @@
import base64
import cliapp
import logging
+import os
import random
import sys
@@ -49,6 +50,7 @@ class Initiator(distbuild.StateMachine):
self._morphology = morphology
self._steps = None
self._step_outputs = {}
+ self._step_output_dir = app.settings['initiator-step-output-dir']
self.debug_transitions = False
def setup(self):
@@ -121,7 +123,11 @@ class Initiator(distbuild.StateMachine):
def _open_output(self, msg):
assert msg['step_name'] not in self._step_outputs
- filename = 'build-step-%s.log' % msg['step_name']
+ if self._step_output_dir:
+ filename = os.path.join(self._step_output_dir,
+ 'build-step-%s.log' % msg['step_name'])
+ else:
+ filename = '/dev/null'
f = open(filename, 'a')
self._step_outputs[msg['step_name']] = f
diff --git a/morphlib/plugins/distbuild_plugin.py b/morphlib/plugins/distbuild_plugin.py
index 1858a9b..653eeae 100644
--- a/morphlib/plugins/distbuild_plugin.py
+++ b/morphlib/plugins/distbuild_plugin.py
@@ -168,6 +168,11 @@ class ControllerDaemon(cliapp.Plugin):
'write the port to listen for initiator connections to FILE',
default='',
group=group_distbuild)
+ self.app.settings.string(
+ ['initiator-step-output-dir'],
+ 'write build output to files in DIR',
+ default='.',
+ group=group_distbuild)
self.app.settings.string(
['controller-helper-address'],
diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn
index 6748e3d..c6d245d 100644
--- a/yarns/implementations.yarn
+++ b/yarns/implementations.yarn
@@ -1110,6 +1110,8 @@ Distbuild
>>"$DATADIR/morph.conf"
echo "controller-initiator-address = localhost" \
>>"$DATADIR/morph.conf"
+ echo "initiator-step-output-dir = $DATADIR" \
+ >>"$DATADIR/morph.conf"
IMPLEMENTS FINALLY the distbuild controller is terminated
stop_daemon "$DATADIR/controller-helper-pid"