summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbderrahim Kitouni <akitouni@gnome.org>2020-09-22 13:56:03 +0100
committerAbderrahim Kitouni <akitouni@gnome.org>2020-09-22 14:02:26 +0100
commitdae098c5cd390033975bfaefbec7b15a0c122696 (patch)
tree90bb4e034db3b83d96dcaf5e011edf9726770a5a
parent2fba71ef650d242882147ff145cd6afa16b9d16f (diff)
downloadbuildstream-abderrahim/stage-artifact-scriptelement.tar.gz
scriptelement.py: use stage_artifact() instead of stage_dependency_artifacts()abderrahim/stage-artifact-scriptelement
stage_dependency_artifacts() assumes the element in question is the element to be built and does some additonal things when it is workspaced.
-rw-r--r--buildstream/scriptelement.py20
1 files changed, 7 insertions, 13 deletions
diff --git a/buildstream/scriptelement.py b/buildstream/scriptelement.py
index 10bbbf53f..ce2592d3a 100644
--- a/buildstream/scriptelement.py
+++ b/buildstream/scriptelement.py
@@ -224,7 +224,8 @@ class ScriptElement(Element):
for build_dep in self.dependencies(Scope.BUILD, recurse=False):
with self.timed_activity("Staging {} at /"
.format(build_dep.name), silent_nested=True):
- build_dep.stage_dependency_artifacts(sandbox, Scope.RUN, path="/")
+ for dep in build_dep.dependencies(Scope.RUN):
+ dep.stage_artifact(sandbox)
for build_dep in self.dependencies(Scope.BUILD, recurse=False):
with self.timed_activity("Integrating {}".format(build_dep.name), silent_nested=True):
@@ -239,18 +240,11 @@ class ScriptElement(Element):
continue
element = self.search(Scope.BUILD, item['element'])
- if item['destination'] == '/':
- 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):
- real_dstdir = os.path.join(sandbox.get_directory(),
- item['destination'].lstrip(os.sep))
- os.makedirs(os.path.dirname(real_dstdir), exist_ok=True)
- element.stage_dependency_artifacts(sandbox, Scope.RUN, path=item['destination'])
+ with self.timed_activity("Staging {} at {}"
+ .format(element.name, item['destination']),
+ silent_nested=True):
+ for dep in element.dependencies(Scope.RUN):
+ dep.stage_artifact(sandbox, path=item['destination'])
for item in self.__layout: