summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDarius Makovsky <traveltissues@protonmail.com>2019-12-05 12:17:52 +0000
committerbst-marge-bot <marge-bot@buildstream.build>2019-12-09 08:08:31 +0000
commitbabb70f1e1313ed24752563b951dabb070dea6c1 (patch)
treefdcbae1393211866a5c91f3f9d93ac799e629b42 /src
parenteb6c76023fdee4211828e9b012a331cfff230b49 (diff)
downloadbuildstream-babb70f1e1313ed24752563b951dabb070dea6c1.tar.gz
_workspaces: remove get_key()
Diffstat (limited to 'src')
-rw-r--r--src/buildstream/_workspaces.py38
1 files changed, 0 insertions, 38 deletions
diff --git a/src/buildstream/_workspaces.py b/src/buildstream/_workspaces.py
index 6db27db38..49b76a7b9 100644
--- a/src/buildstream/_workspaces.py
+++ b/src/buildstream/_workspaces.py
@@ -338,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.