summaryrefslogtreecommitdiff
path: root/buildstream/plugin.py
diff options
context:
space:
mode:
Diffstat (limited to 'buildstream/plugin.py')
-rw-r--r--buildstream/plugin.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/buildstream/plugin.py b/buildstream/plugin.py
index a65db4d42..6b4dbb175 100644
--- a/buildstream/plugin.py
+++ b/buildstream/plugin.py
@@ -287,6 +287,19 @@ class Plugin():
"""
return self.__kind
+ def get_mirror_directory(self):
+ """Fetches the directory where this plugin should store things
+
+ Returns:
+ (str): The directory belonging to this plugin
+ """
+
+ # Create the directory if it doesnt exist
+ context = self._get_context()
+ directory = os.path.join(context.sourcedir, self.get_kind())
+ os.makedirs(directory, exist_ok=True)
+ return directory
+
def node_items(self, node):
"""Iterate over a dictionary loaded from YAML