summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org>2013-04-30 10:13:30 +0000
committerJorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org>2013-04-30 10:13:30 +0000
commit7880308a3ef25f6e2945dc364fff3cc8a2eb84f4 (patch)
treef3dae30eb849317e1e56a6be1a442ba85678c018
parent[dev-db/mariadb-galera] Update testing instructions. (diff)
downloadmysql-7880308a3ef25f6e2945dc364fff3cc8a2eb84f4.tar.gz
mysql-7880308a3ef25f6e2945dc364fff3cc8a2eb84f4.tar.bz2
mysql-7880308a3ef25f6e2945dc364fff3cc8a2eb84f4.zip
[eclass] Update eclasses to be more consistent with bash notation and more compact.
-rw-r--r--eclass/mysql-autotools.eclass58
-rw-r--r--eclass/mysql-cmake.eclass28
-rw-r--r--eclass/mysql-v2.eclass153
3 files changed, 107 insertions, 132 deletions
diff --git a/eclass/mysql-autotools.eclass b/eclass/mysql-autotools.eclass
index e00906b..9d1ff91 100644
--- a/eclass/mysql-autotools.eclass
+++ b/eclass/mysql-autotools.eclass
@@ -51,14 +51,14 @@ mysql-autotools_disable_test() {
# ${S}/mysql-tests/suite/ndb_team/t/disabled.def
# ${S}/mysql-tests/suite/binlog/t/disabled.def
# ${S}/mysql-tests/suite/innodb/t/disabled.def
- if [ -n "${testsuite}" ]; then
+ if [[ -n ${testsuite} ]]; then
for mysql_disable_file in \
${S}/mysql-test/suite/${testsuite}/disabled.def \
${S}/mysql-test/suite/${testsuite}/t/disabled.def \
FAILED ; do
- [ -f "${mysql_disable_file}" ] && break
+ [[ -f ${mysql_disable_file} ]] && break
done
- if [ "${mysql_disabled_file}" != "FAILED" ]; then
+ if [[ ${mysql_disabled_file} != "FAILED" ]]; then
echo "${testname} : ${reason}" >> "${mysql_disable_file}"
else
ewarn "Could not find testsuite disabled.def location for ${rawtestname}"
@@ -99,7 +99,7 @@ mysql-autotools_configure_minimal() {
# MariaDB requires this flag in order to link to GPLv3 readline v6 or greater
# A note is added to the configure output
- if [[ "${PN}" == "mariadb" ]] && mysql_version_is_at_least "5.1.61" ; then
+ if [[ ${PN} == "mariadb" ]] && mysql_version_is_at_least "5.1.61" ; then
myconf="${myconf} --disable-distribution"
fi
}
@@ -134,7 +134,7 @@ mysql-autotools_configure_common() {
fi
fi
- if [ -n "${MYSQL_DEFAULT_CHARSET}" -a -n "${MYSQL_DEFAULT_COLLATION}" ]; then
+ if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then
ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}"
ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}."
ewarn "You MUST file bugs without these variables set."
@@ -220,7 +220,7 @@ mysql-autotools_configure_51() {
# Not supporting as examples: example,daemon_example,ftexample
plugins_sta="${plugins_sta} partition"
- if [[ "${PN}" != "mariadb" ]] ; then
+ if [[ ${PN} != "mariadb" ]] ; then
elog "Before using the Federated storage engine, please be sure to read"
elog "http://dev.mysql.com/doc/refman/5.1/en/federated-limitations.html"
plugins_dyn="${plugins_dyn} federated"
@@ -237,10 +237,10 @@ mysql-autotools_configure_51() {
# - innobase, innodb_plugin
# Build falcon if available for 6.x series.
for i in innobase falcon ; do
- [ -e "${S}"/storage/${i} ] && plugins_sta="${plugins_sta} ${i}"
+ [[ -e ${S}/storage/${i} ]] && plugins_sta="${plugins_sta} ${i}"
done
for i in innodb_plugin ; do
- [ -e "${S}"/storage/${i} ] && plugins_dyn="${plugins_dyn} ${i}"
+ [[ -e ${S}/storage/${i} ]] && plugins_dyn="${plugins_dyn} ${i}"
done
# like configuration=max-no-ndb
@@ -252,12 +252,12 @@ mysql-autotools_configure_51() {
plugins_dis="${plugins_dis} ndbcluster"
fi
- if [[ "${PN}" == "mariadb" ]] ; then
+ if [[ ${PN} == "mariadb" ]] ; then
# In MariaDB, InnoDB is packaged in the xtradb directory, so it's not
# caught above.
# This is not optional, without it several upstream testcases fail.
# Also strongly recommended by upstream.
- if [[ "${PV}" < "5.2.0" ]] ; then
+ if [[ ${PV} < "5.2.0" ]] ; then
myconf="${myconf} --with-maria-tmp-tables"
plugins_sta="${plugins_sta} maria"
else
@@ -265,11 +265,11 @@ mysql-autotools_configure_51() {
plugins_sta="${plugins_sta} aria"
fi
- [ -e "${S}"/storage/innobase ] || [ -e "${S}"/storage/xtradb ] ||
+ [[ ( -e ${S}/storage/innobase ) || ( -e ${S}/storage/xtradb ) ]] ||
die "The ${P} package doesn't provide innobase nor xtradb"
for i in innobase xtradb ; do
- [ -e "${S}"/storage/${i} ] && plugins_sta="${plugins_sta} ${i}"
+ [[ -e ${S}/storage/${i} ]] && plugins_sta="${plugins_sta} ${i}"
done
myconf="${myconf} $(use_with libevent)"
@@ -300,7 +300,7 @@ mysql-autotools_configure_51() {
fi
fi
- if pbxt_available && [[ "${PBXT_NEWSTYLE}" == "1" ]]; then
+ if pbxt_available && [[ ${PBXT_NEWSTYLE} == "1" ]]; then
use pbxt \
&& plugins_sta="${plugins_sta} pbxt" \
|| plugins_dis="${plugins_dis} pbxt"
@@ -311,7 +311,7 @@ mysql-autotools_configure_51() {
plugins_dyn=""
# Google MySQL, bundle what upstream supports
- if [[ "${PN}" == "google-mysql" ]]; then
+ if [[ ${PN} == "google-mysql" ]]; then
for x in innobase innodb_plugin innodb ; do
plugins_sta="${plugins_sta//$x}"
plugins_dyn="${plugins_dyn//$x}"
@@ -389,7 +389,7 @@ mysql-autotools_src_prepare() {
# last -fPIC fixup, per bug #305873
i="${S}"/storage/innodb_plugin/plug.in
- [ -f "${i}" ] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}"
+ [[ -f ${i} ]] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}"
# Additional checks, remove bundled zlib
rm -f "${S}/zlib/"*.[ch]
@@ -417,21 +417,21 @@ mysql-autotools_src_prepare() {
i="innobase"
o="${WORKDIR}/storage-${i}.mysql-upstream"
# Have we been here already?
- [ -d "${o}" ] && rm -f "${i}"
+ [[ -d ${o} ]] && rm -f "${i}"
# Or maybe we haven't
- [ -d "${i}" -a ! -d "${o}" ] && mv "${i}" "${o}"
+ [[ ( -d ${i} ) && ! ( -d ${o} ) ]] && mv "${i}" "${o}"
cp -ral "${WORKDIR}/${XTRADB_P}" "${i}"
popd >/dev/null
fi
- if pbxt_patch_available && [[ "${PBXT_NEWSTYLE}" == "1" ]] && use pbxt ; then
+ if pbxt_patch_available && [[ ${PBXT_NEWSTYLE} == "1" ]] && use pbxt ; then
einfo "Adding storage engine: PBXT"
pushd "${S}"/storage >/dev/null
i='pbxt'
- [ -d "${i}" ] && rm -rf "${i}"
+ [[ -d ${i} ]] && rm -rf "${i}"
cp -ral "${WORKDIR}/${PBXT_P}" "${i}"
f="${WORKDIR}/mysql-extras/pbxt/fix-low-priority.patch"
- [[ -f $f ]] && epatch "$f"
+ [[ -f $f ]] && epatch "$f"
popd >/dev/null
fi
@@ -490,7 +490,7 @@ mysql-autotools_src_configure() {
# implicitly. Upstream might be interested in this, exclude
# -fno-implicit-templates for google-mysql for now.
mysql_version_is_at_least "5.0" \
- && [[ "${PN}" != "google-mysql" ]] \
+ && [[ ${PN} != "google-mysql" ]] \
&& CXXFLAGS="${CXXFLAGS} -fno-implicit-templates"
export CXXFLAGS
@@ -526,7 +526,7 @@ mysql-autotools_src_configure() {
| xargs -0 -n100 sed -i \
-e 's|^pkglibdir *= *$(libdir)/mysql|pkglibdir = $(libdir)|;s|^pkgincludedir *= *$(includedir)/mysql|pkgincludedir = $(includedir)|'
- if [[ $EAPI == 2 ]] && [[ "${PBXT_NEWSTYLE}" != "1" ]]; then
+ if [[ $EAPI == 2 ]] && [[ ${PBXT_NEWSTYLE} != "1" ]]; then
pbxt_patch_available && use pbxt && pbxt_src_configure
fi
}
@@ -538,7 +538,7 @@ mysql-autotools_src_compile() {
emake || die "emake failed"
- if [[ "${PBXT_NEWSTYLE}" != "1" ]]; then
+ if [[ ${PBXT_NEWSTYLE} != "1" ]]; then
pbxt_patch_available && use pbxt && pbxt_src_compile
fi
}
@@ -557,7 +557,7 @@ mysql-autotools_src_install() {
testroot="${MY_SHAREDSTATEDIR}" \
|| die "emake install failed"
- if [[ "${PBXT_NEWSTYLE}" != "1" ]]; then
+ if [[ ${PBXT_NEWSTYLE} != "1" ]]; then
pbxt_patch_available && use pbxt && pbxt_src_install
fi
@@ -620,7 +620,7 @@ mysql-autotools_src_install() {
# Empty directories ...
diropts "-m0750"
keepdir "${MY_DATADIR#${EPREFIX}}"
- if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then
+ if [[ ${PREVIOUS_DATADIR} != "yes" ]] ; then
chown -R mysql:mysql "${D}/${MY_DATADIR}"
fi
@@ -635,7 +635,7 @@ mysql-autotools_src_install() {
# Docs
einfo "Installing docs"
for i in README ChangeLog EXCEPTIONS-CLIENT INSTALL-SOURCE ; do
- [[ -f "$i" ]] && dodoc "$i"
+ [[ -f $i ]] && dodoc "$i"
done
doinfo "${S}"/Docs/mysql.info
@@ -648,12 +648,12 @@ mysql-autotools_src_install() {
"${S}"/support-files/magic \
"${S}"/support-files/ndb-config-2-node.ini
do
- [[ -f "$script" ]] && dodoc "${script}"
+ [[ -f $script ]] && dodoc "${script}"
done
docinto "scripts"
for script in "${S}"/scripts/mysql* ; do
- [[ -f "$script" ]] && [[ "${script%.sh}" == "${script}" ]] && dodoc "${script}"
+ [[ ( -f $script ) && ( ${script%.sh} == ${script} ) ]] && dodoc "${script}"
done
fi
@@ -661,7 +661,7 @@ mysql-autotools_src_install() {
mysql_lib_symlinks "${ED}"
#Remove mytop if perl is not selected
- [[ "${PN}" == "mariadb" ]] && ! use perl \
+ [[ ${PN} == "mariadb" ]] && ! use perl \
&& mysql_version_is_at_least "5.3" \
&& rm -f "${ED}/usr/bin/mytop"
diff --git a/eclass/mysql-cmake.eclass b/eclass/mysql-cmake.eclass
index 43d0221..c00ceb2 100644
--- a/eclass/mysql-cmake.eclass
+++ b/eclass/mysql-cmake.eclass
@@ -36,29 +36,29 @@ mysql-cmake_disable_test() {
for mysql_disabled_file in \
${S}/mysql-test/disabled.def \
${S}/mysql-test/t/disabled.def ; do
- [ -f "${mysql_disabled_file}" ] && break
+ [[ -f ${mysql_disabled_file} ]] && break
done
#mysql_disabled_file="${S}/mysql-test/t/disabled.def"
#einfo "rawtestname=${rawtestname} testname=${testname} testsuite=${testsuite}"
echo ${testname} : ${reason} >> "${mysql_disabled_file}"
- if [ -n "${testsuite}" ] && [ "${testsuite}" != "main" ]; then
+ if [[ ( -n ${testsuite} ) && ( ${testsuite} != "main" ) ]]; then
for mysql_disabled_file in \
${S}/mysql-test/suite/${testsuite}/disabled.def \
${S}/mysql-test/suite/${testsuite}/t/disabled.def \
FAILED ; do
- [ -f "${mysql_disabled_file}" ] && break
+ [[ -f ${mysql_disabled_file} ]] && break
done
- if [ "${mysql_disabled_file}" != "FAILED" ]; then
+ if [[ ${mysql_disabled_file} != "FAILED" ]]; then
echo "${testname} : ${reason}" >> "${mysql_disabled_file}"
else
for mysql_disabled_dir in \
${S}/mysql-test/suite/${testsuite} \
${S}/mysql-test/suite/${testsuite}/t \
FAILED ; do
- [ -d "${mysql_disabled_dir}" ] && break
+ [[ -d ${mysql_disabled_dir} ]] && break
done
- if [ "${mysql_disabled_dir}" != "FAILED" ]; then
+ if [[ ${mysql_disabled_dir} != "FAILED" ]]; then
echo "${testname} : ${reason}" >> "${mysql_disabled_dir}/disabled.def"
else
ewarn "Could not find testsuite disabled.def location for ${rawtestname}"
@@ -72,7 +72,7 @@ mysql-cmake_disable_test() {
# Helper function to configure locale cmake options
configure_cmake_locale() {
- if ! use minimal && [ -n "${MYSQL_DEFAULT_CHARSET}" -a -n "${MYSQL_DEFAULT_COLLATION}" ]; then
+ if ! use minimal && [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then
ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}"
ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}."
ewarn "You MUST file bugs without these variables set."
@@ -218,7 +218,7 @@ mysql-cmake_src_prepare() {
# last -fPIC fixup, per bug #305873
i="${S}"/storage/innodb_plugin/plug.in
- [ -f "${i}" ] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}"
+ [[ -f ${i} ]] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}"
rm -f "scripts/mysqlbug"
epatch_user
@@ -259,7 +259,7 @@ mysql-cmake_src_configure() {
# Bug 412851
# MariaDB requires this flag to compile with GPLv3 readline linked
# Adds a warning about redistribution to configure
- if [[ "${PN}" == "mariadb" ]] ; then
+ if [[ ${PN} == "mariadb" ]] ; then
mycmakeargs+=( -DNOT_FOR_DISTRIBUTION=1 )
fi
@@ -321,7 +321,7 @@ mysql-cmake_src_install() {
dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqloptimize"
# Create a mariadb_config symlink
- [[ "${PN}" == "mariadb" ]] && dosym "/usr/bin/mysql_config" "/usr/bin/mariadb_config"
+ [[ ${PN} == "mariadb" ]] && dosym "/usr/bin/mysql_config" "/usr/bin/mariadb_config"
# INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir
rm -Rf "${ED}/usr/data"
@@ -370,7 +370,7 @@ mysql-cmake_src_install() {
einfo "Creating initial directories"
# Empty directories ...
diropts "-m0750"
- if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then
+ if [[ ${PREVIOUS_DATADIR} != "yes" ]] ; then
dodir "${MY_DATADIR#${EPREFIX}}"
keepdir "${MY_DATADIR#${EPREFIX}}"
chown -R mysql:mysql "${D}/${MY_DATADIR}"
@@ -393,16 +393,16 @@ mysql-cmake_src_install() {
"${S}"/support-files/magic \
"${S}"/support-files/ndb-config-2-node.ini.sh
do
- [[ -f "$script" ]] && dodoc "${script}"
+ [[ -f $script ]] && dodoc "${script}"
done
docinto "scripts"
for script in "${S}"/scripts/mysql* ; do
- [[ -f "$script" ]] && [[ "${script%.sh}" == "${script}" ]] && dodoc "${script}"
+ [[ ( -f $script ) && ( ${script%.sh} == ${script} ) ]] && dodoc "${script}"
done
fi
#Remove mytop if perl is not selected
- [[ "${PN}" == "mariadb" ]] && ! use perl \
+ [[ ${PN} == "mariadb" ]] && ! use perl \
&& rm -f "${ED}/usr/bin/mytop"
}
diff --git a/eclass/mysql-v2.eclass b/eclass/mysql-v2.eclass
index eda43a4..cca2360 100644
--- a/eclass/mysql-v2.eclass
+++ b/eclass/mysql-v2.eclass
@@ -44,7 +44,7 @@ MYSQL_EXTRAS=""
# @DESCRIPTION:
# The version of the MYSQL_EXTRAS repo to use to build mysql
# Use "none" to disable it's use
-[[ "${MY_EXTRAS_VER}" == "live" ]] && MYSQL_EXTRAS="git-2"
+[[ ${MY_EXTRAS_VER} == "live" ]] && MYSQL_EXTRAS="git-2"
inherit eutils flag-o-matic gnuconfig ${MYSQL_EXTRAS} ${BUILD_INHERIT} mysql_fx versionator toolchain-funcs
@@ -67,8 +67,8 @@ EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_
# and we will run a mysql server during test phase
S="${WORKDIR}/mysql"
-[[ "${MY_EXTRAS_VER}" == "latest" ]] && MY_EXTRAS_VER="20090228-0714Z"
-if [[ "${MY_EXTRAS_VER}" == "live" ]]; then
+[[ ${MY_EXTRAS_VER} == "latest" ]] && MY_EXTRAS_VER="20090228-0714Z"
+if [[ ${MY_EXTRAS_VER} == "live" ]]; then
EGIT_PROJECT=mysql-extras
EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/mysql-extras.git"
fi
@@ -113,9 +113,9 @@ mysql_version_is_at_least "5.1.50" || die "This eclass should only be used with
# Designation by PERCONA for a MySQL version to apply an XTRADB release
# Work out the default SERVER_URI correctly
-if [ -z "${SERVER_URI}" ]; then
- [ -z "${MY_PV}" ] && MY_PV="${PV//_/-}"
- if [ "${PN}" == "mariadb" ] || [ "${PN}" == "mariadb-galera" ]; then
+if [[ -z ${SERVER_URI} ]]; then
+ [[ -z ${MY_PV} ]] && MY_PV="${PV//_/-}"
+ if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]]; then
MARIA_FULL_PV="$(replace_version_separator 3 '-' ${MY_PV})"
MARIA_FULL_P="${PN}-${MARIA_FULL_PV}"
SERVER_URI="
@@ -126,8 +126,8 @@ if [ -z "${SERVER_URI}" ]; then
http://mirrors.fe.up.pt/pub/${PN}/${MARIA_FULL_P}/kvm-tarbake-jaunty-x86/${MARIA_FULL_P}.tar.gz
http://ftp-stud.hs-esslingen.de/pub/Mirrors/${PN}/${MARIA_FULL_P}/kvm-tarbake-jaunty-x86/${MARIA_FULL_P}.tar.gz
"
- if [ "${PN}" == "mariadb-galera" ]; then
- MY_SOURCEDIR="${PN%%-galera}-${GALERA_FULL_PV}"
+ if [[ ${PN} == "mariadb-galera" ]]; then
+ MY_SOURCEDIR="${PN%%-galera}-${MARIA_FULL_PV}"
fi
else
URI_DIR="MySQL"
@@ -144,20 +144,21 @@ fi
SRC_URI="${SERVER_URI}"
# Gentoo patches to MySQL
-[[ ${MY_EXTRAS_VER} != live ]] && [[ ${MY_EXTRAS_VER} != none ]] \
-&& SRC_URI="${SRC_URI}
+if [[ ${MY_EXTRAS_VER} != "live" && ${MY_EXTRAS_VER} != "none" ]]; then
+ SRC_URI="${SRC_URI}
mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
http://g3nt8.org/patches/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
http://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
http://dev.gentoo.org/~jmbsvicetto/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2"
+fi
DESCRIPTION="A fast, multi-threaded, multi-user SQL database server."
HOMEPAGE="http://www.mysql.com/"
-if [[ "${PN}" == "mariadb" ]]; then
+if [[ ${PN} == "mariadb" ]]; then
HOMEPAGE="http://mariadb.org/"
DESCRIPTION="An enhanced, drop-in replacement for MySQL"
fi
-if [ "${PN}" == "mariadb-galera" ]; then
+if [[ ${PN} == "mariadb-galera" ]]; then
HOMEPAGE="http://mariadb.org/"
DESCRIPTION="An enhanced, drop-in replacement for MySQL with Galera Replication"
fi
@@ -181,31 +182,23 @@ IUSE="${IUSE} cluster"
IUSE="${IUSE} max-idx-128"
IUSE="${IUSE} +community profiling"
-[[ ${PN} == "mariadb" ]] \
-&& mysql_check_version_range "5.1.38 to 5.3.99" \
-&& IUSE="${IUSE} libevent"
-
-([[ ${PN} == "mariadb" ]] || [[ "${PN}" == "mariadb-galera" ]])\
-&& mysql_version_is_at_least "5.2" \
-&& IUSE="${IUSE} oqgraph"
-
-([[ ${PN} == "mariadb" ]] || [[ "${PN}" == "mariadb-galera" ]])\
-&& mysql_version_is_at_least "5.2.5" \
-&& IUSE="${IUSE} sphinx"
-
-([[ ${PN} == "mariadb" ]] || [[ "${PN}" == "mariadb-galera" ]])\
-&& mysql_version_is_at_least "5.2.10" \
-&& IUSE="${IUSE} pam"
+if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]]; then
+ mysql_check_version_range "5.1.38 to 5.3.99" && IUSE="${IUSE} libevent"
+ mysql_version_is_at_least "5.2" && IUSE="${IUSE} oqgraph"
+ mysql_version_is_at_least "5.2.5" && IUSE="${IUSE} sphinx"
+ mysql_version_is_at_least "5.2.10" && IUSE="${IUSE} pam"
+fi
if mysql_version_is_at_least "5.5"; then
REQUIRED_USE="tcmalloc? ( !jemalloc ) jemalloc? ( !tcmalloc )"
IUSE="${IUSE} jemalloc tcmalloc"
fi
-REQUIRED_USE="${REQUIRED_USE} minimal? ( !cluster !extraengine !embedded ) static? ( !ssl )"
+if mysql_version_is_at_least "5.5.7"; then
+ IUSE="${IUSE} systemtap"
+fi
-mysql_version_is_at_least "5.5.7" \
-&& IUSE="${IUSE} systemtap"
+REQUIRED_USE="${REQUIRED_USE} minimal? ( !cluster !extraengine !embedded ) static? ( !ssl )"
#
# DEPENDENCIES:
@@ -222,9 +215,23 @@ DEPEND="
>=sys-libs/zlib-1.2.3
"
-([[ ${PN} == "mariadb" ]] || [[ "${PN}" == "mariadb-galera" ]])\
-&& mysql_check_version_range "5.1.38 to 5.3.99" \
-&& DEPEND="${DEPEND} libevent? ( >=dev-libs/libevent-1.4 )"
+if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] ; then
+ mysql_check_version_range "5.1.38 to 5.3.99" && DEPEND="${DEPEND} libevent? ( >=dev-libs/libevent-1.4 )"
+ mysql_version_is_at_least "5.2" && DEPEND="${DEPEND} oqgraph? ( >=dev-libs/boost-1.40.0 )"
+ mysql_version_is_at_least "5.2.5" && DEPEND="${DEPEND} sphinx? ( app-misc/sphinx )"
+ mysql_version_is_at_least "5.2.10" && DEPEND="${DEPEND} !minimal? ( pam? ( virtual/pam ) )"
+ # Bug 441700 MariaDB >=5.3 include custom mytop
+ mysql_version_is_at_least "5.3" && DEPEND="${DEPEND} perl? ( !dev-db/mytop )"
+
+ # Bug 455016 Add dependancies of mytop
+ if mysql_version_is_at_least "5.3" ; then
+ RDEPEND="${RDEPEND} perl? (
+ virtual/perl-Getopt-Long
+ dev-perl/TermReadKey
+ virtual/perl-Term-ANSIColor
+ virtual/perl-Time-HiRes ) "
+ fi
+fi
# Having different flavours at the same time is not a good idea
for i in "mysql" "mariadb" "mariadb-galera" ; do
@@ -232,32 +239,15 @@ for i in "mysql" "mariadb" "mariadb-galera" ; do
DEPEND="${DEPEND} !dev-db/${i}"
done
-([[ ${PN} == "mariadb" ]] || [[ "${PN}" == "mariadb-galera" ]])\
-&& mysql_version_is_at_least "5.2" \
-&& DEPEND="${DEPEND} oqgraph? ( >=dev-libs/boost-1.40.0 )"
-
-([[ ${PN} == "mariadb" ]] || [[ "${PN}" == "mariadb-galera" ]])\
-&& mysql_version_is_at_least "5.2.5" \
-&& DEPEND="${DEPEND} sphinx? ( app-misc/sphinx )"
-
-([[ ${PN} == "mariadb" ]] || [[ "${PN}" == "mariadb-galera" ]])\
-&& mysql_version_is_at_least "5.2.10" \
-&& DEPEND="${DEPEND} !minimal? ( pam? ( virtual/pam ) )"
-
-# Bug 441700 MariaDB >=5.3 include custom mytop
-([[ ${PN} == "mariadb" ]] || [[ "${PN}" == "mariadb-galera" ]])\
-&& mysql_version_is_at_least "5.3" \
-&& DEPEND="${DEPEND} perl? ( !dev-db/mytop )"
-
-mysql_version_is_at_least "5.5.7" \
-&& DEPEND="${DEPEND} systemtap? ( >=dev-util/systemtap-1.3 )" \
-&& DEPEND="${DEPEND} kernel_linux? ( dev-libs/libaio )"
-
-mysql_version_is_at_least "5.5" \
-&& DEPEND="${DEPEND} jemalloc? ( dev-libs/jemalloc )"
+if mysql_version_is_at_least "5.5" ; then
+ DEPEND="${DEPEND} jemalloc? ( dev-libs/jemalloc )"
+ DEPEND="${DEPEND} tcmalloc? ( dev-util/google-perftools )"
+fi
-mysql_version_is_at_least "5.5" \
-&& DEPEND="${DEPEND} tcmalloc? ( dev-util/google-perftools )"
+if mysql_version_is_at_least "5.5.7" ; then
+ DEPEND="${DEPEND} systemtap? ( >=dev-util/systemtap-1.3 )"
+ DEPEND="${DEPEND} kernel_linux? ( dev-libs/libaio )"
+fi
# prefix: first need to implement something for #196294
RDEPEND="${DEPEND}
@@ -265,15 +255,6 @@ RDEPEND="${DEPEND}
selinux? ( sec-policy/selinux-mysql )
"
-# Bug 455016 Add dependancies of mytop
-([[ ${PN} == "mariadb" ]] || [[ "${PN}" == "mariadb-galera" ]])\
-&& mysql_version_is_at_least "5.3" \
-&& RDEPEND="${RDEPEND} perl? (
- virtual/perl-Getopt-Long
- dev-perl/TermReadKey
- virtual/perl-Term-ANSIColor
- virtual/perl-Time-HiRes ) "
-
DEPEND="${DEPEND}
virtual/yacc
"
@@ -284,8 +265,9 @@ DEPEND="${DEPEND} static? ( sys-libs/ncurses[static-libs] )"
DEPEND="${DEPEND} >=dev-util/cmake-2.4.3"
# compile-time-only
-mysql_version_is_at_least "5.5.8" \
-&& DEPEND="${DEPEND} >=dev-util/cmake-2.6.3"
+if mysql_version_is_at_least "5.5.8" ; then
+ DEPEND="${DEPEND} >=dev-util/cmake-2.6.3"
+fi
# dev-perl/DBD-mysql is needed by some scripts installed by MySQL
PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )"
@@ -301,14 +283,11 @@ PDEPEND="${PDEPEND} =virtual/mysql-${MYSQL_PV_MAJOR}"
# PBXT_VERSION means that we have a PBXT patch for this PV
# PBXT was only introduced after 5.1.12
pbxt_patch_available() {
- [[ ${PN} != "mariadb" ]] && [[ ${PN} != "mariadb-galera" ]]\
- && [[ -n "${PBXT_VERSION}" ]]
- return $?
+ [[ ${PN} != "mariadb" && ${PN} != "mariadb-galera" && ( -n "${PBXT_VERSION}" ) ]]
}
pbxt_available() {
- pbxt_patch_available || [[ ${PN} == "mariadb" ]] || [[ ${PN} == "mariadb-galera" ]]
- return $?
+ pbxt_patch_available || [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]]
}
# Get the percona tarball if XTRADB_VER and PERCONA_VER are both set
@@ -316,18 +295,15 @@ pbxt_available() {
# XTRADB_VERS means that we have a XTRADB patch for this PV
# XTRADB was only introduced after 5.1.26
xtradb_patch_available() {
- [[ ${PN} != "mariadb" ]] && [[ ${PN} != "mariadb-galera" ]] \
- && [[ -n "${XTRADB_VER}" && -n "${PERCONA_VER}" ]]
- return $?
+ [[ ${PN} != "mariadb" && ${PN} != "mariadb-galera"
+ && ( -n "${XTRADB_VER}" ) && ( -n "${PERCONA_VER}" ) ]]
}
-
if pbxt_patch_available; then
PBXT_P="pbxt-${PBXT_VERSION}"
PBXT_SRC_URI="http://www.primebase.org/download/${PBXT_P}.tar.gz mirror://sourceforge/pbxt/${PBXT_P}.tar.gz"
SRC_URI="${SRC_URI} pbxt? ( ${PBXT_SRC_URI} )"
-
fi
# PBXT_NEWSTYLE means pbxt is in storage/ and gets enabled as other plugins
@@ -399,8 +375,7 @@ mysql-v2_pkg_setup() {
fi
# Check for USE flag problems in pkg_setup
- if ! mysql_version_is_at_least "5.2" \
- && use debug ; then
+ if ! mysql_version_is_at_least "5.2" && use debug ; then
# Also in package.use.mask
die "Bug #344885: Upstream has broken USE=debug for 5.1 series >=5.1.51"
fi
@@ -502,13 +477,13 @@ mysql-v2_pkg_postinst() {
docinto "scripts"
for script in scripts/mysql* ; do
- [[ -f "${script}" ]] \
- && [[ "${script%.sh}" == "${script}" ]] \
- && dodoc "${script}"
+ if [[ -f "${script}" && "${script%.sh}" == "${script}" ]]; then
+ dodoc "${script}"
+ fi
done
- if [ ${PN} == "mariadb" ] \
- && mysql_version_is_at_least "5.2.10" && use pam ; then
+ if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] \
+ && mysql_version_is_at_least "5.2.10" && use pam ; then
einfo
elog "This install includes the PAM authentication plugin."
elog "To activate and configure the PAM plugin, please read:"
@@ -589,7 +564,7 @@ mysql-v2_pkg_config() {
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
+ if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then
if [[ -d "${MY_DATADIR_s}" ]]; then
ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist"
ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}"
@@ -692,7 +667,7 @@ mysql-v2_pkg_config() {
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
+ [[ -f ${cmd} ]] || cmd=${EROOT}usr/bin/mysql_install_db
cmd="'$cmd' '--basedir=${EPREFIX}/usr' ${options}"
einfo "Command: $cmd"
eval $cmd \
@@ -773,7 +748,7 @@ mysql-v2_pkg_config() {
mysql < "${sqltmp}"
rc=$?
eend $?
- [ $rc -ne 0 ] && ewarn "Failed to load zoneinfo!"
+ [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!"
# Stop the server and cleanup
einfo "Stopping the server ..."