summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-03-13 12:08:37 +0000
committerbst-marge-bot <marge-bot@buildstream.build>2019-03-27 16:24:32 +0000
commit954718fa02bdddb23f3753a7bfe1abe39d555e94 (patch)
treeb620f75b4be8b47012770abe506145ad1429956c
parent0db007537ad217c22884c14e60b5e8bedf010e13 (diff)
downloadbuildstream-954718fa02bdddb23f3753a7bfe1abe39d555e94.tar.gz
cascache.py: Add local_missing_blobs() method
-rw-r--r--buildstream/_cas/cascache.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/buildstream/_cas/cascache.py b/buildstream/_cas/cascache.py
index bb5233813..ce51fb25e 100644
--- a/buildstream/_cas/cascache.py
+++ b/buildstream/_cas/cascache.py
@@ -679,6 +679,23 @@ class CASCache():
return missing_blobs.values()
+ # local_missing_blobs():
+ #
+ # Check local cache for missing blobs.
+ #
+ # Args:
+ # digests (list): The Digests of blobs to check
+ #
+ # Returns: Missing Digest objects
+ #
+ def local_missing_blobs(self, digests):
+ missing_blobs = []
+ for digest in digests:
+ objpath = self.objpath(digest)
+ if not os.path.exists(objpath):
+ missing_blobs.append(digest)
+ return missing_blobs
+
################################################
# Local Private Methods #
################################################