summaryrefslogtreecommitdiff
path: root/nuttx/tools
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-11-11 07:00:18 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-11-11 07:00:18 -0600
commit653ee19c65eeda001b3af4bfe5b15888fc124933 (patch)
tree4bb56acb940bd2bbefa08d0f1df422e3fd4472d9 /nuttx/tools
parentfaeb86d7950d3f4a466c6071941534ad5d9215e5 (diff)
downloadnuttx-653ee19c65eeda001b3af4bfe5b15888fc124933.tar.gz
nuttx-653ee19c65eeda001b3af4bfe5b15888fc124933.tar.bz2
nuttx-653ee19c65eeda001b3af4bfe5b15888fc124933.zip
Check link target - do nothing if link is already created and the target matches the request. From Freddie Chopin.
Diffstat (limited to 'nuttx/tools')
-rwxr-xr-xnuttx/tools/link.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/nuttx/tools/link.sh b/nuttx/tools/link.sh
index da1e6e7ae..f14e9e5ab 100755
--- a/nuttx/tools/link.sh
+++ b/nuttx/tools/link.sh
@@ -51,6 +51,15 @@ fi
# report that it does not exist.
if [ -h "${dest}" ]; then
+
+ # If the link is already created (and matches the request) do nothing
+
+ if [ "$(readlink ${dest})" = "${src}" ]; then
+ exit 0
+ fi
+
+ # Otherwise, remove the link
+
rm -f "${dest}"
else