From f08f882a8ff3231a30a27db866191feacbced8f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 19 Mar 2007 16:03:21 +0000 Subject: fixed symbolic link creation (stripped paths) svn path=/trunk/externals/zexy/; revision=7508 --- src/makealias.sh | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src/makealias.sh') diff --git a/src/makealias.sh b/src/makealias.sh index 4617bc9..7b5fef8 100755 --- a/src/makealias.sh +++ b/src/makealias.sh @@ -27,17 +27,29 @@ function debug() { } function do_makealias() { + local source + local dest + + source=$1 + dest=$2 + if [ "x${CLEANMODE}" = "xyes" ] then - if [ -e "$2" ]; then - debug "removing alias $2" - rm $2 + if [ -e "${dest}" ]; then + debug "removing alias ${dest}" + rm ${dest} else - debug "alias $2 does not exist" + debug "alias ${dest} does not exist" fi else - debug "aliasing $1 to $2" - ln -s $1 $2 + debug "aliasing ${source} to ${dest}" + if [ "x${COPYMODE}" = "xyes" ] + then + cp ${source} ${dest} + else + source=${source##*/} + ln -s ${source} ${dest} + fi fi } -- cgit v1.2.1