exists() is the wrong predicate; false-negatives on broken links
This commit is contained in:
parent
3290a8aefc
commit
92e5605f8c
1 changed files with 7 additions and 5 deletions
|
@ -28,12 +28,14 @@ class Vfs(object):
|
|||
|
||||
elif e[0] == "link":
|
||||
_, src, dest = e
|
||||
if dest.exists() and dest.is_symlink() and dest.readlink() == dest:
|
||||
continue
|
||||
else:
|
||||
if dest.exists():
|
||||
if dest.is_file() or dest.is_symlink():
|
||||
if dest.is_symlink() and dest.readlink() == src:
|
||||
continue
|
||||
else:
|
||||
dest.unlink()
|
||||
dest.symlink_to(src)
|
||||
|
||||
assert not dest.exists()
|
||||
dest.symlink_to(src)
|
||||
|
||||
elif e[0] == "copy":
|
||||
raise NotImplementedError()
|
||||
|
|
Loading…
Reference in a new issue