summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-06-24 17:59:19 -0700
committerunknown <jimw@mysql.com>2005-06-24 17:59:19 -0700
commit11d2bb945f676b15da65f197de49b076d2d75258 (patch)
treee739543018f913f681ffe52e60216ab0307237c5 /scripts
parenta7e66efc2cc37b8ca32868ac8c8e3e3c05675e48 (diff)
downloadmariadb-git-11d2bb945f676b15da65f197de49b076d2d75258.tar.gz
If mysql_config is a symlink, resolve it before trying to find the lib and
include directories relative to where it is located. (Bug #10986) scripts/mysql_config.sh: If mysql_config is a symlink, try to resolve it
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mysql_config.sh18
1 files changed, 13 insertions, 5 deletions
diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh
index a5c8af5ecb2..16e50c044ca 100644
--- a/scripts/mysql_config.sh
+++ b/scripts/mysql_config.sh
@@ -60,11 +60,19 @@ fix_path ()
get_full_path ()
{
- case $1 in
- /*) echo "$1";;
- ./*) tmp=`pwd`/$1; echo $tmp | sed -e 's;/\./;/;' ;;
- *) which $1 ;;
- esac
+ file=$1
+
+ # if the file is a symlink, try to resolve it
+ if [ -h $file ];
+ then
+ file=`ls -l $file | awk '{ print $NF }'`
+ fi
+
+ case $file in
+ /*) echo "$file";;
+ */*) tmp=`pwd`/$file; echo $tmp | sed -e 's;/\./;/;' ;;
+ *) which $file ;;
+ esac
}
me=`get_full_path $0`