mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 18:41:56 +01:00
get correct paths in mysql_config even if the user moves basedir
This commit is contained in:
parent
e57311045f
commit
2f91f2360a
1 changed files with 39 additions and 0 deletions
|
@ -18,11 +18,50 @@
|
||||||
# This script reports various configuration settings that may be needed
|
# This script reports various configuration settings that may be needed
|
||||||
# when using the MySQL client library.
|
# when using the MySQL client library.
|
||||||
|
|
||||||
|
which ()
|
||||||
|
{
|
||||||
|
IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
|
||||||
|
for file
|
||||||
|
do
|
||||||
|
for dir in $PATH
|
||||||
|
do
|
||||||
|
if test -f $dir/$file
|
||||||
|
then
|
||||||
|
echo "$dir/$file"
|
||||||
|
continue 2
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo "which: no $file in ($PATH)"
|
||||||
|
exit 1
|
||||||
|
done
|
||||||
|
IFS="$save_ifs"
|
||||||
|
}
|
||||||
|
|
||||||
|
fix_path ()
|
||||||
|
{
|
||||||
|
eval path=\$"$1"
|
||||||
|
if [ ! -f "$path" ] ;
|
||||||
|
then
|
||||||
|
eval "$1"=$basedir/$2
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
abs_path=`expr \( substr $0 1 1 \) = '/'`
|
||||||
|
if [ "x$abs_path" = "x1" ] ; then
|
||||||
|
me=$0
|
||||||
|
else
|
||||||
|
me=`which mysql_config`
|
||||||
|
fi
|
||||||
|
|
||||||
|
basedir=`echo $me | sed -e 's;/bin/mysql_config;;'`
|
||||||
|
|
||||||
ldata='@localstatedir@'
|
ldata='@localstatedir@'
|
||||||
execdir='@libexecdir@'
|
execdir='@libexecdir@'
|
||||||
bindir='@bindir@'
|
bindir='@bindir@'
|
||||||
pkglibdir='@pkglibdir@'
|
pkglibdir='@pkglibdir@'
|
||||||
|
fix_path pkglibdir lib/mysql
|
||||||
pkgincludedir='@pkgincludedir@'
|
pkgincludedir='@pkgincludedir@'
|
||||||
|
fix_path pkgincludedir include/mysql
|
||||||
version='@VERSION@'
|
version='@VERSION@'
|
||||||
socket='@MYSQL_UNIX_ADDR@'
|
socket='@MYSQL_UNIX_ADDR@'
|
||||||
port='@MYSQL_TCP_PORT@'
|
port='@MYSQL_TCP_PORT@'
|
||||||
|
|
Loading…
Add table
Reference in a new issue