From 8673883b40fde88d8406d78aacce0e8fef6458b9 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sat, 21 Dec 2019 21:30:38 -0800 Subject: [PATCH] Pass -P to cp to preserve symlinks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is commonly the default behavior with -R, but POSIX leaves the default unspecified. (cherry picked from commit 10414d467b392f285007edeb9e5ca897057adddf) Signed-off-by: Domen Kožar --- scripts/install-nix-from-closure.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install-nix-from-closure.sh b/scripts/install-nix-from-closure.sh index 3f1581854..3fea7e056 100644 --- a/scripts/install-nix-from-closure.sh +++ b/scripts/install-nix-from-closure.sh @@ -102,7 +102,7 @@ for i in $(cd "$self/store" >/dev/null && echo ./*); do rm -rf "$i_tmp" fi 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 +w "$i_tmp" mv "$i_tmp" "$dest/store/$i"