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:
|
for path in paths:
|
||||||
path = pathlib.Path(path)
|
path = pathlib.Path(path)
|
||||||
|
if path.is_symlink():
|
||||||
|
files = [path]
|
||||||
|
else:
|
||||||
files = itertools.chain([path], path.rglob("*"))
|
files = itertools.chain([path], path.rglob("*"))
|
||||||
|
|
||||||
for filename in sorted(files):
|
for filename in sorted(files):
|
||||||
ti = append_root(tar.gettarinfo(filename))
|
ti = append_root(tar.gettarinfo(filename))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user