summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-02-01 11:02:46 +0000
committerJürg Billeter <j@bitron.ch>2019-02-11 05:12:25 +0000
commit7cf67ed3f05dc0754d19a6313501ae0f85fd6eec (patch)
treecd6254a891711d793760ac88ec33efcd84096c7b
parentd1da3fb085507a9bc1a576d37008ed5b18319aec (diff)
downloadbuildstream-7cf67ed3f05dc0754d19a6313501ae0f85fd6eec.tar.gz
_casbaseddirectory.py: Do not mimic os.walk() in list_relative_paths()
This matches the change in utils.list_relative_paths() that now sorts all symlinks as files, instead of following the broken behavior of os.walk().
-rw-r--r--buildstream/storage/_casbaseddirectory.py15
1 files changed, 1 insertions, 14 deletions
diff --git a/buildstream/storage/_casbaseddirectory.py b/buildstream/storage/_casbaseddirectory.py
index d88222273..09c8c9875 100644
--- a/buildstream/storage/_casbaseddirectory.py
+++ b/buildstream/storage/_casbaseddirectory.py
@@ -795,24 +795,11 @@ class CasBasedDirectory(Directory):
Return value: List(str) - list of all paths
"""
- symlink_list = filter(lambda i: isinstance(i[1].pb_object, remote_execution_pb2.SymlinkNode),
- self.index.items())
- file_list = list(filter(lambda i: isinstance(i[1].pb_object, remote_execution_pb2.FileNode),
+ file_list = list(filter(lambda i: not isinstance(i[1].buildstream_object, CasBasedDirectory),
self.index.items()))
directory_list = filter(lambda i: isinstance(i[1].buildstream_object, CasBasedDirectory),
self.index.items())
- # We need to mimic the behaviour of os.walk, in which symlinks
- # to directories count as directories and symlinks to file or
- # broken symlinks count as files. os.walk doesn't follow
- # symlinks, so we don't recurse.
- for (k, v) in sorted(symlink_list):
- target = self._resolve(k, absolute_symlinks_resolve=True)
- if isinstance(target, CasBasedDirectory):
- yield os.path.join(relpath, k)
- else:
- file_list.append((k, v))
-
if file_list == [] and relpath != "":
yield relpath
else: