mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 08:23:09 +00:00
dockerTools: Fix streamLayeredImage for symlinks
When archiving `/nix/store/foo` and `foo` is itself a symlink, we must not traverse the symlink target, but archive the `foo` symlink itself
This commit is contained in:
parent
56bb1b0f7a
commit
08b0d02944
@ -83,7 +83,11 @@ def archive_paths_to(obj, paths, mtime):
|
||||
|
||||
for path in paths:
|
||||
path = pathlib.Path(path)
|
||||
files = itertools.chain([path], path.rglob("*"))
|
||||
if path.is_symlink():
|
||||
files = [path]
|
||||
else:
|
||||
files = itertools.chain([path], path.rglob("*"))
|
||||
|
||||
for filename in sorted(files):
|
||||
ti = append_root(tar.gettarinfo(filename))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user