diff options
author | Jan Tojnar <jtojnar@gmail.com> | 2021-01-07 13:04:31 +0100 |
---|---|---|
committer | Jan Tojnar <jtojnar@gmail.com> | 2021-01-07 13:04:31 +0100 |
commit | f19eb635b4585f6ba4f9f4c3e9e07f56623446f5 (patch) | |
tree | 4d64a15e34e8a2b54466ba165297a6bb08bfb280 /pkgs/build-support | |
parent | 0e4e47512d709e93c35fa575dd82e3e6ce4f884d (diff) | |
parent | 2be707eca80b573c931007de78c936d49ab45395 (diff) |
Merge branch 'master' into staging-next
https://github.com/NixOS/nixpkgs/commit/b04fc593e7b55fe1f74421b11589f12a339c92e2 seems to have accidentally changed mkDerivation function for dfilemanager and solarus-quest-editor so I have reverted that here.
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/docker/examples.nix | 11 | ||||
-rw-r--r-- | pkgs/build-support/docker/stream_layered_image.py | 6 |
2 files changed, 16 insertions, 1 deletions
diff --git a/pkgs/build-support/docker/examples.nix b/pkgs/build-support/docker/examples.nix index 85ddeb257405..86375a40baa0 100644 --- a/pkgs/build-support/docker/examples.nix +++ b/pkgs/build-support/docker/examples.nix @@ -416,4 +416,15 @@ rec { contents = crossPkgs.hello; }; + # layered image where a store path is itself a symlink + layeredStoreSymlink = + let + target = pkgs.writeTextDir "dir/target" "Content doesn't matter."; + symlink = pkgs.runCommandNoCC "symlink" {} "ln -s ${target} $out"; + in + pkgs.dockerTools.buildLayeredImage { + name = "layeredstoresymlink"; + tag = "latest"; + contents = [ pkgs.bash symlink ]; + } // { passthru = { inherit symlink; }; }; } diff --git a/pkgs/build-support/docker/stream_layered_image.py b/pkgs/build-support/docker/stream_layered_image.py index cbae0f723f92..e35bd0b0e8c0 100644 --- a/pkgs/build-support/docker/stream_layered_image.py +++ b/pkgs/build-support/docker/stream_layered_image.py @@ -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)) |