diff options
Diffstat (limited to 'src/buildstream/scriptelement.py')
| -rw-r--r-- | src/buildstream/scriptelement.py | 44 |
1 files changed, 11 insertions, 33 deletions
diff --git a/src/buildstream/scriptelement.py b/src/buildstream/scriptelement.py index d90e8b6ba..b93c36d1f 100644 --- a/src/buildstream/scriptelement.py +++ b/src/buildstream/scriptelement.py @@ -221,16 +221,12 @@ class ScriptElement(Element): if not self.__layout: # if no layout set, stage all dependencies into / for build_dep in self.dependencies(Scope.BUILD, recurse=False): - with self.timed_activity( - "Staging {} at /".format(build_dep.name), silent_nested=True - ): + with self.timed_activity("Staging {} at /".format(build_dep.name), silent_nested=True): build_dep.stage_dependency_artifacts(sandbox, Scope.RUN, path="/") with sandbox.batch(SandboxFlags.NONE): for build_dep in self.dependencies(Scope.BUILD, recurse=False): - with self.timed_activity( - "Integrating {}".format(build_dep.name), silent_nested=True - ): + with self.timed_activity("Integrating {}".format(build_dep.name), silent_nested=True): for dep in build_dep.dependencies(Scope.RUN): dep.integrate(sandbox) else: @@ -243,23 +239,15 @@ class ScriptElement(Element): element = self.search(Scope.BUILD, item["element"]) if item["destination"] == "/": - with self.timed_activity( - "Staging {} at /".format(element.name), silent_nested=True - ): + with self.timed_activity("Staging {} at /".format(element.name), silent_nested=True): element.stage_dependency_artifacts(sandbox, Scope.RUN) else: with self.timed_activity( - "Staging {} at {}".format(element.name, item["destination"]), - silent_nested=True, + "Staging {} at {}".format(element.name, item["destination"]), silent_nested=True, ): virtual_dstdir = sandbox.get_virtual_directory() - virtual_dstdir.descend( - *item["destination"].lstrip(os.sep).split(os.sep), - create=True - ) - element.stage_dependency_artifacts( - sandbox, Scope.RUN, path=item["destination"] - ) + virtual_dstdir.descend(*item["destination"].lstrip(os.sep).split(os.sep), create=True) + element.stage_dependency_artifacts(sandbox, Scope.RUN, path=item["destination"]) with sandbox.batch(SandboxFlags.NONE): for item in self.__layout: @@ -272,16 +260,12 @@ class ScriptElement(Element): # Integration commands can only be run for elements staged to / if item["destination"] == "/": - with self.timed_activity( - "Integrating {}".format(element.name), silent_nested=True - ): + with self.timed_activity("Integrating {}".format(element.name), silent_nested=True): for dep in element.dependencies(Scope.RUN): dep.integrate(sandbox) install_root_path_components = self.__install_root.lstrip(os.sep).split(os.sep) - sandbox.get_virtual_directory().descend( - *install_root_path_components, create=True - ) + sandbox.get_virtual_directory().descend(*install_root_path_components, create=True) def assemble(self, sandbox): @@ -307,13 +291,9 @@ class ScriptElement(Element): def __validate_layout(self): if self.__layout: # Cannot proceeed if layout is used, but none are for "/" - root_defined = any( - [(entry["destination"] == "/") for entry in self.__layout] - ) + root_defined = any([(entry["destination"] == "/") for entry in self.__layout]) if not root_defined: - raise ElementError( - "{}: Using layout, but none are staged as '/'".format(self) - ) + raise ElementError("{}: Using layout, but none are staged as '/'".format(self)) # Cannot proceed if layout specifies an element that isn't part # of the dependencies. @@ -321,9 +301,7 @@ class ScriptElement(Element): if item["element"]: if not self.search(Scope.BUILD, item["element"]): raise ElementError( - "{}: '{}' in layout not found in dependencies".format( - self, item["element"] - ) + "{}: '{}' in layout not found in dependencies".format(self, item["element"]) ) |
