combine.py: handle symlinks when copying tree
By default `copy_tree` do not preserve symlinks and tries to resolve them. If the symlinks is pointing to a non-existent target it will fail. This fixes that by copying symlinks as such, aka preserve_symlinks. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
parent
55b82345ef
commit
a5e7a9fefa
1 changed files with 2 additions and 2 deletions
|
|
@ -51,7 +51,7 @@ def commit_repo(repo: Repo, message: str, path: Path) -> Repo:
|
|||
assert tmp is not None
|
||||
|
||||
try:
|
||||
copy_tree(repo_source(repo.name), tmp.name)
|
||||
copy_tree(repo_source(repo.name), tmp.name, preserve_symlinks=1)
|
||||
shutil.rmtree(repo_path, ignore_errors=True)
|
||||
os.rename(tmp.name, repo_path)
|
||||
tmp = None
|
||||
|
|
@ -169,7 +169,7 @@ def setup_combined() -> None:
|
|||
write_json_file(dict(repos={}), manifest_path)
|
||||
|
||||
manifest_lib = "lib"
|
||||
copy_tree(str(ROOT.joinpath("lib")), manifest_lib)
|
||||
copy_tree(str(ROOT.joinpath("lib")), manifest_lib, preserve_symlinks=1)
|
||||
default_nix = "default.nix"
|
||||
shutil.copy(ROOT.joinpath("default.nix"), default_nix)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue