summaryrefslogtreecommitdiff
path: root/distbuild/build_controller.py
diff options
context:
space:
mode:
authorAdam Coldrick <adam.coldrick@codethink.co.uk>2015-03-16 15:10:42 +0000
committerAdam Coldrick <adam.coldrick@codethink.co.uk>2015-03-16 15:10:42 +0000
commit9bf85ad75d38703e2ed28434f58acd1a13b6df83 (patch)
tree4cc87900b916f4bce1b4efd9953d3194b3f339f4 /distbuild/build_controller.py
parent42bc88e06447c9c136c828c21eccd42eb9128085 (diff)
downloadmorph-9bf85ad75d38703e2ed28434f58acd1a13b6df83.tar.gz
WIP: partial distbuilds
Diffstat (limited to 'distbuild/build_controller.py')
-rw-r--r--distbuild/build_controller.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/distbuild/build_controller.py b/distbuild/build_controller.py
index aa11ae8f..e2a63472 100644
--- a/distbuild/build_controller.py
+++ b/distbuild/build_controller.py
@@ -124,10 +124,13 @@ def build_step_name(artifact):
return artifact.name
-def map_build_graph(artifact, callback):
+def map_build_graph(artifact, callback, components=[]):
result = []
done = set()
- queue = [artifact]
+ if components:
+ queue = components
+ else:
+ queue = [artifact]
while queue:
a = queue.pop()
if a not in done:
@@ -137,6 +140,13 @@ def map_build_graph(artifact, callback):
return result
+def find_artifacts(components, artifact):
+ found = []
+ for a in artifact.walk():
+ if a.source.filename in components:
+ found.append(a)
+ return found
+
class BuildController(distbuild.StateMachine):
'''Control one build-request fulfillment.
@@ -325,6 +335,11 @@ class BuildController(distbuild.StateMachine):
distbuild.crash_point()
self._artifact = event.artifact
+ filenames = self._request['component_filenames']
+ self._components = find_artifacts(filenames, self._artifact)
+ if len(self._components) != len(filenames) \
+ and self._request['partial']:
+ raise morphlib.Error('its too much sock')
self._helper_id = self._idgen.next()
artifact_names = []