summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDaniel Black <daniel@linux.ibm.com>2019-04-15 09:13:47 +1000
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2019-07-01 13:52:28 +0300
commitd890c45b62c0d841b464a0d3539f2c99f241aacf (patch)
tree41fdea9b60121aa5e0b18f2032ed870e17cf53be /scripts
parent69be8f3c5bdd507fa924194f8b15f6bc90a01f3b (diff)
downloadmariadb-git-d890c45b62c0d841b464a0d3539f2c99f241aacf.tar.gz
mysql_install_db: assume builddir is dirname0
The assumption in the original commit for --builddir (648d3cedbc09), was to assume that without a --builddir, and when --srcdir is specified, that the builddir is the same as the srcdir. The problem is that this assumption does not hold for out-of-source builds and we can figure out the builddir by looking for where mysql_install_db script is. As mysql_install_db is in the builddir, we use dirname0 as the builddir after checking that my_print_defaults is also located from dirname0, otherwise default to old behavior.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mysql_install_db.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index e3b4ad88105..27256994ef0 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -245,7 +245,12 @@ if test -n "$srcdir"
then
if test -z "$builddir"
then
- builddir="$srcdir"
+ if test -x "$dirname0/extra/my_print_defaults"
+ then
+ builddir="$dirname0"
+ else
+ builddir="$srcdir"
+ fi
fi
print_defaults="$builddir/extra/my_print_defaults"
elif test -n "$basedir"