From 31ea6ec9108893d01ef08b3eb4483d3e42e3276e Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 29 Jun 2018 07:08:51 -0600 Subject: [PATCH] Update tools/link.sh per suggestions by Mark so that it can be used with MSYS vs copydir.sh. --- README.txt | 4 +++- tools/link.sh | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/README.txt b/README.txt index c0a150b8f51..5578ad44595 100644 --- a/README.txt +++ b/README.txt @@ -200,7 +200,9 @@ Using MSYS endif This will force the directory copies to work in a way that can be handled - by the NuttX build system. + by the NuttX build system. NOTE: The default link.sh script has been + updated so that is should now be MSYS2 compatible. The above is preferred + but no longer necessary in the Make.defs file. To build the simulator under MSYS, you also need: diff --git a/tools/link.sh b/tools/link.sh index f14e9e5abb2..1c343c94ca7 100755 --- a/tools/link.sh +++ b/tools/link.sh @@ -94,3 +94,18 @@ fi ln -s "${src}" "${dest}" || \ { echo "Failed to create link: $dest" ; exit 1 ; } + +# Verify that the link was created + +if [ ! -h ${dest} ]; then + # The MSYS 'ln' command actually does a directory copy + + if [ -d ${dest} ]; then + # Create the .fakelnk for unlink.sh + touch ${dest}/.fakelnk + else + echo "Error: link at ${dest} not created." + exit 1 + if +fi +