diff options
author | Jürg Billeter <j@bitron.ch> | 2019-02-11 07:13:28 +0000 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2019-02-11 07:13:28 +0000 |
commit | c07cc967debeaa0bf3dfc46cbcd98a416e2f5370 (patch) | |
tree | a218c79bfb6b4e1bc8ed19517c4a87b857aa1d34 /buildstream/storage/_casbaseddirectory.py | |
parent | 5e1be71f1816e4782eec50ad36ede227402be9b2 (diff) | |
parent | 7ec0bb5e06c83646611954b4a15da87442b73d4c (diff) | |
download | buildstream-c07cc967debeaa0bf3dfc46cbcd98a416e2f5370.tar.gz |
Merge branch 'juerg/symlinks' into 'master'
Symlink fixes
See merge request BuildStream/buildstream!1138
Diffstat (limited to 'buildstream/storage/_casbaseddirectory.py')
-rw-r--r-- | buildstream/storage/_casbaseddirectory.py | 15 |
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: |