From 5f70dd1a1f04f95f02ed3d65335f58f6a339b24c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Fri, 28 Jun 2019 00:13:24 +0300 Subject: [PATCH] Avoid errors when recreating an existing symlink on msys2 In this environment, symlinks don't exist but are made as copies. In such cases, the -n option to ln doesn't work for making this a no-op. Alternatively, we could append "|| true", which would print an error but continue. --- build-mingw-w64.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build-mingw-w64.sh b/build-mingw-w64.sh index 11b9ddc..8781ac0 100755 --- a/build-mingw-w64.sh +++ b/build-mingw-w64.sh @@ -76,7 +76,9 @@ if [ -z "$HOST" ]; then if [ -z "$SKIP_INCLUDE_TRIPLET_PREFIX" ]; then for arch in $ARCHS; do mkdir -p $PREFIX/$arch-w64-mingw32 - ln -sfn ../generic-w64-mingw32/include $PREFIX/$arch-w64-mingw32/include + if [ ! -e $PREFIX/$arch-w64-mingw32/include ]; then + ln -sfn ../generic-w64-mingw32/include $PREFIX/$arch-w64-mingw32/include + fi done fi