summaryrefslogtreecommitdiffstats
path: root/functions.cmake
diff options
context:
space:
mode:
authorHåkon Hallingstad <hakon@verizonmedia.com>2019-04-30 11:27:39 +0200
committerHåkon Hallingstad <hakon@verizonmedia.com>2019-04-30 11:27:39 +0200
commitab363b600adebb7ca6d981166f3adff14735a33a (patch)
treed27e58befbcec4631b97202bc2b0d4fd48b0a960 /functions.cmake
parent8b9248617d3853e1e73a29e19a5002ecdd8d231c (diff)
Avoid dereferencing symlink
The call install_symlink(conf/configserver-app/components lib/jars/config-models) would on first invocation install the symlink at lib/jars/config-models to point at .../components. This is what we want. But if invoked again, it would note config-models is a directory, and therefore prepare to install a symlink in that directory. The name of the symlink would be taken from the target (components). And therefore conf/configserver-app/components/components would point to conf/configserver-app/components! With -n, symlinks targets are not dereferenced and therefore the second invocation should be a no-op (with -f).
Diffstat (limited to 'functions.cmake')
-rw-r--r--functions.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/functions.cmake b/functions.cmake
index 2b460c8c5ea..eb29a9ffe22 100644
--- a/functions.cmake
+++ b/functions.cmake
@@ -559,7 +559,7 @@ function(install_fat_java_artifact NAME)
endfunction()
function(install_absolute_symlink TARGET LINK)
- install(CODE "execute_process(COMMAND ln -sf ${TARGET} \$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/${LINK})")
+ install(CODE "execute_process(COMMAND ln -snf ${TARGET} \$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/${LINK})")
endfunction(install_absolute_symlink)
function(install_symlink TARGET LINK)