1 |
robbat2 12/11/01 20:22:57 |
2 |
|
3 |
Modified: ChangeLog mysql.eclass mysql-v2.eclass |
4 |
Log: |
5 |
Bug #392361: Fix mysql_install_db cases to work between all versions & variations of MySQL. Also add in checks for tmpdir/log-bin/relay-log directories that must exist otherwise the install_db will fail. |
6 |
|
7 |
Revision Changes Path |
8 |
1.495 eclass/ChangeLog |
9 |
|
10 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.495&view=markup |
11 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.495&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.494&r2=1.495 |
13 |
|
14 |
Index: ChangeLog |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v |
17 |
retrieving revision 1.494 |
18 |
retrieving revision 1.495 |
19 |
diff -p -w -b -B -u -u -r1.494 -r1.495 |
20 |
--- ChangeLog 1 Nov 2012 12:19:22 -0000 1.494 |
21 |
+++ ChangeLog 1 Nov 2012 20:22:57 -0000 1.495 |
22 |
@@ -1,6 +1,12 @@ |
23 |
# ChangeLog for eclass directory |
24 |
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 |
25 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.494 2012/11/01 12:19:22 mgorny Exp $ |
26 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.495 2012/11/01 20:22:57 robbat2 Exp $ |
27 |
+ |
28 |
+ 01 Nov 2012; Robin H. Johnson <robbat2@g.o> mysql.eclass, |
29 |
+ mysql-v2.eclass: |
30 |
+ Bug #392361: Fix mysql_install_db cases to work between all versions & |
31 |
+ variations of MySQL. Also add in checks for tmpdir/log-bin/relay-log |
32 |
+ directories that must exist otherwise the install_db will fail. |
33 |
|
34 |
01 Nov 2012; Michał Górny <mgorny@g.o> distutils-r1.eclass: |
35 |
Export PYTHONPATH for phases in out-of-source builds. |
36 |
@@ -280,6 +286,9 @@ |
37 |
Fixed tc-ninja_magic_to_arch() to also use KV_FULL and fail if no kernel |
38 |
version specified, bug 432390 |
39 |
|
40 |
+ 08 Oct 2012; Robin H. Johnson <robbat2@g.o> db.eclass: |
41 |
+ Fix typo in src_test runner: makeopts_jobs not makeopts_job. |
42 |
+ |
43 |
27 Sep 2012; Ian Stakenvicius <axs@g.o> eutils.eclass: |
44 |
Made 'usex' declaration conditional on lack of PM or EAPI5+ support |
45 |
|
46 |
|
47 |
|
48 |
|
49 |
1.176 eclass/mysql.eclass |
50 |
|
51 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mysql.eclass?rev=1.176&view=markup |
52 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mysql.eclass?rev=1.176&content-type=text/plain |
53 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mysql.eclass?r1=1.175&r2=1.176 |
54 |
|
55 |
Index: mysql.eclass |
56 |
=================================================================== |
57 |
RCS file: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v |
58 |
retrieving revision 1.175 |
59 |
retrieving revision 1.176 |
60 |
diff -p -w -b -B -u -u -r1.175 -r1.176 |
61 |
--- mysql.eclass 27 Sep 2012 16:35:41 -0000 1.175 |
62 |
+++ mysql.eclass 1 Nov 2012 20:22:57 -0000 1.176 |
63 |
@@ -1,6 +1,6 @@ |
64 |
# Copyright 1999-2012 Gentoo Foundation |
65 |
# Distributed under the terms of the GNU General Public License v2 |
66 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.175 2012/09/27 16:35:41 axs Exp $ |
67 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.176 2012/11/01 20:22:57 robbat2 Exp $ |
68 |
|
69 |
# @ECLASS: mysql.eclass |
70 |
# @MAINTAINER: |
71 |
@@ -714,7 +714,7 @@ configure_51() { |
72 |
|
73 |
if pbxt_available && [[ "${PBXT_NEWSTYLE}" == "1" ]]; then |
74 |
use pbxt \ |
75 |
- && plugins_dyn="${plugins_dyn} pbxt" \ |
76 |
+ && plugins_sta="${plugins_sta} pbxt" \ |
77 |
|| plugins_dis="${plugins_dis} pbxt" |
78 |
fi |
79 |
|
80 |
@@ -1269,10 +1269,10 @@ mysql_pkg_postinst() { |
81 |
fi |
82 |
|
83 |
if pbxt_available && use pbxt ; then |
84 |
- # TODO: explain it better |
85 |
- elog " mysql> INSTALL PLUGIN pbxt SONAME 'libpbxt.so';" |
86 |
- elog " mysql> CREATE TABLE t1 (c1 int, c2 text) ENGINE=pbxt;" |
87 |
- elog "if, after that, you cannot start the MySQL server," |
88 |
+ elog "Note: PBXT is now statically built when enabled." |
89 |
+ elog "" |
90 |
+ elog "If, you previously installed as a plugin and " |
91 |
+ elog "you cannot start the MySQL server," |
92 |
elog "remove the ${MY_DATADIR}/mysql/plugin.* files, then" |
93 |
elog "use the MySQL upgrade script to restore the table" |
94 |
elog "or execute the following SQL command:" |
95 |
@@ -1288,11 +1288,34 @@ mysql_pkg_postinst() { |
96 |
&& elog "Berkeley DB support is deprecated and will be removed in future versions!" |
97 |
} |
98 |
|
99 |
+# @FUNCTION: mysql_getopt |
100 |
+# @DESCRIPTION: |
101 |
+# Use my_print_defaults to extract specific config options |
102 |
+mysql_getopt() { |
103 |
+ local mypd="${EROOT}"/usr/bin/my_print_defaults |
104 |
+ section="$1" |
105 |
+ flag="--${2}=" |
106 |
+ "${mypd}" $section | sed -n "/^${flag}/p" |
107 |
+} |
108 |
+ |
109 |
+# @FUNCTION: mysql_getoptval |
110 |
+# @DESCRIPTION: |
111 |
+# Use my_print_defaults to extract specific config options |
112 |
+mysql_getoptval() { |
113 |
+ local mypd="${EROOT}"/usr/bin/my_print_defaults |
114 |
+ section="$1" |
115 |
+ flag="--${2}=" |
116 |
+ "${mypd}" $section | sed -n "/^${flag}/s,${flag},,gp" |
117 |
+} |
118 |
+ |
119 |
# @FUNCTION: mysql_pkg_config |
120 |
# @DESCRIPTION: |
121 |
# Configure mysql environment. |
122 |
mysql_pkg_config() { |
123 |
local old_MY_DATADIR="${MY_DATADIR}" |
124 |
+ local old_HOME="${HOME}" |
125 |
+ # my_print_defaults needs to read stuff in $HOME/.my.cnf |
126 |
+ export HOME=/root |
127 |
|
128 |
# Make sure the vars are correctly initialized |
129 |
mysql_init_vars |
130 |
@@ -1309,7 +1332,7 @@ mysql_pkg_config() { |
131 |
local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}" |
132 |
old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}" |
133 |
|
134 |
- if [[ -d "${old_MY_DATADIR_s}" ]]; then |
135 |
+ if [[ -d "${old_MY_DATADIR_s}" ]] && [[ "${old_MY_DATADIR_s}" != / ]]; then |
136 |
if [[ -d "${MY_DATADIR_s}" ]]; then |
137 |
ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist" |
138 |
ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}" |
139 |
@@ -1333,8 +1356,27 @@ mysql_pkg_config() { |
140 |
local pwd2="b" |
141 |
local maxtry=15 |
142 |
|
143 |
- if [ -z "${MYSQL_ROOT_PASSWORD}" -a -f "${EROOT}/root/.my.cnf" ]; then |
144 |
- MYSQL_ROOT_PASSWORD="$(sed -n -e '/^password=/s,^password=,,gp' "${EROOT}/root/.my.cnf")" |
145 |
+ if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
146 |
+ MYSQL_ROOT_PASSWORD="$(mysql_getoptval 'client mysql' password)" |
147 |
+ fi |
148 |
+ MYSQL_TMPDIR="$(mysql_getoptval mysqld tmpdir)" |
149 |
+ # These are dir+prefix |
150 |
+ MYSQL_RELAY_LOG="$(mysql_getoptval mysqld relay-log)" |
151 |
+ MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} |
152 |
+ MYSQL_LOG_BIN="$(mysql_getoptval mysqld log-bin)" |
153 |
+ MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} |
154 |
+ |
155 |
+ if [[ ! -d "${EROOT}"/$MYSQL_TMPDIR ]]; then |
156 |
+ einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" |
157 |
+ install -d -m 770 -o mysql -g mysql "${EROOT}"/$MYSQL_TMPDIR |
158 |
+ fi |
159 |
+ if [[ ! -d "${EROOT}"/$MYSQL_LOG_BIN ]]; then |
160 |
+ einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN" |
161 |
+ install -d -m 770 -o mysql -g mysql "${EROOT}"/$MYSQL_LOG_BIN |
162 |
+ fi |
163 |
+ if [[ ! -d "${EROOT}"/$MYSQL_RELAY_LOG ]]; then |
164 |
+ einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG" |
165 |
+ install -d -m 770 -o mysql -g mysql "${EROOT}"/$MYSQL_RELAY_LOG |
166 |
fi |
167 |
|
168 |
if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then |
169 |
@@ -1365,7 +1407,7 @@ mysql_pkg_config() { |
170 |
unset pwd1 pwd2 |
171 |
fi |
172 |
|
173 |
- local options="" |
174 |
+ local options="--log-warnings=0" |
175 |
local sqltmp="$(emktemp)" |
176 |
|
177 |
local help_tables="${ROOT}${MY_SHAREDSTATEDIR}/fill_help_tables.sql" |
178 |
@@ -1374,32 +1416,40 @@ mysql_pkg_config() { |
179 |
|| touch "${TMPDIR}/fill_help_tables.sql" |
180 |
help_tables="${TMPDIR}/fill_help_tables.sql" |
181 |
|
182 |
- pushd "${TMPDIR}" &>/dev/null |
183 |
- "${EROOT}/usr/bin/mysql_install_db" >"${TMPDIR}"/mysql_install_db.log 2>&1 |
184 |
- if [ $? -ne 0 ]; then |
185 |
- grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2 |
186 |
- die "Failed to run mysql_install_db. Please review /var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" |
187 |
- fi |
188 |
- popd &>/dev/null |
189 |
- [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ |
190 |
- || die "MySQL databases not installed" |
191 |
- chown -R mysql:mysql "${ROOT}/${MY_DATADIR}" 2>/dev/null |
192 |
- chmod 0750 "${ROOT}/${MY_DATADIR}" 2>/dev/null |
193 |
- |
194 |
# Figure out which options we need to disable to do the setup |
195 |
helpfile="${TMPDIR}/mysqld-help" |
196 |
${EROOT}/usr/sbin/mysqld --verbose --help >"${helpfile}" 2>/dev/null |
197 |
for opt in grant-tables host-cache name-resolve networking slave-start bdb \ |
198 |
federated innodb ssl log-bin relay-log slow-query-log external-locking \ |
199 |
- ndbcluster \ |
200 |
+ ndbcluster log-slave-updates \ |
201 |
; do |
202 |
- optexp="--(skip-)?${opt}" optfull="--skip-${opt}" |
203 |
+ optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}" |
204 |
egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}" |
205 |
done |
206 |
# But some options changed names |
207 |
egrep -sq external-locking "${helpfile}" && \ |
208 |
options="${options/skip-locking/skip-external-locking}" |
209 |
|
210 |
+ use prefix || options="${options} --user=mysql" |
211 |
+ |
212 |
+ pushd "${TMPDIR}" &>/dev/null |
213 |
+ #cmd="'${EROOT}/usr/share/mysql/scripts/mysql_install_db' '--basedir=${EPREFIX}/usr' ${options}" |
214 |
+ cmd=${EROOT}usr/share/mysql/scripts/mysql_install_db |
215 |
+ [ -f ${cmd} ] || cmd=${EROOT}usr/bin/mysql_install_db |
216 |
+ cmd="'$cmd' '--basedir=${EPREFIX}/usr' ${options}" |
217 |
+ einfo "Command: $cmd" |
218 |
+ eval $cmd \ |
219 |
+ >"${TMPDIR}"/mysql_install_db.log 2>&1 |
220 |
+ if [ $? -ne 0 ]; then |
221 |
+ grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2 |
222 |
+ die "Failed to run mysql_install_db. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" |
223 |
+ fi |
224 |
+ popd &>/dev/null |
225 |
+ [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ |
226 |
+ || die "MySQL databases not installed" |
227 |
+ chown -R mysql:mysql "${ROOT}/${MY_DATADIR}" 2>/dev/null |
228 |
+ chmod 0750 "${ROOT}/${MY_DATADIR}" 2>/dev/null |
229 |
+ |
230 |
if mysql_version_is_at_least "4.1.3" ; then |
231 |
# Filling timezones, see |
232 |
# http://dev.mysql.com/doc/mysql/en/time-zone-support.html |
233 |
@@ -1413,13 +1463,12 @@ mysql_pkg_config() { |
234 |
einfo "Creating the mysql database and setting proper" |
235 |
einfo "permissions on it ..." |
236 |
|
237 |
- use prefix || options="${options} --user=mysql" |
238 |
- |
239 |
local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock" |
240 |
local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" |
241 |
local mysqld="${EROOT}/usr/sbin/mysqld \ |
242 |
${options} \ |
243 |
--user=mysql \ |
244 |
+ --log-warnings=0 \ |
245 |
--basedir=${EROOT}/usr \ |
246 |
--datadir=${ROOT}/${MY_DATADIR} \ |
247 |
--max_allowed_packet=8M \ |
248 |
@@ -1429,6 +1478,7 @@ mysql_pkg_config() { |
249 |
--pid-file=${pidfile}" |
250 |
#einfo "About to start mysqld: ${mysqld}" |
251 |
ebegin "Starting mysqld" |
252 |
+ einfo "Command ${mysqld}" |
253 |
${mysqld} & |
254 |
rc=$? |
255 |
while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do |
256 |
@@ -1456,7 +1506,7 @@ mysql_pkg_config() { |
257 |
--socket=${socket} \ |
258 |
-hlocalhost \ |
259 |
-uroot \ |
260 |
- -p"${MYSQL_ROOT_PASSWORD}" \ |
261 |
+ --password="${MYSQL_ROOT_PASSWORD}" \ |
262 |
mysql < "${sqltmp}" |
263 |
rc=$? |
264 |
eend $? |
265 |
|
266 |
|
267 |
|
268 |
1.20 eclass/mysql-v2.eclass |
269 |
|
270 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mysql-v2.eclass?rev=1.20&view=markup |
271 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mysql-v2.eclass?rev=1.20&content-type=text/plain |
272 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mysql-v2.eclass?r1=1.19&r2=1.20 |
273 |
|
274 |
Index: mysql-v2.eclass |
275 |
=================================================================== |
276 |
RCS file: /var/cvsroot/gentoo-x86/eclass/mysql-v2.eclass,v |
277 |
retrieving revision 1.19 |
278 |
retrieving revision 1.20 |
279 |
diff -p -w -b -B -u -u -r1.19 -r1.20 |
280 |
--- mysql-v2.eclass 27 Sep 2012 16:35:41 -0000 1.19 |
281 |
+++ mysql-v2.eclass 1 Nov 2012 20:22:57 -0000 1.20 |
282 |
@@ -1,6 +1,6 @@ |
283 |
# Copyright 1999-2012 Gentoo Foundation |
284 |
# Distributed under the terms of the GNU General Public License v2 |
285 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-v2.eclass,v 1.19 2012/09/27 16:35:41 axs Exp $ |
286 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-v2.eclass,v 1.20 2012/11/01 20:22:57 robbat2 Exp $ |
287 |
|
288 |
# @ECLASS: mysql-v2.eclass |
289 |
# @MAINTAINER: |
290 |
@@ -514,12 +514,35 @@ mysql-v2_pkg_postinst() { |
291 |
&& elog "Berkeley DB support is deprecated and will be removed in future versions!" |
292 |
} |
293 |
|
294 |
+# @FUNCTION: mysql-v2_getopt |
295 |
+# @DESCRIPTION: |
296 |
+# Use my_print_defaults to extract specific config options |
297 |
+mysql-v2_getopt() { |
298 |
+ local mypd="${EROOT}"/usr/bin/my_print_defaults |
299 |
+ section="$1" |
300 |
+ flag="--${2}=" |
301 |
+ "${mypd}" $section | sed -n "/^${flag}/p" |
302 |
+} |
303 |
+ |
304 |
+# @FUNCTION: mysql-v2_getoptval |
305 |
+# @DESCRIPTION: |
306 |
+# Use my_print_defaults to extract specific config options |
307 |
+mysql-v2_getoptval() { |
308 |
+ local mypd="${EROOT}"/usr/bin/my_print_defaults |
309 |
+ section="$1" |
310 |
+ flag="--${2}=" |
311 |
+ "${mypd}" $section | sed -n "/^${flag}/s,${flag},,gp" |
312 |
+} |
313 |
+ |
314 |
# @FUNCTION: mysql-v2_pkg_config |
315 |
# @DESCRIPTION: |
316 |
# Configure mysql environment. |
317 |
mysql-v2_pkg_config() { |
318 |
|
319 |
local old_MY_DATADIR="${MY_DATADIR}" |
320 |
+ local old_HOME="${HOME}" |
321 |
+ # my_print_defaults needs to read stuff in $HOME/.my.cnf |
322 |
+ export HOME=/root |
323 |
|
324 |
# Make sure the vars are correctly initialized |
325 |
mysql_init_vars |
326 |
@@ -533,10 +556,10 @@ mysql-v2_pkg_config() { |
327 |
if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then |
328 |
local MY_DATADIR_s="${ROOT}/${MY_DATADIR}" |
329 |
MY_DATADIR_s="${MY_DATADIR_s%%/}" |
330 |
- local old_MY_DATADIR_s="${ROOT}/old_MY_DATADIR}" |
331 |
+ local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}" |
332 |
old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}" |
333 |
|
334 |
- if [[ -d "${old_MY_DATADIR_s}" ]]; then |
335 |
+ if [[ -d "${old_MY_DATADIR_s}" ]] && [[ "${old_MY_DATADIR_s}" != / ]]; then |
336 |
if [[ -d "${MY_DATADIR_s}" ]]; then |
337 |
ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist" |
338 |
ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}" |
339 |
@@ -560,8 +583,27 @@ mysql-v2_pkg_config() { |
340 |
local pwd2="b" |
341 |
local maxtry=15 |
342 |
|
343 |
- if [ -z "${MYSQL_ROOT_PASSWORD}" -a -f "${EROOT}/root/.my.cnf" ]; then |
344 |
- MYSQL_ROOT_PASSWORD="$(sed -n -e '/^password=/s,^password=,,gp' "${EROOT}/root/.my.cnf")" |
345 |
+ if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then |
346 |
+ MYSQL_ROOT_PASSWORD="$(mysql-v2_getoptval 'client mysql' password)" |
347 |
+ fi |
348 |
+ MYSQL_TMPDIR="$(mysql-v2_getoptval mysqld tmpdir)" |
349 |
+ # These are dir+prefix |
350 |
+ MYSQL_RELAY_LOG="$(mysql-v2_getoptval mysqld relay-log)" |
351 |
+ MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} |
352 |
+ MYSQL_LOG_BIN="$(mysql-v2_getoptval mysqld log-bin)" |
353 |
+ MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} |
354 |
+ |
355 |
+ if [[ ! -d "${EROOT}"/$MYSQL_TMPDIR ]]; then |
356 |
+ einfo "Creating MySQL tmpdir $MYSQL_TMPDIR" |
357 |
+ install -d -m 770 -o mysql -g mysql "${EROOT}"/$MYSQL_TMPDIR |
358 |
+ fi |
359 |
+ if [[ ! -d "${EROOT}"/$MYSQL_LOG_BIN ]]; then |
360 |
+ einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN" |
361 |
+ install -d -m 770 -o mysql -g mysql "${EROOT}"/$MYSQL_LOG_BIN |
362 |
+ fi |
363 |
+ if [[ ! -d "${EROOT}"/$MYSQL_RELAY_LOG ]]; then |
364 |
+ einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG" |
365 |
+ install -d -m 770 -o mysql -g mysql "${EROOT}"/$MYSQL_RELAY_LOG |
366 |
fi |
367 |
|
368 |
if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then |
369 |
@@ -592,7 +634,7 @@ mysql-v2_pkg_config() { |
370 |
unset pwd1 pwd2 |
371 |
fi |
372 |
|
373 |
- local options="" |
374 |
+ local options="--log-warnings=0" |
375 |
local sqltmp="$(emktemp)" |
376 |
|
377 |
local help_tables="${ROOT}${MY_SHAREDSTATEDIR}/fill_help_tables.sql" |
378 |
@@ -601,32 +643,40 @@ mysql-v2_pkg_config() { |
379 |
|| touch "${TMPDIR}/fill_help_tables.sql" |
380 |
help_tables="${TMPDIR}/fill_help_tables.sql" |
381 |
|
382 |
- pushd "${TMPDIR}" &>/dev/null |
383 |
- "${EROOT}/usr/bin/mysql_install_db" "--basedir=${EPREFIX}/usr" >"${TMPDIR}"/mysql_install_db.log 2>&1 |
384 |
- if [ $? -ne 0 ]; then |
385 |
- grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2 |
386 |
- die "Failed to run mysql_install_db. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" |
387 |
- fi |
388 |
- popd &>/dev/null |
389 |
- [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ |
390 |
- || die "MySQL databases not installed" |
391 |
- chown -R mysql:mysql "${ROOT}/${MY_DATADIR}" 2>/dev/null |
392 |
- chmod 0750 "${ROOT}/${MY_DATADIR}" 2>/dev/null |
393 |
- |
394 |
# Figure out which options we need to disable to do the setup |
395 |
helpfile="${TMPDIR}/mysqld-help" |
396 |
${EROOT}/usr/sbin/mysqld --verbose --help >"${helpfile}" 2>/dev/null |
397 |
for opt in grant-tables host-cache name-resolve networking slave-start bdb \ |
398 |
federated innodb ssl log-bin relay-log slow-query-log external-locking \ |
399 |
- ndbcluster \ |
400 |
+ ndbcluster log-slave-updates \ |
401 |
; do |
402 |
- optexp="--(skip-)?${opt}" optfull="--skip-${opt}" |
403 |
+ optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}" |
404 |
egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}" |
405 |
done |
406 |
# But some options changed names |
407 |
egrep -sq external-locking "${helpfile}" && \ |
408 |
options="${options/skip-locking/skip-external-locking}" |
409 |
|
410 |
+ use prefix || options="${options} --user=mysql" |
411 |
+ |
412 |
+ pushd "${TMPDIR}" &>/dev/null |
413 |
+ #cmd="'${EROOT}/usr/share/mysql/scripts/mysql_install_db' '--basedir=${EPREFIX}/usr' ${options}" |
414 |
+ cmd=${EROOT}usr/share/mysql/scripts/mysql_install_db |
415 |
+ [ -f ${cmd} ] || cmd=${EROOT}usr/bin/mysql_install_db |
416 |
+ cmd="'$cmd' '--basedir=${EPREFIX}/usr' ${options}" |
417 |
+ einfo "Command: $cmd" |
418 |
+ eval $cmd \ |
419 |
+ >"${TMPDIR}"/mysql_install_db.log 2>&1 |
420 |
+ if [ $? -ne 0 ]; then |
421 |
+ grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2 |
422 |
+ die "Failed to run mysql_install_db. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" |
423 |
+ fi |
424 |
+ popd &>/dev/null |
425 |
+ [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ |
426 |
+ || die "MySQL databases not installed" |
427 |
+ chown -R mysql:mysql "${ROOT}/${MY_DATADIR}" 2>/dev/null |
428 |
+ chmod 0750 "${ROOT}/${MY_DATADIR}" 2>/dev/null |
429 |
+ |
430 |
# Filling timezones, see |
431 |
# http://dev.mysql.com/doc/mysql/en/time-zone-support.html |
432 |
"${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null |
433 |
@@ -643,6 +693,7 @@ mysql-v2_pkg_config() { |
434 |
local mysqld="${EROOT}/usr/sbin/mysqld \ |
435 |
${options} \ |
436 |
--user=mysql \ |
437 |
+ --log-warnings=0 \ |
438 |
--basedir=${EROOT}/usr \ |
439 |
--datadir=${ROOT}/${MY_DATADIR} \ |
440 |
--max_allowed_packet=8M \ |
441 |
@@ -652,6 +703,7 @@ mysql-v2_pkg_config() { |
442 |
--pid-file=${pidfile}" |
443 |
#einfo "About to start mysqld: ${mysqld}" |
444 |
ebegin "Starting mysqld" |
445 |
+ einfo "Command ${mysqld}" |
446 |
${mysqld} & |
447 |
rc=$? |
448 |
while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do |
449 |
@@ -679,7 +731,7 @@ mysql-v2_pkg_config() { |
450 |
--socket=${socket} \ |
451 |
-hlocalhost \ |
452 |
-uroot \ |
453 |
- -p"${MYSQL_ROOT_PASSWORD}" \ |
454 |
+ --password="${MYSQL_ROOT_PASSWORD}" \ |
455 |
mysql < "${sqltmp}" |
456 |
rc=$? |
457 |
eend $? |