summaryrefslogtreecommitdiff
path: root/src/buildstream/storage
diff options
context:
space:
mode:
authorWilliam Salmon <will.salmon@codethink.co.uk>2019-05-21 13:33:25 +0100
committerWilliam Salmon <will.salmon@codethink.co.uk>2019-07-25 13:57:18 +0100
commit2f52b19ebc18fcefe70c8c04037b735b95c7bcf9 (patch)
tree978a52c61ec982a39dd650b12f12802671507ed5 /src/buildstream/storage
parent455323471868f653b0a305b9dc7d2a2dde2b9753 (diff)
downloadbuildstream-2f52b19ebc18fcefe70c8c04037b735b95c7bcf9.tar.gz
Update sandbox to use virtual directories
Diffstat (limited to 'src/buildstream/storage')
-rw-r--r--src/buildstream/storage/_filebaseddirectory.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/buildstream/storage/_filebaseddirectory.py b/src/buildstream/storage/_filebaseddirectory.py
index a083f6507..07c23c192 100644
--- a/src/buildstream/storage/_filebaseddirectory.py
+++ b/src/buildstream/storage/_filebaseddirectory.py
@@ -285,3 +285,12 @@ class FileBasedDirectory(Directory):
assert entry.type == _FileType.SYMLINK
os.symlink(entry.target, dest_path)
result.files_written.append(relative_pathname)
+
+ def _exists(self, *path, follow_symlinks=False):
+ """This is very simple but mirrors the cas based storage were it is less trivial"""
+ if follow_symlinks:
+ # The lexists is not ideal as it cant spot broken symlinks but this is a long
+ # standing bug in buildstream as exists follow absolute syslinks to real root
+ # and incorrectly thinks they are broken the new casbaseddirectory dose not have this bug.
+ return os.path.lexists(os.path.join(self.external_directory, *path))
+ raise ImplError("_exists can only follow symlinks in filebaseddirectory")