From 74ac75d2e359bd1b8216e22cc2c22b650af8d48b Mon Sep 17 00:00:00 2001 From: Adam Coldrick Date: Tue, 28 Apr 2015 14:20:45 +0000 Subject: 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 --- distbuild/build_controller.py | 17 +++++++++-------- 1 file 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 = [] -- cgit v1.2.1