summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Pollard <tom.pollard@codethink.co.uk>2019-04-25 11:01:06 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-05-15 10:18:26 +0000
commitf84f0d727885c23bc8748b9a5c467d86714e69a2 (patch)
treec2314d6f522a828028f15792d9f33f1b0e9f3e37
parentf4f77391b206f9a50a8e7f5d1093761ec69f6402 (diff)
downloadbuildstream-f84f0d727885c23bc8748b9a5c467d86714e69a2.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.py17
-rw-r--r--buildstream/_cas/cascache.py22
2 files changed, 0 insertions, 39 deletions
diff --git a/buildstream/_artifactcache.py b/buildstream/_artifactcache.py
index 734a8e994..091b44dda 100644
--- a/buildstream/_artifactcache.py
+++ b/buildstream/_artifactcache.py
@@ -182,23 +182,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,