commit:     bbb055a0129aadb278c78b3d096dadcae943c0ac
Author:     Brian Evans <grknight <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 29 12:46:36 2018 +0000
Commit:     Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Thu Mar 29 12:46:36 2018 +0000
URL:        https://gitweb.gentoo.org/proj/mysql.git/commit/?id=bbb055a0

dev-db/mysql: Fix pkg_config for 5.7.21

Package-Manager: Portage-2.3.26, Repoman-2.3.7
Manifest-Sign-Key: D1F781EFF9F4A3B6

 dev-db/mysql/mysql-5.7.21.ebuild | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/dev-db/mysql/mysql-5.7.21.ebuild b/dev-db/mysql/mysql-5.7.21.ebuild
index 1d1eaac..681748a 100644
--- a/dev-db/mysql/mysql-5.7.21.ebuild
+++ b/dev-db/mysql/mysql-5.7.21.ebuild
@@ -791,8 +791,9 @@ pkg_config() {
        # http://dev.mysql.com/doc/mysql/en/time-zone-support.html
        "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > 
"${sqltmp}" 2>/dev/null
 
-       local cmd=( "${EROOT}usr/share/mysql/scripts/mysql_install_db" )
-       [[ -f "${cmd}" ]] || cmd=( "${EROOT}usr/bin/mysql_install_db" )
+       # --initialize-insecure will not set root password
+       # --initialize would set a random one in the log which we don't need as 
we set it ourselves
+       local cmd=( "${EROOT}usr/sbin/mysqld" "--initialize-insecure" 
"--init-file='${sqltmp}'" )
        cmd+=( "--basedir=${EPREFIX}/usr" ${options} 
"--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" )
        einfo "Command: ${cmd[*]}"
        su -s /bin/sh -c "${cmd[*]}" mysql \
@@ -811,6 +812,7 @@ pkg_config() {
        local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid"
        local mysqld="${EROOT}/usr/sbin/mysqld \
                ${options} \
+               $(use prefix || echo --user=mysql) \
                --log-warnings=0 \
                --basedir=${EROOT}/usr \
                --datadir=${ROOT}/${MY_DATADIR} \
@@ -844,19 +846,6 @@ pkg_config() {
                -e "${sql}"
        eend $?
 
-       if [[ -n "${sqltmp}" ]] ; then
-               ebegin "Loading \"zoneinfo\", this step may require a few 
seconds"
-               "${EROOT}/usr/bin/mysql" \
-                       "--socket=${socket}" \
-                       -hlocalhost \
-                       -uroot \
-                       --password="${MYSQL_ROOT_PASSWORD}" \
-                       mysql < "${sqltmp}"
-               rc=$?
-               eend $?
-               [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!"
-       fi
-
        # Stop the server and cleanup
        einfo "Stopping the server ..."
        kill $(< "${pidfile}" )

Reply via email to