summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-03-14 14:04:27 +0000
committerJürg Billeter <j@bitron.ch>2019-03-25 10:24:41 +0100
commit1e8beb0e681c2bdd5db37b564e8efb8799acd0b3 (patch)
tree5f6c2abb1a0fe9ae586305be337992a174f09252
parent98c8acad4f471f2ab65148367af05425789a58a6 (diff)
downloadbuildstream-1e8beb0e681c2bdd5db37b564e8efb8799acd0b3.tar.gz
cascache.py: Drop _fetch_subdir()
With partial CAS support, we can no longer assume that all files in a directory are in the local cache. Always use _fetch_directory() in pull() to ensure we fetch all blobs that may be missing.
-rw-r--r--buildstream/_cas/cascache.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/buildstream/_cas/cascache.py b/buildstream/_cas/cascache.py
index 6d52aaa0d..e7ad34b1c 100644
--- a/buildstream/_cas/cascache.py
+++ b/buildstream/_cas/cascache.py
@@ -243,12 +243,8 @@ class CASCache():
tree.hash = response.digest.hash
tree.size_bytes = response.digest.size_bytes
- # Check if the element artifact is present, if so just fetch the subdir.
- if subdir and os.path.exists(self.objpath(tree)):
- self._fetch_subdir(remote, tree, subdir)
- else:
- # Fetch artifact, excluded_subdirs determined in pullqueue
- self._fetch_directory(remote, tree, excluded_subdirs=excluded_subdirs)
+ # Fetch artifact, excluded_subdirs determined in pullqueue
+ self._fetch_directory(remote, tree, excluded_subdirs=excluded_subdirs)
self.set_ref(ref, tree)
@@ -968,10 +964,6 @@ class CASCache():
# Fetch final batch
self._fetch_directory_batch(remote, batch, fetch_queue, fetch_next_queue)
- def _fetch_subdir(self, remote, tree, subdir):
- subdirdigest = self._get_subdir(tree, subdir)
- self._fetch_directory(remote, subdirdigest)
-
def _fetch_tree(self, remote, digest):
# download but do not store the Tree object
with utils._tempnamedfile(dir=self.tmpdir) as out: