summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Coldrick <adam.coldrick@codethink.co.uk>2015-04-28 14:20:45 +0000
committerBaserock Gerrit <gerrit@baserock.org>2015-04-30 13:14:44 +0000
commit74ac75d2e359bd1b8216e22cc2c22b650af8d48b (patch)
tree6d30abd2ce4c58aa15b81b90f3a196973238d125
parentf964cf053db43e80262b8d06d29696c0da304c57 (diff)
downloadmorph-74ac75d2e359bd1b8216e22cc2c22b650af8d48b.tar.gz
Fix partial distbuilds of non-existant components
Currently, attempting to distbuild a component which is not in the given system or doesn't exist at all will cause the full system to be built, rather than an error raised. This is because the logic which checks that all components were found is completely nonsensical. This commit makes it actually check the right thing. Change-Id: Ide4d7e3fa5f71e433f3a7b7c8c387fe594c92e43
-rw-r--r--distbuild/build_controller.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/distbuild/build_controller.py b/distbuild/build_controller.py
index 0a3bd8a8..8acbcb43 100644
--- a/distbuild/build_controller.py
+++ b/distbuild/build_controller.py
@@ -375,15 +375,16 @@ class BuildController(distbuild.StateMachine):
self._artifact = event.artifact
names = self._request['component_names']
self._components = find_artifacts(names, self._artifact)
- failed = False
- for component in self._components:
- if component.source.morphology['name'] not in names:
+ not_found = []
+ for component in names:
+ found_names = [c.source_name for c in self._components]
+ if component not in found_names:
logging.debug('Failed to find %s in build graph'
- % component.filename)
- failed = True
- if failed:
- self.fail('Failed to find all components in %s'
- % self._artifact.name)
+ % component)
+ not_found.append(component)
+ if not_found:
+ self.fail('Some of the requested components are not in %s: %s'
+ % (self._artifact.name, ', '.join(not_found)))
self._helper_id = self._idgen.next()
artifact_names = []