From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id C49DF139B2A for ; Fri, 18 Sep 2015 17:33:06 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 13AF221C02F; Fri, 18 Sep 2015 17:33:05 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9D2FE21C02F for ; Fri, 18 Sep 2015 17:33:04 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2253B340C54 for ; Fri, 18 Sep 2015 17:33:02 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7F2421FB for ; Fri, 18 Sep 2015 17:33:00 +0000 (UTC) From: "Brian Evans" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Evans" Message-ID: <1442597566.230727ca970a327e9338829cdff30c98973e8928.grknight@gentoo> Subject: [gentoo-commits] proj/mysql:master commit in: eclass/ X-VCS-Repository: proj/mysql X-VCS-Files: eclass/mysql-multilib.eclass X-VCS-Directories: eclass/ X-VCS-Committer: grknight X-VCS-Committer-Name: Brian Evans X-VCS-Revision: 230727ca970a327e9338829cdff30c98973e8928 X-VCS-Branch: master Date: Fri, 18 Sep 2015 17:33:00 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 7cced2a2-fa97-494d-9576-6c3879f20be7 X-Archives-Hash: c7024c2ff3cc46e105995eebcd4ff70e commit: 230727ca970a327e9338829cdff30c98973e8928 Author: Brian Evans gentoo org> AuthorDate: Fri Sep 18 17:32:46 2015 +0000 Commit: Brian Evans gentoo org> CommitDate: Fri Sep 18 17:32:46 2015 +0000 URL: https://gitweb.gentoo.org/proj/mysql.git/commit/?id=230727ca Update initialization for MySQL 5.7 now that mysql_install_db is gone Signed-off-by: Brian Evans gentoo.org> eclass/mysql-multilib.eclass | 54 ++++++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/eclass/mysql-multilib.eclass b/eclass/mysql-multilib.eclass index ff701df..16c320f 100644 --- a/eclass/mysql-multilib.eclass +++ b/eclass/mysql-multilib.eclass @@ -1056,16 +1056,32 @@ mysql-multilib_pkg_config() { fi pushd "${TMPDIR}" &>/dev/null - #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 + + # Filling timezones, see + # 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 + if [[ ${PN} == "mysql" || ${PN} == "percona-server" ]] && mysql_version_is_at_least "5.7.6" ; then + # --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 + cmd="${EROOT}usr/sbin/mysqld" + options="${options} --initialize-insecure '--init-file=${sqltmp}'" + sqltmp="" # the initialize will take care of it + else + cmd="${EROOT}usr/share/mysql/scripts/mysql_install_db" + [[ -f "${cmd}" ]] || cmd="${EROOT}usr/bin/mysql_install_db" + if [[ -r "${help_tables}" ]] ; then + cat "${help_tables}" >> "${sqltmp}" + fi + fi 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 if [ $? -ne 0 ]; then grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2 - die "Failed to run mysql_install_db. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" + die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" fi popd &>/dev/null [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ @@ -1073,14 +1089,6 @@ mysql-multilib_pkg_config() { chown -R mysql:mysql "${ROOT}/${MY_DATADIR}" 2>/dev/null chmod 0750 "${ROOT}/${MY_DATADIR}" 2>/dev/null - # Filling timezones, see - # 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 - - if [[ -r "${help_tables}" ]] ; then - cat "${help_tables}" >> "${sqltmp}" - fi - local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock" local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" local mysqld="${EROOT}/usr/sbin/mysqld \ @@ -1120,16 +1128,18 @@ mysql-multilib_pkg_config() { -e "${sql}" eend $? - 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!" + 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 ..."