diff options
Diffstat (limited to 'buildstream/source.py')
-rw-r--r-- | buildstream/source.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/buildstream/source.py b/buildstream/source.py index 9e9bad71c..4a7fd0dde 100644 --- a/buildstream/source.py +++ b/buildstream/source.py @@ -465,6 +465,24 @@ class Source(Plugin): """ self.stage(directory) + def init_cached_build_workspace(self, directory): + """Initialises a new cached build workspace + + Args: + directory (str): Path of the workspace to init + + Raises: + :class:`.SourceError` + + Implementors overriding this method should assume that *directory* + already exists. + + Implementors should raise :class:`.SourceError` when encountering + some system error. + """ + # Allow a non implementation + return None + def get_source_fetchers(self): """Get the objects that are used for fetching @@ -717,6 +735,12 @@ class Source(Plugin): self.init_workspace(directory) + # Wrapper for init_cached_build_workspace() + def _init_cached_build_workspace(self, directory): + directory = self.__ensure_directory(directory) + + self.init_cached_build_workspace(directory) + # _get_unique_key(): # # Wrapper for get_unique_key() api |