| 775 | # TODO: Ensure the target and dest are the same if the file already exists. |
| 776 | |
| 777 | def symlink( |
| 778 | self, |
| 779 | src, # type: str |
| 780 | dst, # type: str |
| 781 | label=None, # type: Optional[str] |
| 782 | compress=True, # type: bool |
| 783 | ): |
| 784 | # type: (...) -> None |
| 785 | dst = self._normalize(dst) |
| 786 | self._tag(dst, label, compress) |
| 787 | self._ensure_parent(dst) |
| 788 | abs_src = os.path.realpath(src) |
| 789 | abs_dst = os.path.realpath(os.path.join(self.chroot, dst)) |
| 790 | safe_relative_symlink(abs_src, abs_dst) |
| 791 | |
| 792 | def write( |
| 793 | self, |