diff options
author | Jürg Billeter <j@bitron.ch> | 2019-02-25 07:57:09 +0100 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2019-02-28 12:12:38 +0100 |
commit | 7e88f2e60d6ee00e2572be2f952b207b314d5db9 (patch) | |
tree | c2279cddd049d8288ce92801b136c2e7c6dde32d | |
parent | 296351f68a358b700c981c3f3ffd5c01bf9d1139 (diff) | |
download | buildstream-7e88f2e60d6ee00e2572be2f952b207b314d5db9.tar.gz |
_casbaseddirectory.py: Add _exists() method
-rw-r--r-- | buildstream/storage/_casbaseddirectory.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/buildstream/storage/_casbaseddirectory.py b/buildstream/storage/_casbaseddirectory.py index fd88cc1b0..bd72e7c1c 100644 --- a/buildstream/storage/_casbaseddirectory.py +++ b/buildstream/storage/_casbaseddirectory.py @@ -596,3 +596,10 @@ class CasBasedDirectory(Directory): subdir = self.descend(path[:-1]) entry = subdir.index[path[-1]] return self.cas_cache.objpath(entry.pb_object.digest) + + def _exists(self, path): + try: + subdir = self.descend(path[:-1]) + return path[-1] in subdir.index + except VirtualDirectoryError: + return False |