1 |
commit: 2a6c561576350e048695972e92e7a72a68017b26 |
2 |
Author: Robin H. Johnson <robbat2 <AT> orbis-terrarum <DOT> net> |
3 |
AuthorDate: Tue Jul 29 17:58:10 2014 +0000 |
4 |
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jul 29 17:58:10 2014 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/mysql.git;a=commit;h=2a6c5615 |
7 |
|
8 |
Sync eclass changes from main portage tree back, handled prefix changes. |
9 |
|
10 |
Signed-off-by: Robin H. Johnson <robbat2 <AT> orbis-terrarum.net> |
11 |
|
12 |
--- |
13 |
eclass/mysql-autotools.eclass | 7 ++++--- |
14 |
eclass/mysql-cmake.eclass | 3 ++- |
15 |
eclass/mysql-v2.eclass | 30 +++++++++++++++--------------- |
16 |
eclass/mysql.eclass | 22 +++++++++++----------- |
17 |
4 files changed, 32 insertions(+), 30 deletions(-) |
18 |
|
19 |
diff --git a/eclass/mysql-autotools.eclass b/eclass/mysql-autotools.eclass |
20 |
index 2cfa3f2..2c6f636 100644 |
21 |
--- a/eclass/mysql-autotools.eclass |
22 |
+++ b/eclass/mysql-autotools.eclass |
23 |
@@ -1,6 +1,6 @@ |
24 |
-# Copyright 1999-2013 Gentoo Foundation |
25 |
+# Copyright 1999-2014 Gentoo Foundation |
26 |
# Distributed under the terms of the GNU General Public License v2 |
27 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-autotools.eclass,v 1.17 2013/03/16 19:20:34 robbat2 Exp $ |
28 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-autotools.eclass,v 1.19 2014/07/19 10:18:41 grobian Exp $ |
29 |
|
30 |
# @ECLASS: mysql-autotools.eclass |
31 |
# @MAINTAINER: |
32 |
@@ -112,7 +112,7 @@ mysql-autotools_configure_common() { |
33 |
myconf="${myconf} $(use_with big-tables)" |
34 |
myconf="${myconf} --enable-local-infile" |
35 |
myconf="${myconf} --with-extra-charsets=all" |
36 |
- myconf="${myconf} --with-mysqld-user=mysql" |
37 |
+ use prefix || myconf="${myconf} --with-mysqld-user=mysql" |
38 |
myconf="${myconf} --with-server" |
39 |
myconf="${myconf} --with-unix-socket-path=${EPREFIX}/var/run/mysqld/mysqld.sock" |
40 |
myconf="${myconf} --without-libwrap" |
41 |
@@ -612,6 +612,7 @@ mysql-autotools_src_install() { |
42 |
-e "s!= /var!= ${EPREFIX}/var!" \ |
43 |
"${FILESDIR}/${mycnf_src}" \ |
44 |
> "${TMPDIR}/my.cnf.ok" |
45 |
+ use prefix && sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' "${TMPDIR}/my.cnf.ok" |
46 |
if use latin1 ; then |
47 |
sed -i \ |
48 |
-e "/character-set/s|utf8|latin1|g" \ |
49 |
|
50 |
diff --git a/eclass/mysql-cmake.eclass b/eclass/mysql-cmake.eclass |
51 |
index be564c5..c9bb2ca 100644 |
52 |
--- a/eclass/mysql-cmake.eclass |
53 |
+++ b/eclass/mysql-cmake.eclass |
54 |
@@ -1,6 +1,6 @@ |
55 |
# Copyright 1999-2014 Gentoo Foundation |
56 |
# Distributed under the terms of the GNU General Public License v2 |
57 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-cmake.eclass,v 1.20 2014/05/15 03:18:47 grknight Exp $ |
58 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-cmake.eclass,v 1.22 2014/07/19 10:18:41 grobian Exp $ |
59 |
|
60 |
# @ECLASS: mysql-cmake.eclass |
61 |
# @MAINTAINER: |
62 |
@@ -421,6 +421,7 @@ mysql-cmake_src_install() { |
63 |
sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ |
64 |
"${FILESDIR}/${mycnf_src}" \ |
65 |
> "${TMPDIR}/my.cnf.ok" || die |
66 |
+ use prefix && sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' "${TMPDIR}/my.cnf.ok" |
67 |
if use latin1 ; then |
68 |
sed -i \ |
69 |
-e "/character-set/s|utf8|latin1|g" \ |
70 |
|
71 |
diff --git a/eclass/mysql-v2.eclass b/eclass/mysql-v2.eclass |
72 |
index bbbc150..8c0dc31 100644 |
73 |
--- a/eclass/mysql-v2.eclass |
74 |
+++ b/eclass/mysql-v2.eclass |
75 |
@@ -688,7 +688,7 @@ mysql-v2_pkg_config() { |
76 |
local old_MY_DATADIR="${MY_DATADIR}" |
77 |
local old_HOME="${HOME}" |
78 |
# my_print_defaults needs to read stuff in $HOME/.my.cnf |
79 |
- export HOME=/root |
80 |
+ export HOME=${EPREFIX}/root |
81 |
|
82 |
# Make sure the vars are correctly initialized |
83 |
mysql_init_vars |
84 |
@@ -739,13 +739,13 @@ mysql-v2_pkg_config() { |
85 |
MYSQL_LOG_BIN="$(mysql-v2_getoptval mysqld log-bin)" |
86 |
MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} |
87 |
|
88 |
- if [[ ! -d "${EROOT}"/$MYSQL_TMPDIR ]]; then |
89 |
+ if [[ ! -d "${ROOT}"/$MYSQL_TMPDIR ]]; then |
90 |
einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" |
91 |
- install -d -m 770 -o mysql -g mysql "${EROOT}"/$MYSQL_TMPDIR |
92 |
+ install -d -m 770 -o mysql -g mysql "${ROOT}"/$MYSQL_TMPDIR |
93 |
fi |
94 |
- if [[ ! -d "${EROOT}"/$MYSQL_LOG_BIN ]]; then |
95 |
+ if [[ ! -d "${ROOT}"/$MYSQL_LOG_BIN ]]; then |
96 |
einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN" |
97 |
- install -d -m 770 -o mysql -g mysql "${EROOT}"/$MYSQL_LOG_BIN |
98 |
+ install -d -m 770 -o mysql -g mysql "${ROOT}"/$MYSQL_LOG_BIN |
99 |
fi |
100 |
if [[ ! -d "${EROOT}"/$MYSQL_RELAY_LOG ]]; then |
101 |
einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG" |
102 |
@@ -766,7 +766,7 @@ mysql-v2_pkg_config() { |
103 |
if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
104 |
|
105 |
einfo "Please provide a password for the mysql 'root' user now, in the" |
106 |
- einfo "MYSQL_ROOT_PASSWORD env var or through the /root/.my.cnf file." |
107 |
+ einfo "MYSQL_ROOT_PASSWORD env var or through the ${HOME}/.my.cnf file." |
108 |
ewarn "Avoid [\"'\\_%] characters in the password" |
109 |
read -rsp " >" pwd1 ; echo |
110 |
|
111 |
@@ -780,9 +780,13 @@ mysql-v2_pkg_config() { |
112 |
unset pwd1 pwd2 |
113 |
fi |
114 |
|
115 |
- local options="--log-warnings=0" |
116 |
+ local options |
117 |
local sqltmp="$(emktemp)" |
118 |
|
119 |
+ # Fix bug 446200. Don't reference host my.cnf, needs to come first, |
120 |
+ # see http://bugs.mysql.com/bug.php?id=31312 |
121 |
+ use prefix && options="${options} --defaults-file=${MY_SYSCONFDIR}/my.cnf" |
122 |
+ |
123 |
local help_tables="${ROOT}${MY_SHAREDSTATEDIR}/fill_help_tables.sql" |
124 |
[[ -r "${help_tables}" ]] \ |
125 |
&& cp "${help_tables}" "${TMPDIR}/fill_help_tables.sql" \ |
126 |
@@ -805,10 +809,6 @@ mysql-v2_pkg_config() { |
127 |
|
128 |
use prefix || options="${options} --user=mysql" |
129 |
|
130 |
- # Fix bug 446200. Don't reference host my.cnf |
131 |
- use prefix && [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] \ |
132 |
- && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'" |
133 |
- |
134 |
# MySQL 5.6+ needs InnoDB |
135 |
if [[ ${PN} == "mysql" || ${PN} == "percona-server" ]] ; then |
136 |
mysql_version_is_at_least "5.6" || options="${options} --loose-skip-innodb" |
137 |
@@ -829,7 +829,7 @@ mysql-v2_pkg_config() { |
138 |
#cmd="'${EROOT}/usr/share/mysql/scripts/mysql_install_db' '--basedir=${EPREFIX}/usr' ${options}" |
139 |
cmd=${EROOT}usr/share/mysql/scripts/mysql_install_db |
140 |
[[ -f ${cmd} ]] || cmd=${EROOT}usr/bin/mysql_install_db |
141 |
- cmd="'$cmd' '--basedir=${EPREFIX}/usr' ${options} '--datadir=${EROOT}/${MY_DATADIR}' '--tmpdir=${EROOT}/${MYSQL_TMPDIR}'" |
142 |
+ cmd="'$cmd' '--basedir=${EPREFIX}/usr' ${options} '--datadir=${ROOT}/${MY_DATADIR}' '--tmpdir=${ROOT}/${MYSQL_TMPDIR}'" |
143 |
einfo "Command: $cmd" |
144 |
eval $cmd \ |
145 |
>"${TMPDIR}"/mysql_install_db.log 2>&1 |
146 |
@@ -855,16 +855,16 @@ mysql-v2_pkg_config() { |
147 |
local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" |
148 |
local mysqld="${EROOT}/usr/sbin/mysqld \ |
149 |
${options} \ |
150 |
- --user=mysql \ |
151 |
+ $(use prefix || echo --user=mysql) \ |
152 |
--log-warnings=0 \ |
153 |
--basedir=${EROOT}/usr \ |
154 |
- --datadir=${EROOT}/${MY_DATADIR} \ |
155 |
+ --datadir=${ROOT}/${MY_DATADIR} \ |
156 |
--max_allowed_packet=8M \ |
157 |
--net_buffer_length=16K \ |
158 |
--default-storage-engine=MyISAM \ |
159 |
--socket=${socket} \ |
160 |
--pid-file=${pidfile} |
161 |
- --tmpdir=${EROOT}/${MYSQL_TMPDIR}" |
162 |
+ --tmpdir=${ROOT}/${MYSQL_TMPDIR}" |
163 |
#einfo "About to start mysqld: ${mysqld}" |
164 |
ebegin "Starting mysqld" |
165 |
einfo "Command ${mysqld}" |
166 |
|
167 |
diff --git a/eclass/mysql.eclass b/eclass/mysql.eclass |
168 |
index 01f1c6d..bd555ce 100644 |
169 |
--- a/eclass/mysql.eclass |
170 |
+++ b/eclass/mysql.eclass |
171 |
@@ -1,6 +1,6 @@ |
172 |
-# Copyright 1999-2013 Gentoo Foundation |
173 |
+# Copyright 1999-2014 Gentoo Foundation |
174 |
# Distributed under the terms of the GNU General Public License v2 |
175 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.177 2013/03/16 19:20:34 robbat2 Exp $ |
176 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.179 2014/07/19 10:18:41 grobian Exp $ |
177 |
|
178 |
# @ECLASS: mysql.eclass |
179 |
# @MAINTAINER: |
180 |
@@ -458,7 +458,7 @@ configure_common() { |
181 |
myconf="${myconf} $(use_with big-tables)" |
182 |
myconf="${myconf} --enable-local-infile" |
183 |
myconf="${myconf} --with-extra-charsets=all" |
184 |
- myconf="${myconf} --with-mysqld-user=mysql" |
185 |
+ use prefix || myconf="${myconf} --with-mysqld-user=mysql" |
186 |
myconf="${myconf} --with-server" |
187 |
myconf="${myconf} --with-unix-socket-path=${EPREFIX}/var/run/mysqld/mysqld.sock" |
188 |
myconf="${myconf} --without-libwrap" |
189 |
@@ -1153,7 +1153,7 @@ mysql_src_install() { |
190 |
-e "s!= /var!= ${EPREFIX}/var!" \ |
191 |
"${FILESDIR}/${mycnf_src}" \ |
192 |
> "${TMPDIR}/my.cnf.ok" |
193 |
- use prefix && sed -i -e '/^user[ ]*= mysql$/d' "${TMPDIR}/my.cnf.ok" |
194 |
+ use prefix && sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' "${TMPDIR}/my.cnf.ok" |
195 |
if use latin1 ; then |
196 |
sed -i \ |
197 |
-e "/character-set/s|utf8|latin1|g" \ |
198 |
@@ -1366,17 +1366,17 @@ mysql_pkg_config() { |
199 |
MYSQL_LOG_BIN="$(mysql_getoptval mysqld log-bin)" |
200 |
MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} |
201 |
|
202 |
- if [[ ! -d "${EROOT}"/$MYSQL_TMPDIR ]]; then |
203 |
+ if [[ ! -d "${ROOT}"/$MYSQL_TMPDIR ]]; then |
204 |
einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" |
205 |
- install -d -m 770 -o mysql -g mysql "${EROOT}"/$MYSQL_TMPDIR |
206 |
+ install -d -m 770 -o mysql -g mysql "${ROOT}"/$MYSQL_TMPDIR |
207 |
fi |
208 |
- if [[ ! -d "${EROOT}"/$MYSQL_LOG_BIN ]]; then |
209 |
+ if [[ ! -d "${ROOT}"/$MYSQL_LOG_BIN ]]; then |
210 |
einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN" |
211 |
- install -d -m 770 -o mysql -g mysql "${EROOT}"/$MYSQL_LOG_BIN |
212 |
+ install -d -m 770 -o mysql -g mysql "${ROOT}"/$MYSQL_LOG_BIN |
213 |
fi |
214 |
- if [[ ! -d "${EROOT}"/$MYSQL_RELAY_LOG ]]; then |
215 |
+ if [[ ! -d "${ROOT}"/$MYSQL_RELAY_LOG ]]; then |
216 |
einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG" |
217 |
- install -d -m 770 -o mysql -g mysql "${EROOT}"/$MYSQL_RELAY_LOG |
218 |
+ install -d -m 770 -o mysql -g mysql "${ROOT}"/$MYSQL_RELAY_LOG |
219 |
fi |
220 |
|
221 |
if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then |
222 |
@@ -1467,7 +1467,7 @@ mysql_pkg_config() { |
223 |
local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" |
224 |
local mysqld="${EROOT}/usr/sbin/mysqld \ |
225 |
${options} \ |
226 |
- --user=mysql \ |
227 |
+ $(use prefix || echo --user=mysql) \ |
228 |
--log-warnings=0 \ |
229 |
--basedir=${EROOT}/usr \ |
230 |
--datadir=${ROOT}/${MY_DATADIR} \ |