You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by tv...@apache.org on 2021/02/04 08:09:16 UTC
[buildstream] 08/43: _casbaseddirectory: Ingore '.' when resolving
This is an automated email from the ASF dual-hosted git repository.
tvb pushed a commit to branch jmac/cas_to_cas_oct_v2
in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit f242af89126ede07b8dc028aea4eaf570f5a468e
Author: Jim MacArthur <ji...@codethink.co.uk>
AuthorDate: Fri Oct 5 13:40:57 2018 +0100
_casbaseddirectory: Ingore '.' when resolving
---
buildstream/storage/_casbaseddirectory.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/buildstream/storage/_casbaseddirectory.py b/buildstream/storage/_casbaseddirectory.py
index 22a6664..286d672 100644
--- a/buildstream/storage/_casbaseddirectory.py
+++ b/buildstream/storage/_casbaseddirectory.py
@@ -281,7 +281,9 @@ class CasBasedDirectory(Directory):
directory = root
components = symlink.target.split(CasBasedDirectory._pb2_path_sep)
for c in components:
- if c == "..":
+ if c == ".":
+ pass
+ elif c == "..":
directory = directory.parent
else:
directory = directory.descend(c, create=True)
@@ -322,7 +324,9 @@ class CasBasedDirectory(Directory):
# We ran out of path elements and ended up in a directory
return directory
c = components.pop(0)
- if c == "..":
+ if c == ".":
+ pass
+ elif c == "..":
print(" resolving {}: up-dir".format(c))
# If directory.parent *is* None, this is an attempt to access
# '..' from the root, which is valid under POSIX; it just