summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorBrian Evans <grknight@gentoo.org>2014-07-31 02:31:09 +0000
committerBrian Evans <grknight@gentoo.org>2014-07-31 02:31:09 +0000
commita76306021043aa8f139b35938302dd9e1f9f31d7 (patch)
tree0074acea6875a5aebde43af90ddc8610d5f39604 /eclass
parentAutomated update. (diff)
downloadgentoo-2-a76306021043aa8f139b35938302dd9e1f9f31d7.tar.gz
gentoo-2-a76306021043aa8f139b35938302dd9e1f9f31d7.tar.bz2
gentoo-2-a76306021043aa8f139b35938302dd9e1f9f31d7.zip
Update the multilib eclass to match the work done by grobian for mysql-v2
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ChangeLog6
-rw-r--r--eclass/mysql-multilib.eclass30
2 files changed, 20 insertions, 16 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index 779bac9dac91..3012787440ba 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for eclass directory
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1333 2014/07/30 19:49:46 ssuominen Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1334 2014/07/31 02:31:09 grknight Exp $
+
+ 31 Jul 2014; Brian Evans <grknight@gentoo.org> mysql-multilib.eclass:
+ Update the multilib eclass to match the work done by grobian for mysql-v2
+ for prefix.
30 Jul 2014; Samuli Suominen <ssuominen@gentoo.org> udev.eclass:
Deprecate the longer udev_get_udevdir() function in favour of the shorter
diff --git a/eclass/mysql-multilib.eclass b/eclass/mysql-multilib.eclass
index c79571c32ead..39eed577ad9a 100644
--- a/eclass/mysql-multilib.eclass
+++ b/eclass/mysql-multilib.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-multilib.eclass,v 1.2 2014/07/29 20:24:00 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-multilib.eclass,v 1.3 2014/07/31 02:31:09 grknight Exp $
# @ECLASS: mysql-multilib.eclass
# @MAINTAINER:
@@ -641,7 +641,7 @@ mysql-multilib_pkg_config() {
local old_MY_DATADIR="${MY_DATADIR}"
local old_HOME="${HOME}"
# my_print_defaults needs to read stuff in $HOME/.my.cnf
- export HOME=/root
+ export HOME=${EPREFIX}/root
# Make sure the vars are correctly initialized
mysql_init_vars
@@ -692,11 +692,11 @@ mysql-multilib_pkg_config() {
MYSQL_LOG_BIN="$(mysql-multilib_getoptval mysqld log-bin)"
MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*}
- if [[ ! -d "${EROOT}"/$MYSQL_TMPDIR ]]; then
+ if [[ ! -d "${ROOT}"/$MYSQL_TMPDIR ]]; then
einfo "Creating MySQL tmpdir $MYSQL_TMPDIR"
install -d -m 770 -o mysql -g mysql "${EROOT}"/$MYSQL_TMPDIR
fi
- if [[ ! -d "${EROOT}"/$MYSQL_LOG_BIN ]]; then
+ if [[ ! -d "${ROOT}"/$MYSQL_LOG_BIN ]]; then
einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN"
install -d -m 770 -o mysql -g mysql "${EROOT}"/$MYSQL_LOG_BIN
fi
@@ -718,8 +718,8 @@ mysql-multilib_pkg_config() {
if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then
- einfo "Please provide a password for the mysql 'root' user now, in the"
- einfo "MYSQL_ROOT_PASSWORD env var or through the /root/.my.cnf file."
+ einfo "Please provide a password for the mysql 'root' user now"
+ einfo "or through the ${HOME}/.my.cnf file."
ewarn "Avoid [\"'\\_%] characters in the password"
read -rsp " >" pwd1 ; echo
@@ -733,9 +733,13 @@ mysql-multilib_pkg_config() {
unset pwd1 pwd2
fi
- local options="--log-warnings=0"
+ local options
local sqltmp="$(emktemp)"
+ # Fix bug 446200. Don't reference host my.cnf, needs to come first,
+ # see http://bugs.mysql.com/bug.php?id=31312
+ use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'"
+
local help_tables="${ROOT}${MY_SHAREDSTATEDIR}/fill_help_tables.sql"
[[ -r "${help_tables}" ]] \
&& cp "${help_tables}" "${TMPDIR}/fill_help_tables.sql" \
@@ -758,10 +762,6 @@ mysql-multilib_pkg_config() {
use prefix || options="${options} --user=mysql"
- # Fix bug 446200. Don't reference host my.cnf
- use prefix && [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] \
- && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'"
-
# MySQL 5.6+ needs InnoDB
if [[ ${PN} == "mysql" || ${PN} == "percona-server" ]] ; then
mysql_version_is_at_least "5.6" || options="${options} --loose-skip-innodb"
@@ -782,7 +782,7 @@ mysql-multilib_pkg_config() {
#cmd="'${EROOT}/usr/share/mysql/scripts/mysql_install_db' '--basedir=${EPREFIX}/usr' ${options}"
cmd=${EROOT}usr/share/mysql/scripts/mysql_install_db
[[ -f ${cmd} ]] || cmd=${EROOT}usr/bin/mysql_install_db
- cmd="'$cmd' '--basedir=${EPREFIX}/usr' ${options} '--datadir=${EROOT}/${MY_DATADIR}' '--tmpdir=${EROOT}/${MYSQL_TMPDIR}'"
+ cmd="'$cmd' '--basedir=${EPREFIX}/usr' ${options} '--datadir=${ROOT}/${MY_DATADIR}' '--tmpdir=${ROOT}/${MYSQL_TMPDIR}'"
einfo "Command: $cmd"
eval $cmd \
>"${TMPDIR}"/mysql_install_db.log 2>&1
@@ -808,16 +808,16 @@ mysql-multilib_pkg_config() {
local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid"
local mysqld="${EROOT}/usr/sbin/mysqld \
${options} \
- --user=mysql \
+ $(use prefix || echo --user=mysql) \
--log-warnings=0 \
--basedir=${EROOT}/usr \
- --datadir=${EROOT}/${MY_DATADIR} \
+ --datadir=${ROOT}/${MY_DATADIR} \
--max_allowed_packet=8M \
--net_buffer_length=16K \
--default-storage-engine=MyISAM \
--socket=${socket} \
--pid-file=${pidfile}
- --tmpdir=${EROOT}/${MYSQL_TMPDIR}"
+ --tmpdir=${ROOT}/${MYSQL_TMPDIR}"
#einfo "About to start mysqld: ${mysqld}"
ebegin "Starting mysqld"
einfo "Command ${mysqld}"