grknight    14/07/31 02:31:09

  Modified:             ChangeLog mysql-multilib.eclass
  Log:
  Update the multilib eclass to match the work done by grobian for mysql-v2

Revision  Changes    Path
1.1334               eclass/ChangeLog

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1334&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1334&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1333&r2=1.1334

Index: ChangeLog
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
retrieving revision 1.1333
retrieving revision 1.1334
diff -u -r1.1333 -r1.1334
--- ChangeLog   30 Jul 2014 19:49:46 -0000      1.1333
+++ ChangeLog   31 Jul 2014 02:31:09 -0000      1.1334
@@ -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 <grkni...@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 <ssuomi...@gentoo.org> udev.eclass:
   Deprecate the longer udev_get_udevdir() function in favour of the shorter



1.3                  eclass/mysql-multilib.eclass

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mysql-multilib.eclass?rev=1.3&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mysql-multilib.eclass?rev=1.3&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mysql-multilib.eclass?r1=1.2&r2=1.3

Index: mysql-multilib.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/mysql-multilib.eclass,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- mysql-multilib.eclass       29 Jul 2014 20:24:00 -0000      1.2
+++ mysql-multilib.eclass       31 Jul 2014 02:31:09 -0000      1.3
@@ -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 @@
        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_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 @@
 
        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 @@
                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 @@
 
        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 @@
        #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 @@
        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}"




Reply via email to