summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-02-25 10:08:23 +0100
committerJürg Billeter <j@bitron.ch>2019-02-28 12:12:38 +0100
commitbed3b8faa463ebb2de618797b24bc534e674f877 (patch)
tree1f7d63cd6aa703a5ca2e71a3c992463c81f1d6a8
parent0cf62afbfe8ea5eacbdb41b0cb48290a4fc7fecc (diff)
downloadbuildstream-bed3b8faa463ebb2de618797b24bc534e674f877.tar.gz
element.py: Use virtual artifact directory to stage buildtree
-rw-r--r--buildstream/element.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/buildstream/element.py b/buildstream/element.py
index c6ff90947..cd32fd39c 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -1477,9 +1477,9 @@ class Element(Plugin):
# Check if we have a cached buildtree to use
elif usebuildtree:
- artifact_base, _ = self.__extract()
- import_dir = os.path.join(artifact_base, 'buildtree')
- if not os.listdir(import_dir):
+ artifact_vdir, _ = self.__get_artifact_directory()
+ import_dir = artifact_vdir.descend(['buildtree'])
+ if import_dir.is_empty():
detail = "Element type either does not expect a buildtree or it was explictily cached without one."
self.warn("WARNING: {} Artifact contains an empty buildtree".format(self.name), detail=detail)
else: