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 2CF291388C1 for ; Sat, 27 Feb 2016 03:28:34 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id ECC3C21C003; Sat, 27 Feb 2016 03:28:31 +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 80B3F21C003 for ; Sat, 27 Feb 2016 03:28:31 +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 4073B34098F for ; Sat, 27 Feb 2016 03:28:30 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8FE388F8 for ; Sat, 27 Feb 2016 03:28:28 +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: <1456541777.272d86839db2042ebe26dd2193850e018c737eb4.grknight@gentoo> Subject: [gentoo-commits] proj/mysql:master commit in: eclass/ X-VCS-Repository: proj/mysql X-VCS-Files: eclass/mysql-multilib-r1.eclass X-VCS-Directories: eclass/ X-VCS-Committer: grknight X-VCS-Committer-Name: Brian Evans X-VCS-Revision: 272d86839db2042ebe26dd2193850e018c737eb4 X-VCS-Branch: master Date: Sat, 27 Feb 2016 03:28:28 +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: b9b4a0b2-3a0f-4168-85f9-25b0ae9d7d86 X-Archives-Hash: 5e46822563765a25f70f8af2c59936ac commit: 272d86839db2042ebe26dd2193850e018c737eb4 Author: Brian Evans gentoo org> AuthorDate: Sat Feb 27 02:56:17 2016 +0000 Commit: Brian Evans gentoo org> CommitDate: Sat Feb 27 02:56:17 2016 +0000 URL: https://gitweb.gentoo.org/proj/mysql.git/commit/?id=272d8683 mysql-multilib-r1.eclass: Further refinement for EAPI=6 Use the default functions for patching and deprecate mysql_fx.eclass PATCHES=() is now set in ebuilds instead of using the move functions eclass/mysql-multilib-r1.eclass | 114 ++++++++++++++++++++++++++++++++-------- 1 file changed, 92 insertions(+), 22 deletions(-) diff --git a/eclass/mysql-multilib-r1.eclass b/eclass/mysql-multilib-r1.eclass index 60340d7..65ebe85 100644 --- a/eclass/mysql-multilib-r1.eclass +++ b/eclass/mysql-multilib-r1.eclass @@ -38,8 +38,14 @@ MYSQL_EXTRAS="" # @DESCRIPTION: # An array of CMake arguments added to native and non-native -inherit eutils systemd flag-o-matic ${MYSQL_EXTRAS} mysql_fx versionator \ - multilib prefix toolchain-funcs user cmake-utils multilib-minimal +# Keeping eutils in EAPI=6 for emktemp in pkg_config + +inherit eutils systemd flag-o-matic ${MYSQL_EXTRAS} versionator \ + prefix toolchain-funcs user cmake-utils multilib-minimal + +if [[ "${EAPI}x" == "5x" ]]; then + inherit multilib mysql_fx +fi # # Supported EAPI versions and export functions @@ -82,19 +88,18 @@ if [[ -z ${MYSQL_PV_MAJOR} ]] ; then MYSQL_PV_MAJOR="$(get_version_component_ran # depend on this variable. # In particular, the code below transforms a $PVR like "5.0.18-r3" in "5001803" # We also strip off upstream's trailing letter that they use to respin tarballs -MYSQL_VERSION_ID="" -tpv="${PV%[a-z]}" -tpv=( ${tpv//[-._]/ } ) ; tpv[3]="${PVR:${#PV}}" ; tpv[3]="${tpv[3]##*-r}" -for vatom in 0 1 2 3 ; do - # pad to length 2 - tpv[${vatom}]="00${tpv[${vatom}]}" - MYSQL_VERSION_ID="${MYSQL_VERSION_ID}${tpv[${vatom}]:0-2}" -done -# strip leading "0" (otherwise it's considered an octal number by BASH) -MYSQL_VERSION_ID=${MYSQL_VERSION_ID##"0"} - -# This eclass should only be used with at least mysql-5.5.35 -mysql_version_is_at_least "5.5.35" || die "This eclass should only be used with >=mysql-5.5.35" +if [[ "${EAPI}x" == "5x" ]]; then + MYSQL_VERSION_ID="" + tpv="${PV%[a-z]}" + tpv=( ${tpv//[-._]/ } ) ; tpv[3]="${PVR:${#PV}}" ; tpv[3]="${tpv[3]##*-r}" + for vatom in 0 1 2 3 ; do + # pad to length 2 + tpv[${vatom}]="00${tpv[${vatom}]}" + MYSQL_VERSION_ID="${MYSQL_VERSION_ID}${tpv[${vatom}]:0-2}" + done + # strip leading "0" (otherwise it's considered an octal number by BASH) + MYSQL_VERSION_ID=${MYSQL_VERSION_ID##"0"} +fi # Work out the default SERVER_URI correctly if [[ -z ${SERVER_URI} ]]; then @@ -294,12 +299,6 @@ mysql-multilib-r1_src_prepare() { mysql_mv_patches # And apply epatch - else - mkdir -p "${WORKDIR}/patch" || die "Unable to create epatch directory" - # Clean out old items - rm -f "${WORKDIR}"/patch/* - EPATCH_SOURCE="${WORKDIR}/patch" mysql_mv_patches - eapply "${WORKDIR}/patch" fi fi @@ -343,7 +342,7 @@ mysql-multilib-r1_src_prepare() { if [[ "${EAPI}x" == "5x" ]] ; then epatch_user else - eapply_user + default fi } @@ -1056,3 +1055,74 @@ mysql-cmake_use_plugin() { echo "-DWITHOUT_$2=1 -DWITH_$2=0 -DPLUGIN_$2=NO" fi } + +# @FUNCTION: mysql_init_vars +# @DESCRIPTION: +# void mysql_init_vars() +# Initialize global variables +# 2005-11-19 +if [[ "${EAPI}x" != "5x" ]]; then + +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_INCLUDEDIR=${MY_INCLUDEDIR="${EPREFIX}/usr/include/mysql"} + MY_LIBDIR=${MY_LIBDIR="${EPREFIX}/usr/$(get_libdir)/mysql"} + + if [[ -z "${MY_DATADIR}" ]] ; then + MY_DATADIR="" + if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then + MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ + | sed -ne '/datadir/s|^--datadir=||p' \ + | tail -n1` + if [[ -z "${MY_DATADIR}" ]] ; then + MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \ + | sed -e 's/.*=\s*//' \ + | tail -n1` + fi + fi + if [[ -z "${MY_DATADIR}" ]] ; then + MY_DATADIR="${MY_LOCALSTATEDIR}" + einfo "Using default MY_DATADIR" + fi + elog "MySQL MY_DATADIR is ${MY_DATADIR}" + + if [[ -z "${PREVIOUS_DATADIR}" ]] ; then + if [[ -e "${MY_DATADIR}" ]] ; then + # If you get this and you're wondering about it, see bug #207636 + elog "MySQL datadir found in ${MY_DATADIR}" + elog "A new one will not be created." + PREVIOUS_DATADIR="yes" + else + PREVIOUS_DATADIR="no" + fi + export PREVIOUS_DATADIR + fi + else + if [[ ${EBUILD_PHASE} == "config" ]]; then + local new_MY_DATADIR + new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ + | sed -ne '/datadir/s|^--datadir=||p' \ + | tail -n1` + + if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then + ewarn "MySQL MY_DATADIR has changed" + ewarn "from ${MY_DATADIR}" + ewarn "to ${new_MY_DATADIR}" + MY_DATADIR="${new_MY_DATADIR}" + fi + fi + fi + + if [ "${MY_SOURCEDIR:-unset}" == "unset" ]; then + MY_SOURCEDIR=${SERVER_URI##*/} + MY_SOURCEDIR=${MY_SOURCEDIR%.tar*} + fi + + export MY_SHAREDSTATEDIR MY_SYSCONFDIR + export MY_LIBDIR MY_LOCALSTATEDIR MY_LOGDIR + export MY_INCLUDEDIR MY_DATADIR MY_SOURCEDIR +} +fi