summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-02-25 07:50:36 +0100
committerJürg Billeter <j@bitron.ch>2019-02-28 05:14:47 +0100
commit022311c63d2d2c3b4fd8899adcfeaee283cc8bb2 (patch)
treea4f177b151865842c72486022c0a45f497dc1d6d
parentb93cd889d4d981967bfe82a70841291e6d7002b4 (diff)
downloadbuildstream-022311c63d2d2c3b4fd8899adcfeaee283cc8bb2.tar.gz
_casbaseddirectory.py: Add _objpath() method
-rw-r--r--buildstream/storage/_casbaseddirectory.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/buildstream/storage/_casbaseddirectory.py b/buildstream/storage/_casbaseddirectory.py
index 2c1f465c3..fd88cc1b0 100644
--- a/buildstream/storage/_casbaseddirectory.py
+++ b/buildstream/storage/_casbaseddirectory.py
@@ -591,3 +591,8 @@ class CasBasedDirectory(Directory):
if not self.ref:
self.ref = self.cas_cache.add_object(buffer=self.pb2_directory.SerializeToString())
return self.ref
+
+ def _objpath(self, path):
+ subdir = self.descend(path[:-1])
+ entry = subdir.index[path[-1]]
+ return self.cas_cache.objpath(entry.pb_object.digest)