summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2019-01-14 15:55:21 +0100
committerSergei Golubchik <serg@mariadb.org>2019-01-21 17:30:07 +0100
commit9c5be7d131f7eb7f27df722463faa2cd8135fd1b (patch)
treeb6f678238825dce93aa61692e4b1cd80e1ced128 /scripts
parent50e593386fcbaa1ca7bd2ed9fdfc51fd5102cdab (diff)
downloadmariadb-git-9c5be7d131f7eb7f27df722463faa2cd8135fd1b.tar.gz
MDEV-14580: mysql_install_db elements based on dirname of mysql_install_db
Avoid introducing new dependencies or new syntax. That is, don't use $(...) and don't assume dirname is present. And remove unsighty /foo/bar/../xyz from the path. Use dirname instead of ../
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mysql_install_db.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index f1249e1d06b..9f00562f4bd 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -36,6 +36,9 @@ in_rpm=0
ip_only=0
cross_bootstrap=0
+dirname0=`dirname $0 2>/dev/null`
+dirname0=`dirname $dirname0 2>/dev/null`
+
usage()
{
cat <<EOF
@@ -253,9 +256,9 @@ then
cannot_find_file my_print_defaults $basedir/bin $basedir/extra
exit 1
fi
-elif test -x "$(dirname $0)/../@bindir@/my_print_defaults"
+elif test -n "$dirname0" -a -x "$dirname0/@bindir@/my_print_defaults"
then
- print_defaults="$(dirname $0)/../@bindir@/my_print_defaults"
+ print_defaults="$dirname0/@bindir@/my_print_defaults"
else
print_defaults="@bindir@/my_print_defaults"
fi
@@ -308,9 +311,9 @@ then
exit 1
fi
# relative from where the script was run for a relocatable install
-elif test -x "$(dirname $0)/../@INSTALL_SBINDIR@/mysqld"
+elif test -n "$dirname0" -a -x "$dirname0/@INSTALL_SBINDIR@/mysqld"
then
- basedir="$(dirname $0)/../"
+ basedir="$dirname0"
bindir="$basedir/@INSTALL_SBINDIR@"
resolveip="$bindir/resolveip"
mysqld="$basedir/@INSTALL_SBINDIR@/mysqld"