diff options
author | Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org> | 2012-01-06 21:32:48 +0000 |
---|---|---|
committer | Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org> | 2012-01-06 21:32:48 +0000 |
commit | 1443a7d677c94ec3768c0d7e32a5500cf448e33e (patch) | |
tree | ba01660b6972a8362bc5c4d4502d5e777730d88e /eclass/mysql-v2.eclass | |
parent | fixed patch for 3.2.0 kernel . Bug 397733. (diff) | |
download | gentoo-2-1443a7d677c94ec3768c0d7e32a5500cf448e33e.tar.gz gentoo-2-1443a7d677c94ec3768c0d7e32a5500cf448e33e.tar.bz2 gentoo-2-1443a7d677c94ec3768c0d7e32a5500cf448e33e.zip |
[mysql eclasses] Added prefix support for eclasses - fixes bug 348788 and bug 388125.
Bumped required EAPI to 3 due to the prefix support.
Fix -userpriv detection - fixes bug 312809.
Diffstat (limited to 'eclass/mysql-v2.eclass')
-rw-r--r-- | eclass/mysql-v2.eclass | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/eclass/mysql-v2.eclass b/eclass/mysql-v2.eclass index 33d9cf9f36d8..061fcc913037 100644 --- a/eclass/mysql-v2.eclass +++ b/eclass/mysql-v2.eclass @@ -1,6 +1,6 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-v2.eclass,v 1.11 2011/12/27 07:37:20 robbat2 Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-v2.eclass,v 1.12 2012/01/06 21:32:48 jmbsvicetto Exp $ # @ECLASS: mysql-v2.eclass # @MAINTAINER: @@ -53,7 +53,7 @@ inherit eutils flag-o-matic gnuconfig ${MYSQL_EXTRAS} ${BUILD_INHERIT} mysql_fx # case "${EAPI:-0}" in - 2|3|4) ;; + 3|4) ;; *) die "Unsupported EAPI: ${EAPI}" ;; esac @@ -230,7 +230,6 @@ IUSE="${IUSE} berkdb" mysql_version_is_at_least "5.5.7" \ && IUSE="${IUSE} systemtap" - # # DEPENDENCIES: # @@ -388,7 +387,7 @@ mysql-v2_pkg_setup() { if has test ${FEATURES} ; then if ! use minimal ; then - if [[ $UID -eq 0 ]]; then + if ! has userpriv ${FEATURES} ; then eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." fi fi @@ -502,7 +501,7 @@ mysql-v2_pkg_postinst() { mysql_init_vars # Check FEATURES="collision-protect" before removing this - [[ -d "${ROOT}/var/log/mysql" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}" + [[ -d "${ROOT}${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}" # Secure the logfiles touch "${ROOT}${MY_LOGDIR}"/mysql.{log,err} @@ -604,8 +603,8 @@ mysql-v2_pkg_config() { local pwd2="b" local maxtry=15 - if [ -z "${MYSQL_ROOT_PASSWORD}" -a -f "${ROOT}/root/.my.cnf" ]; then - MYSQL_ROOT_PASSWORD="$(sed -n -e '/^password=/s,^password=,,gp' "${ROOT}/root/.my.cnf")" + if [ -z "${MYSQL_ROOT_PASSWORD}" -a -f "${EROOT}/root/.my.cnf" ]; then + MYSQL_ROOT_PASSWORD="$(sed -n -e '/^password=/s,^password=,,gp' "${EROOT}/root/.my.cnf")" fi if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then @@ -646,10 +645,10 @@ mysql-v2_pkg_config() { help_tables="${TMPDIR}/fill_help_tables.sql" pushd "${TMPDIR}" &>/dev/null - "${ROOT}/usr/bin/mysql_install_db" --basedir=/usr >"${TMPDIR}"/mysql_install_db.log 2>&1 + "${EROOT}/usr/bin/mysql_install_db" "--basedir=${EPREFIX}/usr" >"${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 /var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log" + die "Failed to run mysql_install_db. 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" ]] \ @@ -659,7 +658,7 @@ mysql-v2_pkg_config() { # Figure out which options we need to disable to do the setup helpfile="${TMPDIR}/mysqld-help" - ${ROOT}/usr/sbin/mysqld --verbose --help >"${helpfile}" 2>/dev/null + ${EROOT}/usr/sbin/mysqld --verbose --help >"${helpfile}" 2>/dev/null for opt in grant-tables host-cache name-resolve networking slave-start bdb \ federated innodb ssl log-bin relay-log slow-query-log external-locking \ ndbcluster \ @@ -673,7 +672,7 @@ mysql-v2_pkg_config() { # Filling timezones, see # http://dev.mysql.com/doc/mysql/en/time-zone-support.html - "${ROOT}/usr/bin/mysql_tzinfo_to_sql" "${ROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null + "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null if [[ -r "${help_tables}" ]] ; then cat "${help_tables}" >> "${sqltmp}" @@ -682,12 +681,12 @@ mysql-v2_pkg_config() { einfo "Creating the mysql database and setting proper" einfo "permissions on it ..." - local socket="${ROOT}/var/run/mysqld/mysqld${RANDOM}.sock" - local pidfile="${ROOT}/var/run/mysqld/mysqld${RANDOM}.pid" - local mysqld="${ROOT}/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} \ --user=mysql \ - --basedir=${ROOT}/usr \ + --basedir=${EROOT}/usr \ --datadir=${ROOT}/${MY_DATADIR} \ --max_allowed_packet=8M \ --net_buffer_length=16K \ @@ -712,14 +711,14 @@ mysql-v2_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'" - "${ROOT}/usr/bin/mysql" \ + "${EROOT}/usr/bin/mysql" \ --socket=${socket} \ -hlocalhost \ -e "${sql}" eend $? ebegin "Loading \"zoneinfo\", this step may require a few seconds ..." - "${ROOT}/usr/bin/mysql" \ + "${EROOT}/usr/bin/mysql" \ --socket=${socket} \ -hlocalhost \ -uroot \ @@ -742,5 +741,5 @@ mysql-v2_pkg_config() { # Remove mysql symlinks. mysql-v2_pkg_postrm() { - : # mysql_lib_symlinks "${D}" + : # mysql_lib_symlinks "${ED}" } |