def backup(root, name):
"""Backup the given file."""
root = Base(".") if root is None else root
- path = _os.path.join(root.relative, root[name])
+ path = _os.path.join(root.absolute, root[name])
backup = "{}~".format(path)
try:
_os.unlink(backup)
dst_path = _os.path.join(dst_root.absolute, dst_root[dst_name])
_os.symlink(src_path, dst_path)
+
def unlink(root, name, backup=True):
"""Unlink a file, backing it up if necessary."""
root = Base(".") if root is None else root