stdenv moveToOutput: move even broken symlinks
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).
This commit is contained in:
parent
7a88f314cb
commit
97853c07d7
@ -98,7 +98,8 @@ moveToOutput() {
|
|||||||
if [ "${!output}" = "$dstOut" ]; then continue; fi
|
if [ "${!output}" = "$dstOut" ]; then continue; fi
|
||||||
local srcPath
|
local srcPath
|
||||||
for srcPath in "${!output}"/$patt; do
|
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
|
if [ "$dstOut" = REMOVE ]; then
|
||||||
echo "Removing $srcPath"
|
echo "Removing $srcPath"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user