diff options
author | Tom Pollard <tom.pollard@codethink.co.uk> | 2019-04-25 11:01:06 +0100 |
---|---|---|
committer | Tom Pollard <tom.pollard@codethink.co.uk> | 2019-05-07 16:48:39 +0100 |
commit | b8f79fea99142c5025588ae7f1266e64884d0d3a (patch) | |
tree | 1130e34d3798d9257c91e8ac6deb9e4f9067e791 | |
parent | 055d543b435d00c4b3cb3cf8f93e627aabed52b3 (diff) | |
download | buildstream-b8f79fea99142c5025588ae7f1266e64884d0d3a.tar.gz |
_cas/cascache.py: Remove contains_subdir_artifact()
This method is no longer used and as such can be removed.
-rw-r--r-- | buildstream/_artifactcache.py | 17 | ||||
-rw-r--r-- | buildstream/_cas/cascache.py | 22 |
2 files changed, 0 insertions, 39 deletions
diff --git a/buildstream/_artifactcache.py b/buildstream/_artifactcache.py index e40ba54c6..99ee9c00a 100644 --- a/buildstream/_artifactcache.py +++ b/buildstream/_artifactcache.py @@ -181,23 +181,6 @@ class ArtifactCache(BaseCache): return os.path.exists(os.path.join(self.artifactdir, ref)) - # contains_subdir_artifact(): - # - # Check whether an artifact element contains a digest for a subdir - # which is populated in the cache, i.e non dangling. - # - # Args: - # element (Element): The Element to check - # key (str): The cache key to use - # subdir (str): The subdir to check - # with_files (bool): Whether to check files as well - # - # Returns: True if the subdir exists & is populated in the cache, False otherwise - # - def contains_subdir_artifact(self, element, key, subdir, *, with_files=True): - ref = element.get_artifact_name(key) - return self.cas.contains_subdir_artifact(ref, subdir, with_files=with_files) - # list_artifacts(): # # List artifacts in this cache in LRU order. diff --git a/buildstream/_cas/cascache.py b/buildstream/_cas/cascache.py index 6d76de14a..ad8013d18 100644 --- a/buildstream/_cas/cascache.py +++ b/buildstream/_cas/cascache.py @@ -116,28 +116,6 @@ class CASCache(): # This assumes that the repository doesn't have any dangling pointers return os.path.exists(refpath) - # contains_subdir_artifact(): - # - # Check whether the specified artifact element tree has a digest for a subdir - # which is populated in the cache, i.e non dangling. - # - # Args: - # ref (str): The ref to check - # subdir (str): The subdir to check - # with_files (bool): Whether to check files as well - # - # Returns: True if the subdir exists & is populated in the cache, False otherwise - # - def contains_subdir_artifact(self, ref, subdir, *, with_files=True): - tree = self.resolve_ref(ref) - - try: - subdirdigest = self._get_subdir(tree, subdir) - - return self.contains_directory(subdirdigest, with_files=with_files) - except (CASCacheError, FileNotFoundError): - return False - # contains_directory(): # # Check whether the specified directory and subdirecotires are in the cache, |