Use relative target in symlinks to modified files in view (#42699)

This commit is contained in:
Harmen Stoppels
2024-02-19 16:33:38 +01:00
committed by GitHub
parent ad6dc0d103
commit 0ee3a3c401
2 changed files with 2 additions and 2 deletions

View File

@@ -180,7 +180,7 @@ def add_files_to_view(self, view, merge_map, skip_if_exists=True):
except (OSError, KeyError):
target = None
if target:
os.symlink(target, dst)
os.symlink(os.path.relpath(target, os.path.dirname(dst)), dst)
else:
view.link(src, dst, spec=self.spec)

View File

@@ -1306,7 +1306,7 @@ def add_files_to_view(self, view, merge_map, skip_if_exists=True):
except (OSError, KeyError):
target = None
if target:
os.symlink(target, dst)
os.symlink(os.path.relpath(target, os.path.dirname(dst)), dst)
else:
view.link(src, dst, spec=self.spec)