Skip to content

Commit

Permalink
stdenv moveToOutput: move even broken symlinks
Browse files Browse the repository at this point in the history
I believe this reduces surprises and is actually simpler semantically.
This is important e.g. for relative symlinks when moving both source
and target - now the order of moving won't matter.

Fixes #20723 (a particular instance of the surprise).
  • Loading branch information
vcunat committed Nov 26, 2016
1 parent 7a88f31 commit 97853c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkgs/build-support/setup-hooks/multiple-outputs.sh
Expand Up @@ -98,7 +98,8 @@ moveToOutput() {
if [ "${!output}" = "$dstOut" ]; then continue; fi
local srcPath
for srcPath in "${!output}"/$patt; do
if [ ! -e "$srcPath" ]; then continue; fi
# apply to existing files/dirs, *including* broken symlinks
if [ ! -e "$srcPath" ] && [ ! -L "$srcPath" ]; then continue; fi

if [ "$dstOut" = REMOVE ]; then
echo "Removing $srcPath"
Expand Down

0 comments on commit 97853c0

Please sign in to comment.