1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 14:21:48 +02:00

Pass -P to cp to preserve symlinks

This is commonly the default behavior with -R, but POSIX leaves the
default unspecified.

(cherry picked from commit 10414d467b)
Signed-off-by: Domen Kožar <domen@dev.si>
This commit is contained in:
Michael Forney 2019-12-21 21:30:38 -08:00 committed by Domen Kožar
parent 90b3b31dc2
commit 8673883b40
No known key found for this signature in database
GPG key ID: C2FFBCAFD2C24246

View file

@ -102,7 +102,7 @@ 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 -Rp "$self/store/$i" "$i_tmp" cp -RPp "$self/store/$i" "$i_tmp"
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"