1 |
commit: 4214e44062954742a089b8fc470c26cc9d67e4c4 |
2 |
Author: Brian Evans <grknight <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jul 31 02:33:49 2014 +0000 |
4 |
Commit: Brian Evans <grknight <AT> tuffmail <DOT> com> |
5 |
CommitDate: Thu Jul 31 02:33:49 2014 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/mysql.git;a=commit;h=4214e440 |
7 |
|
8 |
Update the multilib eclass to match the work done by grobian for mysql-v2 for prefix. |
9 |
|
10 |
--- |
11 |
eclass/mysql-multilib.eclass | 30 +++++++++++++++--------------- |
12 |
1 file changed, 15 insertions(+), 15 deletions(-) |
13 |
|
14 |
diff --git a/eclass/mysql-multilib.eclass b/eclass/mysql-multilib.eclass |
15 |
index c79571c..39eed57 100644 |
16 |
--- a/eclass/mysql-multilib.eclass |
17 |
+++ b/eclass/mysql-multilib.eclass |
18 |
@@ -1,6 +1,6 @@ |
19 |
# Copyright 1999-2014 Gentoo Foundation |
20 |
# Distributed under the terms of the GNU General Public License v2 |
21 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-multilib.eclass,v 1.2 2014/07/29 20:24:00 robbat2 Exp $ |
22 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-multilib.eclass,v 1.3 2014/07/31 02:31:09 grknight Exp $ |
23 |
|
24 |
# @ECLASS: mysql-multilib.eclass |
25 |
# @MAINTAINER: |
26 |
@@ -641,7 +641,7 @@ mysql-multilib_pkg_config() { |
27 |
local old_MY_DATADIR="${MY_DATADIR}" |
28 |
local old_HOME="${HOME}" |
29 |
# my_print_defaults needs to read stuff in $HOME/.my.cnf |
30 |
- export HOME=/root |
31 |
+ export HOME=${EPREFIX}/root |
32 |
|
33 |
# Make sure the vars are correctly initialized |
34 |
mysql_init_vars |
35 |
@@ -692,11 +692,11 @@ mysql-multilib_pkg_config() { |
36 |
MYSQL_LOG_BIN="$(mysql-multilib_getoptval mysqld log-bin)" |
37 |
MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} |
38 |
|
39 |
- if [[ ! -d "${EROOT}"/$MYSQL_TMPDIR ]]; then |
40 |
+ if [[ ! -d "${ROOT}"/$MYSQL_TMPDIR ]]; then |
41 |
einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" |
42 |
install -d -m 770 -o mysql -g mysql "${EROOT}"/$MYSQL_TMPDIR |
43 |
fi |
44 |
- if [[ ! -d "${EROOT}"/$MYSQL_LOG_BIN ]]; then |
45 |
+ if [[ ! -d "${ROOT}"/$MYSQL_LOG_BIN ]]; then |
46 |
einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN" |
47 |
install -d -m 770 -o mysql -g mysql "${EROOT}"/$MYSQL_LOG_BIN |
48 |
fi |
49 |
@@ -718,8 +718,8 @@ mysql-multilib_pkg_config() { |
50 |
|
51 |
if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
52 |
|
53 |
- einfo "Please provide a password for the mysql 'root' user now, in the" |
54 |
- einfo "MYSQL_ROOT_PASSWORD env var or through the /root/.my.cnf file." |
55 |
+ einfo "Please provide a password for the mysql 'root' user now" |
56 |
+ einfo "or through the ${HOME}/.my.cnf file." |
57 |
ewarn "Avoid [\"'\\_%] characters in the password" |
58 |
read -rsp " >" pwd1 ; echo |
59 |
|
60 |
@@ -733,9 +733,13 @@ mysql-multilib_pkg_config() { |
61 |
unset pwd1 pwd2 |
62 |
fi |
63 |
|
64 |
- local options="--log-warnings=0" |
65 |
+ local options |
66 |
local sqltmp="$(emktemp)" |
67 |
|
68 |
+ # Fix bug 446200. Don't reference host my.cnf, needs to come first, |
69 |
+ # see http://bugs.mysql.com/bug.php?id=31312 |
70 |
+ use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'" |
71 |
+ |
72 |
local help_tables="${ROOT}${MY_SHAREDSTATEDIR}/fill_help_tables.sql" |
73 |
[[ -r "${help_tables}" ]] \ |
74 |
&& cp "${help_tables}" "${TMPDIR}/fill_help_tables.sql" \ |
75 |
@@ -758,10 +762,6 @@ mysql-multilib_pkg_config() { |
76 |
|
77 |
use prefix || options="${options} --user=mysql" |
78 |
|
79 |
- # Fix bug 446200. Don't reference host my.cnf |
80 |
- use prefix && [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] \ |
81 |
- && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'" |
82 |
- |
83 |
# MySQL 5.6+ needs InnoDB |
84 |
if [[ ${PN} == "mysql" || ${PN} == "percona-server" ]] ; then |
85 |
mysql_version_is_at_least "5.6" || options="${options} --loose-skip-innodb" |
86 |
@@ -782,7 +782,7 @@ mysql-multilib_pkg_config() { |
87 |
#cmd="'${EROOT}/usr/share/mysql/scripts/mysql_install_db' '--basedir=${EPREFIX}/usr' ${options}" |
88 |
cmd=${EROOT}usr/share/mysql/scripts/mysql_install_db |
89 |
[[ -f ${cmd} ]] || cmd=${EROOT}usr/bin/mysql_install_db |
90 |
- cmd="'$cmd' '--basedir=${EPREFIX}/usr' ${options} '--datadir=${EROOT}/${MY_DATADIR}' '--tmpdir=${EROOT}/${MYSQL_TMPDIR}'" |
91 |
+ cmd="'$cmd' '--basedir=${EPREFIX}/usr' ${options} '--datadir=${ROOT}/${MY_DATADIR}' '--tmpdir=${ROOT}/${MYSQL_TMPDIR}'" |
92 |
einfo "Command: $cmd" |
93 |
eval $cmd \ |
94 |
>"${TMPDIR}"/mysql_install_db.log 2>&1 |
95 |
@@ -808,16 +808,16 @@ mysql-multilib_pkg_config() { |
96 |
local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" |
97 |
local mysqld="${EROOT}/usr/sbin/mysqld \ |
98 |
${options} \ |
99 |
- --user=mysql \ |
100 |
+ $(use prefix || echo --user=mysql) \ |
101 |
--log-warnings=0 \ |
102 |
--basedir=${EROOT}/usr \ |
103 |
- --datadir=${EROOT}/${MY_DATADIR} \ |
104 |
+ --datadir=${ROOT}/${MY_DATADIR} \ |
105 |
--max_allowed_packet=8M \ |
106 |
--net_buffer_length=16K \ |
107 |
--default-storage-engine=MyISAM \ |
108 |
--socket=${socket} \ |
109 |
--pid-file=${pidfile} |
110 |
- --tmpdir=${EROOT}/${MYSQL_TMPDIR}" |
111 |
+ --tmpdir=${ROOT}/${MYSQL_TMPDIR}" |
112 |
#einfo "About to start mysqld: ${mysqld}" |
113 |
ebegin "Starting mysqld" |
114 |
einfo "Command ${mysqld}" |