diff options
author | Antoine Wacheux <awacheux@bloomberg.net> | 2017-12-12 09:25:22 +0000 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2017-12-12 17:05:23 +0100 |
commit | ed9b827de06f012f6c7f576034fcbc3eb3e6231f (patch) | |
tree | 75dfc9adc7af8ee435907e37dc29aed5054d7fb2 | |
parent | 594636243abe42a063bc36716e6adb18b7204093 (diff) | |
download | buildstream-ed9b827de06f012f6c7f576034fcbc3eb3e6231f.tar.gz |
source.py: Implement _get_workspace_path
-rw-r--r-- | buildstream/source.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/buildstream/source.py b/buildstream/source.py index cd78890f6..1ad89ff12 100644 --- a/buildstream/source.py +++ b/buildstream/source.py @@ -263,12 +263,17 @@ class Source(Plugin): # A workspace is considered inconsistent in the case # that it's directory went missing # - fullpath = os.path.join(self.get_project_directory(), self.__workspace) + fullpath = self._get_workspace_path() if not os.path.exists(fullpath): self.__consistency = Consistency.INCONSISTENT return self.__consistency + # Return the absolute path of the element's workspace + # + def _get_workspace_path(self): + return os.path.join(self.get_project_directory(), self.__workspace) + # Bump local cached consistency state, this is done from # the pipeline after the successful completion of fetch # and track jobs. @@ -385,7 +390,7 @@ class Source(Plugin): # Stage the workspace # def _stage_workspace(self, directory): - fullpath = os.path.join(self.get_project_directory(), self.__workspace) + fullpath = self._get_workspace_path() with self.timed_activity("Staging local files at {}".format(self.__workspace)): if os.path.isdir(fullpath): @@ -396,7 +401,7 @@ class Source(Plugin): # Get a unique key for the workspace def _get_workspace_key(self): - fullpath = os.path.join(self.get_project_directory(), self.__workspace) + fullpath = self._get_workspace_path() # Get a list of tuples of the the project relative paths and fullpaths if os.path.isdir(fullpath): |