dockerTools: Properly add /nix/ and /nix/store/ first to layer.tar
In https://github.com/NixOS/nixpkgs/pull/58431 the authors ensured that the resulting layer.tar would always list /nix/ /nix/store/ first to fully comply to the tar spec. Various refactorings later it is only ensured to create /nix/ but NOT /nix/store anymore. Instead tar transformed them to /nix/nix and /nix/nix/store.
This commit is contained in:
parent
8c9fe503e4
commit
886c92332c
|
@ -30,12 +30,13 @@ mkdir -p nix/store
|
||||||
# store path to the absolute store path.
|
# store path to the absolute store path.
|
||||||
tarhash=$(
|
tarhash=$(
|
||||||
basename -a "$@" |
|
basename -a "$@" |
|
||||||
tar -cp nix \
|
tar --create --preserve-permissions --absolute-names nix \
|
||||||
-C /nix/store --verbatim-files-from --files-from - \
|
--directory /nix/store --verbatim-files-from --files-from - \
|
||||||
--hard-dereference --sort=name \
|
--hard-dereference --sort=name \
|
||||||
--mtime="@$SOURCE_DATE_EPOCH" \
|
--mtime="@$SOURCE_DATE_EPOCH" \
|
||||||
--owner=0 --group=0 \
|
--owner=0 --group=0 \
|
||||||
--transform 's,^nix(/|$),/nix/,' \
|
--transform 's,^nix$,/\0,' \
|
||||||
|
--transform 's,^nix/store$,/\0,' \
|
||||||
--transform 's,^[^/],/nix/store/\0,rS' |
|
--transform 's,^[^/],/nix/store/\0,rS' |
|
||||||
tee "$layerPath/layer.tar" |
|
tee "$layerPath/layer.tar" |
|
||||||
tarsum
|
tarsum
|
||||||
|
|
Loading…
Reference in a new issue