wineprefixcreate: Only create links for files that don't exist.

Make a copy instead of a link if the original file is writable.
This commit is contained in:
Alexandre Julliard 2006-01-24 13:43:33 +01:00
parent ab5ca5c048
commit 2d3bd3e45a
1 changed files with 10 additions and 1 deletions

View File

@ -145,7 +145,16 @@ done
link_app()
{
rm -f "$2" && ln -s "$dlldir/$1.exe.so" "$2" || echo "Warning: failed to create $2"
if [ ! -f "$2" ]
then
# make a copy if the original is writable
if [ -w "$dlldir/$1.exe.so" ]
then
cp "$dlldir/$1.exe.so" "$2" || echo "Warning: failed to create $2"
else
ln -s "$dlldir/$1.exe.so" "$2" || echo "Warning: failed to create $2"
fi
fi
}
link_app start "$CROOT/windows/command/start.exe"