mirror of
https://github.com/NixOS/nix.git
synced 2025-11-08 19:46:02 +01:00
installers, tests: remove --preserve=mode from cp invocations
-p preserves xattrs and acls which can be incompatible between filesystems Unfortunately keep -p on darwin because the bsd coreutils do not support --preserve. Fixes #13426
This commit is contained in:
parent
cf0df2607d
commit
87299e466d
5 changed files with 15 additions and 6 deletions
|
|
@ -834,8 +834,13 @@ install_from_extracted_nix() {
|
||||||
(
|
(
|
||||||
cd "$EXTRACTED_NIX_PATH"
|
cd "$EXTRACTED_NIX_PATH"
|
||||||
|
|
||||||
_sudo "to copy the basic Nix files to the new store at $NIX_ROOT/store" \
|
if is_os_darwin; then
|
||||||
cp -RPp ./store/* "$NIX_ROOT/store/"
|
_sudo "to copy the basic Nix files to the new store at $NIX_ROOT/store" \
|
||||||
|
cp -RPp ./store/* "$NIX_ROOT/store/"
|
||||||
|
else
|
||||||
|
_sudo "to copy the basic Nix files to the new store at $NIX_ROOT/store" \
|
||||||
|
cp -RP --preserve=ownership,timestamps ./store/* "$NIX_ROOT/store/"
|
||||||
|
fi
|
||||||
|
|
||||||
_sudo "to make the new store non-writable at $NIX_ROOT/store" \
|
_sudo "to make the new store non-writable at $NIX_ROOT/store" \
|
||||||
chmod -R ugo-w "$NIX_ROOT/store/"
|
chmod -R ugo-w "$NIX_ROOT/store/"
|
||||||
|
|
|
||||||
|
|
@ -167,7 +167,11 @@ for i in $(cd "$self/store" >/dev/null && echo ./*); do
|
||||||
rm -rf "$i_tmp"
|
rm -rf "$i_tmp"
|
||||||
fi
|
fi
|
||||||
if ! [ -e "$dest/store/$i" ]; then
|
if ! [ -e "$dest/store/$i" ]; then
|
||||||
cp -RPp "$self/store/$i" "$i_tmp"
|
if [ "$(uname -s)" = "Darwin" ]; then
|
||||||
|
cp -RPp "$self/store/$i" "$i_tmp"
|
||||||
|
else
|
||||||
|
cp -RP --preserve=ownership,timestamps "$self/store/$i" "$i_tmp"
|
||||||
|
fi
|
||||||
chmod -R a-w "$i_tmp"
|
chmod -R a-w "$i_tmp"
|
||||||
chmod +w "$i_tmp"
|
chmod +w "$i_tmp"
|
||||||
mv "$i_tmp" "$dest/store/$i"
|
mv "$i_tmp" "$dest/store/$i"
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ let
|
||||||
mkdir -p $out/archive
|
mkdir -p $out/archive
|
||||||
|
|
||||||
dir=NixOS-nixpkgs-${nixpkgs.shortRev}
|
dir=NixOS-nixpkgs-${nixpkgs.shortRev}
|
||||||
cp -prd ${nixpkgs} $dir
|
cp -rd --preserve=ownership,timestamps ${nixpkgs} $dir
|
||||||
# Set the correct timestamp in the tarball.
|
# Set the correct timestamp in the tarball.
|
||||||
find $dir -print0 | xargs -0 touch -h -t ${builtins.substring 0 12 nixpkgs.lastModifiedDate}.${
|
find $dir -print0 | xargs -0 touch -h -t ${builtins.substring 0 12 nixpkgs.lastModifiedDate}.${
|
||||||
builtins.substring 12 2 nixpkgs.lastModifiedDate
|
builtins.substring 12 2 nixpkgs.lastModifiedDate
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ let
|
||||||
|
|
||||||
nixpkgs-repo = pkgs.runCommand "nixpkgs-flake" { } ''
|
nixpkgs-repo = pkgs.runCommand "nixpkgs-flake" { } ''
|
||||||
dir=NixOS-nixpkgs-${nixpkgs.shortRev}
|
dir=NixOS-nixpkgs-${nixpkgs.shortRev}
|
||||||
cp -prd ${nixpkgs} $dir
|
cp -rd --preserve=ownership,timestamps ${nixpkgs} $dir
|
||||||
|
|
||||||
# Set the correct timestamp in the tarball.
|
# Set the correct timestamp in the tarball.
|
||||||
find $dir -print0 | xargs -0 touch -h -t ${builtins.substring 0 12 nixpkgs.lastModifiedDate}.${
|
find $dir -print0 | xargs -0 touch -h -t ${builtins.substring 0 12 nixpkgs.lastModifiedDate}.${
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ let
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
dir=nixpkgs-${nixpkgs.shortRev}
|
dir=nixpkgs-${nixpkgs.shortRev}
|
||||||
cp -prd ${nixpkgs} $dir
|
cp -rd --preserve=ownership,timestamps ${nixpkgs} $dir
|
||||||
# Set the correct timestamp in the tarball.
|
# Set the correct timestamp in the tarball.
|
||||||
find $dir -print0 | xargs -0 touch -h -t ${builtins.substring 0 12 nixpkgs.lastModifiedDate}.${
|
find $dir -print0 | xargs -0 touch -h -t ${builtins.substring 0 12 nixpkgs.lastModifiedDate}.${
|
||||||
builtins.substring 12 2 nixpkgs.lastModifiedDate
|
builtins.substring 12 2 nixpkgs.lastModifiedDate
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue