You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by no...@apache.org on 2020/12/29 12:54:19 UTC

[buildstream] 10/10: _artifact.py: Use CASCache.contains_directory_and_blobs()

This is an automated email from the ASF dual-hosted git repository.

not-in-ldap pushed a commit to branch juerg/public-data
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 958ddebf9057f0e16f396589f62ace66e6e67f53
Author: Jürg Billeter <j...@bitron.ch>
AuthorDate: Tue Apr 7 18:26:57 2020 +0200

    _artifact.py: Use CASCache.contains_directory_and_blobs()
---
 src/buildstream/_artifact.py | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/buildstream/_artifact.py b/src/buildstream/_artifact.py
index 0e1355f..10885f7 100644
--- a/src/buildstream/_artifact.py
+++ b/src/buildstream/_artifact.py
@@ -433,12 +433,10 @@ class Artifact:
         require_files = context.require_artifact_files or self._element._artifact_files_required()
 
         # Check whether 'files' subdirectory is available, with or without file contents
-        if str(artifact.files) and not self._cas.contains_directory(artifact.files, with_files=require_files):
-            self._cached = False
-            return False
-
         # Check whether public data is available
-        if not self._cas.contains_file(artifact.public_data):
+        if not self._cas.contains_directory_and_blobs(
+            artifact.files, [artifact.public_data], with_files=require_files
+        ):
             self._cached = False
             return False