diff options
author | Jim MacArthur <jim.macarthur@codethink.co.uk> | 2018-10-05 13:40:57 +0100 |
---|---|---|
committer | Jim MacArthur <jim.macarthur@codethink.co.uk> | 2018-10-05 13:40:57 +0100 |
commit | c15e3931330379c44b138b01306f8b73d3cd9840 (patch) | |
tree | 13445748a26ec05930d802c6a3bbd7858949a4cb | |
parent | 7e984dffec01889051d952f1b20febee0fe062c5 (diff) | |
download | buildstream-c15e3931330379c44b138b01306f8b73d3cd9840.tar.gz |
_casbaseddirectory: Ingore '.' when resolving
-rw-r--r-- | buildstream/storage/_casbaseddirectory.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/buildstream/storage/_casbaseddirectory.py b/buildstream/storage/_casbaseddirectory.py index 5f6e897f3..640c90d07 100644 --- a/buildstream/storage/_casbaseddirectory.py +++ b/buildstream/storage/_casbaseddirectory.py @@ -280,7 +280,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) @@ -321,7 +323,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 |