From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C434B1382C5 for ; Sat, 19 May 2018 02:35:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E7BB1E0A8D; Sat, 19 May 2018 02:35:41 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A6A9EE0A8D for ; Sat, 19 May 2018 02:35:41 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 33A6D335C63 for ; Sat, 19 May 2018 02:35:40 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id BFF4C286 for ; Sat, 19 May 2018 02:35:38 +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: <1526697330.861d31197c4cb91f2e29c8992febc371cd55e602.grknight@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-db/mysql/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-db/mysql/mysql-5.7.22.ebuild X-VCS-Directories: dev-db/mysql/ X-VCS-Committer: grknight X-VCS-Committer-Name: Brian Evans X-VCS-Revision: 861d31197c4cb91f2e29c8992febc371cd55e602 X-VCS-Branch: master Date: Sat, 19 May 2018 02:35:38 +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: 930ee173-ab6d-4c93-90b6-f7d183a6b986 X-Archives-Hash: b75a0133da4d3270d7bb8e36a524fb26 commit: 861d31197c4cb91f2e29c8992febc371cd55e602 Author: Brian Evans gentoo org> AuthorDate: Sat May 19 02:34:54 2018 +0000 Commit: Brian Evans gentoo org> CommitDate: Sat May 19 02:35:30 2018 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=861d3119 dev-db/mysql: Fine tune pkg_config in 5.7.22 Hank Leininger noticed there were errors in the new 5.7 pkg_config I took 2 of his suggestions but used a more standard password setting method which will work in future versions. Also prep for EAPI 7 paths in pkg_config Closes: https://bugs.gentoo.org/656084 Package-Manager: Portage-2.3.37, Repoman-2.3.9 dev-db/mysql/mysql-5.7.22.ebuild | 73 +++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 35 deletions(-) diff --git a/dev-db/mysql/mysql-5.7.22.ebuild b/dev-db/mysql/mysql-5.7.22.ebuild index 8ff8a60d64c..58394d6071f 100644 --- a/dev-db/mysql/mysql-5.7.22.ebuild +++ b/dev-db/mysql/mysql-5.7.22.ebuild @@ -566,10 +566,10 @@ src_test() { } mysql_init_vars() { - MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mysql"} - MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"} - MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"} - MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"} + MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX%/}/usr/share/mysql"} + MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX%/}/etc/mysql"} + MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX%/}/var/lib/mysql"} + MY_LOGDIR=${MY_LOGDIR="${EPREFIX%/}/var/log/mysql"} if [[ -z "${MY_DATADIR}" ]] ; then MY_DATADIR="" @@ -623,7 +623,7 @@ mysql_init_vars() { pkg_config() { _getoptval() { - local mypd="${EROOT}"/usr/bin/my_print_defaults + local mypd="${EROOT%/}"/usr/bin/my_print_defaults local section="$1" local flag="--${2}=" local extra_options="${3}" @@ -632,20 +632,20 @@ 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=${EPREFIX}/root + export HOME=${EPREFIX%/}/root # Make sure the vars are correctly initialized mysql_init_vars [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR" - if [[ ! -x "${EROOT}/usr/sbin/mysqld" ]] ; then + if [[ ! -x "${EROOT%/}/usr/sbin/mysqld" ]] ; then die "Minimal builds do NOT include the MySQL server" fi if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then - local MY_DATADIR_s="${ROOT}/${MY_DATADIR}" + local MY_DATADIR_s="${ROOT%/}/${MY_DATADIR}" MY_DATADIR_s="${MY_DATADIR_s%%/}" - local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}" + local old_MY_DATADIR_s="${ROOT%/}/${old_MY_DATADIR}" old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}" if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then @@ -704,22 +704,22 @@ pkg_config() { MYSQL_LOG_BIN="$(_getoptval mysqld log-bin)" MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} - if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then + if [[ ! -d "${EROOT%/}/$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 "${EROOT%/}/$MYSQL_TMPDIR" fi - if [[ ! -d "${ROOT}/$MYSQL_LOG_BIN" ]]; then + if [[ ! -d "${EROOT%/}/$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 "${EROOT%/}/$MYSQL_LOG_BIN" fi - if [[ ! -d "${EROOT}/$MYSQL_RELAY_LOG" ]]; then + if [[ ! -d "${EROOT%/}/$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 "${EROOT%/}/$MYSQL_RELAY_LOG" fi - if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then + if [[ -d "${ROOT%/}/${MY_DATADIR}/mysql" ]] ; then ewarn "You have already a MySQL database in place." - ewarn "(${ROOT}/${MY_DATADIR}/*)" + ewarn "(${ROOT%/}/${MY_DATADIR}/*)" ewarn "Please rename or delete it if you wish to replace it." die "MySQL database already exists!" fi @@ -753,9 +753,9 @@ pkg_config() { use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'" # Figure out which options we need to disable to do the setup - local helpfile="${TMPDIR}/mysqld-help" - "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null - for opt in grant-tables host-cache name-resolve networking slave-start \ + local helpfile="${TMPDIR%/}/mysqld-help" + "${EROOT%/}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null + for opt in host-cache name-resolve networking slave-start \ federated ssl log-bin relay-log slow-query-log external-locking \ log-slave-updates \ ; do @@ -766,7 +766,7 @@ pkg_config() { einfo "Creating the mysql database and setting proper permissions on it ..." # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it - PID_DIR="${EROOT}/var/run/mysqld" + PID_DIR="${EROOT%/}/var/run/mysqld" if [[ ! -d "${PID_DIR}" ]]; then install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory" fi @@ -779,33 +779,35 @@ pkg_config() { # 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 + echo "USE mysql;" >"${sqltmp}" + "${EROOT%/}/usr/bin/mysql_tzinfo_to_sql" "${EROOT%/}/usr/share/zoneinfo" >> "${sqltmp}" 2>/dev/null + chown mysql "${sqltmp}" || die # --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}" ) + 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 \ - >"${TMPDIR}"/mysql_install_db.log 2>&1 + >"${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 initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" + grep -B5 -A999 -i "ERROR" "${TMPDIR%/}"/mysql_install_db.log 1>&2 + die "Failed to initialize mysqld. Please review ${EPREFIX%/}/var/log/mysql/mysqld.err AND ${TMPDIR%/}/mysql_install_db.log" fi popd &>/dev/null || die - [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ + [[ -f "${ROOT%/}/${MY_DATADIR}/mysql/user.frm" ]] \ || die "MySQL databases not installed" use prefix || options="${options} --user=mysql" - local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock" - local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid" - local mysqld="${EROOT}/usr/sbin/mysqld \ + local socket="${EROOT%/}/var/run/mysqld/mysqld${RANDOM}.sock" + 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} \ + --basedir=${EROOT%/}/usr \ + --datadir=${ROOT%/}/${MY_DATADIR} \ --max_allowed_packet=8M \ --net_buffer_length=16K \ --socket=${socket} \ @@ -829,8 +831,9 @@ pkg_config() { ebegin "Setting root password" # Do this from memory, as we don't want clear text passwords in temp files - local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'; FLUSH PRIVILEGES" - "${EROOT}/usr/bin/mysql" \ + local sql="ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '${MYSQL_ROOT_PASSWORD}'" + "${EROOT%/}/usr/bin/mysql" \ + --no-defaults \ "--socket=${socket}" \ -hlocalhost \ -e "${sql}"