summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2020-03-03 15:40:07 +0100
committerJürg Billeter <j@bitron.ch>2020-03-10 15:46:04 +0000
commit7ff10230c634078d440eb7ff0e05155e956644f3 (patch)
tree46d63d70ceed2a4efbaf578849487e56952188e9
parent77138b8a5ec78c701c7d93de1bd74e58ed023467 (diff)
downloadbuildstream-7ff10230c634078d440eb7ff0e05155e956644f3.tar.gz
_casbaseddirectory.py: Mark find_root() method internal
It's not defined in the abstract `Directory` class and is not expected to be needed by plugins.
-rw-r--r--src/buildstream/storage/_casbaseddirectory.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/buildstream/storage/_casbaseddirectory.py b/src/buildstream/storage/_casbaseddirectory.py
index d700a25a6..e4b267a63 100644
--- a/src/buildstream/storage/_casbaseddirectory.py
+++ b/src/buildstream/storage/_casbaseddirectory.py
@@ -313,14 +313,6 @@ class CasBasedDirectory(Directory):
self.__invalidate_digest()
- def find_root(self):
- """ Finds the root of this directory tree by following 'parent' until there is
- no parent. """
- if self.parent:
- return self.parent.find_root()
- else:
- return self
-
def descend(self, *paths, create=False, follow_symlinks=False):
"""Descend one or more levels of directory hierarchy and return a new
Directory object for that directory.
@@ -355,7 +347,7 @@ class CasBasedDirectory(Directory):
linklocation = entry.target
newpaths = linklocation.split(os.path.sep)
if os.path.isabs(linklocation):
- current_dir = current_dir.find_root().descend(*newpaths, follow_symlinks=True)
+ current_dir = current_dir._find_root().descend(*newpaths, follow_symlinks=True)
else:
current_dir = current_dir.descend(*newpaths, follow_symlinks=True)
else:
@@ -749,6 +741,14 @@ class CasBasedDirectory(Directory):
"_get_underlying_directory was called on a CAS-backed directory," + " which has no underlying directory."
)
+ def _find_root(self):
+ """ Finds the root of this directory tree by following 'parent' until there is
+ no parent. """
+ if self.parent:
+ return self.parent._find_root()
+ else:
+ return self
+
# _get_digest():
#
# Return the Digest for this directory.
@@ -804,7 +804,7 @@ class CasBasedDirectory(Directory):
linklocation = target.target
newpath = linklocation.split(os.path.sep)
if os.path.isabs(linklocation):
- return subdir.find_root()._exists(*newpath, follow_symlinks=True)
+ return subdir._find_root()._exists(*newpath, follow_symlinks=True)
return subdir._exists(*newpath, follow_symlinks=True)
else:
return True