diff options
Diffstat (limited to 'src/buildstream/_workspaces.py')
-rw-r--r-- | src/buildstream/_workspaces.py | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/buildstream/_workspaces.py b/src/buildstream/_workspaces.py index 3d50fd9c0..49b76a7b9 100644 --- a/src/buildstream/_workspaces.py +++ b/src/buildstream/_workspaces.py @@ -299,14 +299,6 @@ class Workspace: def differs(self, other): return self.to_dict() != other.to_dict() - # invalidate_key() - # - # Invalidate the workspace key, forcing a recalculation next time - # it is accessed. - # - def invalidate_key(self): - self._key = None - # stage() # # Stage the workspace to the given directory. @@ -346,44 +338,6 @@ class Workspace: def clear_running_files(self): self.running_files = {} - # get_key() - # - # Get a unique key for this workspace. - # - # Args: - # recalculate (bool) - Whether to recalculate the key - # - # Returns: - # (str) A unique key for this workspace - # - def get_key(self): - def unique_key(filename): - try: - stat = os.lstat(filename) - except OSError as e: - raise LoadError("Failed to stat file in workspace: {}".format(e), LoadErrorReason.MISSING_FILE) - - # Use the mtime of any file with sub second precision - return stat.st_mtime_ns - - if self._key is None: - fullpath = self.get_absolute_path() - - excluded_files = (WORKSPACE_PROJECT_FILE,) - - # Get a list of tuples of the the project relative paths and fullpaths - if os.path.isdir(fullpath): - filelist = utils.list_relative_paths(fullpath) - filelist = [ - (relpath, os.path.join(fullpath, relpath)) for relpath in filelist if relpath not in excluded_files - ] - else: - filelist = [(self.get_absolute_path(), fullpath)] - - self._key = [(relpath, unique_key(fullpath)) for relpath, fullpath in filelist] - - return self._key - # get_absolute_path(): # # Returns: The absolute path of the element's workspace. |