diff options
author | unknown <tsmith@ramayana.hindu.god> | 2007-12-03 18:19:35 -0700 |
---|---|---|
committer | unknown <tsmith@ramayana.hindu.god> | 2007-12-03 18:19:35 -0700 |
commit | 1d772c91e063e1a47677ea00a290c51af292c3b2 (patch) | |
tree | a594af18aa6e95dbcc2a10bc8cff1655c4acae7a /scripts/mysqld_safe.sh | |
parent | 9b6dc66ede4f939ad123f4a18a0a883f529d4963 (diff) | |
download | mariadb-git-1d772c91e063e1a47677ea00a290c51af292c3b2.tar.gz |
Bug #32679: mysqld_safe looks for errmsg.sys in wrong path
The fix for bug 28544 moved our package data from ./share/mysql
to ./share. mysqld_safe had the old directory hard-coded. The
fix is to use the @pkgdatadir@ and @prefix@ values, to adapt to
different ways of building the package.
scripts/make_binary_distribution.sh:
Document that our build system explicitly overrides the @pkgfoo@ (e.g.,
pkgdatadir, pkglibdir, etc.) variables when 'make' is called.
scripts/mysqld_safe.sh:
Replace hard-coded "./share/mysql" with something like
echo @pkgdatadir@ | sed -e s/^@prefix@//.
Since the fix for bug 28544, this has been broken for mysql 5.1+,
where the package data dir is "./share" instead of "./share/mysql".
Diffstat (limited to 'scripts/mysqld_safe.sh')
-rw-r--r-- | scripts/mysqld_safe.sh | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 99dcafbbf71..5e7a177a546 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -200,16 +200,24 @@ parse_arguments() { # # First, try to find BASEDIR and ledir (where mysqld is) -# +# + +if echo '@pkgdatadir@' | grep '^@prefix@' > /dev/null +then + relpkgdata=`echo '@pkgdatadir@' | sed -e 's,^@prefix@,,' -e 's,^/,,' -e 's,^,./,'` +else + # pkgdatadir is not relative to prefix + relpkgdata='@pkgdatadir@' +fi MY_PWD=`pwd` # Check for the directories we would expect from a binary release install -if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/mysqld +if test -f "$relpkgdata"/english/errmsg.sys -a -x ./bin/mysqld then MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is # Check for the directories we would expect from a source install -elif test -f ./share/mysql/english/errmsg.sys -a -x ./libexec/mysqld +elif test -f "$relpkgdata"/english/errmsg.sys -a -x ./libexec/mysqld then MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld is @@ -219,6 +227,7 @@ else ledir=@libexecdir@ fi + # # Second, try to find the data directory # |