summaryrefslogtreecommitdiff
path: root/hook-functions
diff options
context:
space:
mode:
Diffstat (limited to 'hook-functions')
-rw-r--r--hook-functions10
1 files changed, 9 insertions, 1 deletions
diff --git a/hook-functions b/hook-functions
index d3fe0a3..000c701 100644
--- a/hook-functions
+++ b/hook-functions
@@ -54,7 +54,15 @@ manual_add_modules()
# $1 is source
# $2 is relative destination
copy_exec() {
- ln -s ${1} ${DESTDIR}/${2}
+ final_destination=${DESTDIR}/${2}/`basename ${1}`
+ if [ -L "$final_destination" ]; then
+ if ! [ `readlink ${final_destination}` = "${1}" ]; then
+ echo "W:copy_exec: Not copying ${1} to \$DESTDIR${2}/`basename ${1}`, which is already a copy of `readlink ${final_destination}`" >&2
+ return
+ fi
+ else
+ ln -s ${1} ${DESTDIR}/${2}
+ fi
# Copy the dependant libraries
for x in $(ldd ${1} 2>/dev/null | sed -e '