commit:     2a6c561576350e048695972e92e7a72a68017b26
Author:     Robin H. Johnson <robbat2 <AT> orbis-terrarum <DOT> net>
AuthorDate: Tue Jul 29 17:58:10 2014 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Tue Jul 29 17:58:10 2014 +0000
URL:        
http://git.overlays.gentoo.org/gitweb/?p=proj/mysql.git;a=commit;h=2a6c5615

Sync eclass changes from main portage tree back, handled prefix changes.

Signed-off-by: Robin H. Johnson <robbat2 <AT> orbis-terrarum.net>

---
 eclass/mysql-autotools.eclass |  7 ++++---
 eclass/mysql-cmake.eclass     |  3 ++-
 eclass/mysql-v2.eclass        | 30 +++++++++++++++---------------
 eclass/mysql.eclass           | 22 +++++++++++-----------
 4 files changed, 32 insertions(+), 30 deletions(-)

diff --git a/eclass/mysql-autotools.eclass b/eclass/mysql-autotools.eclass
index 2cfa3f2..2c6f636 100644
--- a/eclass/mysql-autotools.eclass
+++ b/eclass/mysql-autotools.eclass
@@ -1,6 +1,6 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-autotools.eclass,v 1.17 
2013/03/16 19:20:34 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-autotools.eclass,v 1.19 
2014/07/19 10:18:41 grobian Exp $
 
 # @ECLASS: mysql-autotools.eclass
 # @MAINTAINER:
@@ -112,7 +112,7 @@ mysql-autotools_configure_common() {
        myconf="${myconf} $(use_with big-tables)"
        myconf="${myconf} --enable-local-infile"
        myconf="${myconf} --with-extra-charsets=all"
-       myconf="${myconf} --with-mysqld-user=mysql"
+       use prefix || myconf="${myconf} --with-mysqld-user=mysql"
        myconf="${myconf} --with-server"
        myconf="${myconf} 
--with-unix-socket-path=${EPREFIX}/var/run/mysqld/mysqld.sock"
        myconf="${myconf} --without-libwrap"
@@ -612,6 +612,7 @@ mysql-autotools_src_install() {
                -e "s!= /var!= ${EPREFIX}/var!" \
                "${FILESDIR}/${mycnf_src}" \
                > "${TMPDIR}/my.cnf.ok"
+       use prefix && sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' 
"${TMPDIR}/my.cnf.ok"
        if use latin1 ; then
                sed -i \
                        -e "/character-set/s|utf8|latin1|g" \

diff --git a/eclass/mysql-cmake.eclass b/eclass/mysql-cmake.eclass
index be564c5..c9bb2ca 100644
--- a/eclass/mysql-cmake.eclass
+++ b/eclass/mysql-cmake.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-cmake.eclass,v 1.20 2014/05/15 
03:18:47 grknight Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-cmake.eclass,v 1.22 2014/07/19 
10:18:41 grobian Exp $
 
 # @ECLASS: mysql-cmake.eclass
 # @MAINTAINER:
@@ -421,6 +421,7 @@ mysql-cmake_src_install() {
        sed -e "s!@DATADIR@!${MY_DATADIR}!g" \
                "${FILESDIR}/${mycnf_src}" \
                > "${TMPDIR}/my.cnf.ok" || die
+       use prefix && sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' 
"${TMPDIR}/my.cnf.ok"
        if use latin1 ; then
                sed -i \
                        -e "/character-set/s|utf8|latin1|g" \

diff --git a/eclass/mysql-v2.eclass b/eclass/mysql-v2.eclass
index bbbc150..8c0dc31 100644
--- a/eclass/mysql-v2.eclass
+++ b/eclass/mysql-v2.eclass
@@ -688,7 +688,7 @@ mysql-v2_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
@@ -739,13 +739,13 @@ mysql-v2_pkg_config() {
        MYSQL_LOG_BIN="$(mysql-v2_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
+               install -d -m 770 -o mysql -g mysql "${ROOT}"/$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
+               install -d -m 770 -o mysql -g mysql "${ROOT}"/$MYSQL_LOG_BIN
        fi
        if [[ ! -d "${EROOT}"/$MYSQL_RELAY_LOG ]]; then
                einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG"
@@ -766,7 +766,7 @@ mysql-v2_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 "MYSQL_ROOT_PASSWORD env var or through the 
${HOME}/.my.cnf file."
                ewarn "Avoid [\"'\\_%] characters in the password"
                read -rsp "    >" pwd1 ; echo
 
@@ -780,9 +780,13 @@ mysql-v2_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" \
@@ -805,10 +809,6 @@ mysql-v2_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"
@@ -829,7 +829,7 @@ mysql-v2_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
@@ -855,16 +855,16 @@ mysql-v2_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}"

diff --git a/eclass/mysql.eclass b/eclass/mysql.eclass
index 01f1c6d..bd555ce 100644
--- a/eclass/mysql.eclass
+++ b/eclass/mysql.eclass
@@ -1,6 +1,6 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.177 2013/03/16 
19:20:34 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.179 2014/07/19 
10:18:41 grobian Exp $
 
 # @ECLASS: mysql.eclass
 # @MAINTAINER:
@@ -458,7 +458,7 @@ configure_common() {
        myconf="${myconf} $(use_with big-tables)"
        myconf="${myconf} --enable-local-infile"
        myconf="${myconf} --with-extra-charsets=all"
-       myconf="${myconf} --with-mysqld-user=mysql"
+       use prefix || myconf="${myconf} --with-mysqld-user=mysql"
        myconf="${myconf} --with-server"
        myconf="${myconf} 
--with-unix-socket-path=${EPREFIX}/var/run/mysqld/mysqld.sock"
        myconf="${myconf} --without-libwrap"
@@ -1153,7 +1153,7 @@ mysql_src_install() {
                -e "s!= /var!= ${EPREFIX}/var!" \
                "${FILESDIR}/${mycnf_src}" \
                > "${TMPDIR}/my.cnf.ok"
-       use prefix && sed -i -e '/^user[        ]*= mysql$/d' 
"${TMPDIR}/my.cnf.ok"
+       use prefix && sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' 
"${TMPDIR}/my.cnf.ok"
        if use latin1 ; then
                sed -i \
                        -e "/character-set/s|utf8|latin1|g" \
@@ -1366,17 +1366,17 @@ mysql_pkg_config() {
        MYSQL_LOG_BIN="$(mysql_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
+               install -d -m 770 -o mysql -g mysql "${ROOT}"/$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
+               install -d -m 770 -o mysql -g mysql "${ROOT}"/$MYSQL_LOG_BIN
        fi
-       if [[ ! -d "${EROOT}"/$MYSQL_RELAY_LOG ]]; then
+       if [[ ! -d "${ROOT}"/$MYSQL_RELAY_LOG ]]; then
                einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG"
-               install -d -m 770 -o mysql -g mysql "${EROOT}"/$MYSQL_RELAY_LOG
+               install -d -m 770 -o mysql -g mysql "${ROOT}"/$MYSQL_RELAY_LOG
        fi
 
        if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then
@@ -1467,7 +1467,7 @@ mysql_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=${ROOT}/${MY_DATADIR} \

Reply via email to