diff options
author | Brian Evans <grknight@gentoo.org> | 2014-07-31 02:31:09 +0000 |
---|---|---|
committer | Brian Evans <grknight@gentoo.org> | 2014-07-31 02:31:09 +0000 |
commit | a76306021043aa8f139b35938302dd9e1f9f31d7 (patch) | |
tree | 0074acea6875a5aebde43af90ddc8610d5f39604 /eclass/mysql-multilib.eclass | |
parent | Automated update. (diff) | |
download | gentoo-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/mysql-multilib.eclass')
-rw-r--r-- | eclass/mysql-multilib.eclass | 30 |
1 files changed, 15 insertions, 15 deletions
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}" |