summaryrefslogtreecommitdiff
path: root/buildstream
diff options
context:
space:
mode:
authorJonathan Maw <jonathan.maw@codethink.co.uk>2018-05-08 14:19:49 +0100
committerJonathan Maw <jonathan.maw@codethink.co.uk>2018-05-17 16:45:50 +0100
commit38dc2dda47b152105c57de938812d1163a4c29f0 (patch)
tree90c570b6a202cf73cd63b9987208da08cd29dc68 /buildstream
parent8316a1fe2b2bc43865bfa01a983b2b792e834b11 (diff)
downloadbuildstream-38dc2dda47b152105c57de938812d1163a4c29f0.tar.gz
element.py: Add _get_source_element() method
Diffstat (limited to 'buildstream')
-rw-r--r--buildstream/element.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/buildstream/element.py b/buildstream/element.py
index 90cdec640..832f0dd93 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -1850,6 +1850,18 @@ class Element(Plugin):
for dep in self.dependencies(Scope.ALL):
dep._set_log_handle(logfile, False)
+ # Returns the element whose sources this element is ultimately derived from.
+ #
+ # This is intended for being used to redirect commands that operate on an
+ # element to the element whose sources it is ultimately derived from.
+ #
+ # For example, element A is a build element depending on source foo,
+ # element B is a filter element that depends on element A. The source
+ # element of B is A, since B depends on A, and A has sources.
+ #
+ def _get_source_element(self):
+ return self
+
#############################################################
# Private Local Methods #
#############################################################