1 |
commit: 7880308a3ef25f6e2945dc364fff3cc8a2eb84f4 |
2 |
Author: Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Apr 30 10:13:30 2013 +0000 |
4 |
Commit: Jorge Manuel B. S. Vicetto <jmbsvicetto <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Apr 30 10:13:30 2013 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/mysql.git;a=commit;h=7880308a |
7 |
|
8 |
[eclass] Update eclasses to be more consistent with bash notation and more compact. |
9 |
|
10 |
--- |
11 |
eclass/mysql-autotools.eclass | 58 ++++++++-------- |
12 |
eclass/mysql-cmake.eclass | 28 ++++---- |
13 |
eclass/mysql-v2.eclass | 153 +++++++++++++++++------------------------ |
14 |
3 files changed, 107 insertions(+), 132 deletions(-) |
15 |
|
16 |
diff --git a/eclass/mysql-autotools.eclass b/eclass/mysql-autotools.eclass |
17 |
index e00906b..9d1ff91 100644 |
18 |
--- a/eclass/mysql-autotools.eclass |
19 |
+++ b/eclass/mysql-autotools.eclass |
20 |
@@ -51,14 +51,14 @@ mysql-autotools_disable_test() { |
21 |
# ${S}/mysql-tests/suite/ndb_team/t/disabled.def |
22 |
# ${S}/mysql-tests/suite/binlog/t/disabled.def |
23 |
# ${S}/mysql-tests/suite/innodb/t/disabled.def |
24 |
- if [ -n "${testsuite}" ]; then |
25 |
+ if [[ -n ${testsuite} ]]; then |
26 |
for mysql_disable_file in \ |
27 |
${S}/mysql-test/suite/${testsuite}/disabled.def \ |
28 |
${S}/mysql-test/suite/${testsuite}/t/disabled.def \ |
29 |
FAILED ; do |
30 |
- [ -f "${mysql_disable_file}" ] && break |
31 |
+ [[ -f ${mysql_disable_file} ]] && break |
32 |
done |
33 |
- if [ "${mysql_disabled_file}" != "FAILED" ]; then |
34 |
+ if [[ ${mysql_disabled_file} != "FAILED" ]]; then |
35 |
echo "${testname} : ${reason}" >> "${mysql_disable_file}" |
36 |
else |
37 |
ewarn "Could not find testsuite disabled.def location for ${rawtestname}" |
38 |
@@ -99,7 +99,7 @@ mysql-autotools_configure_minimal() { |
39 |
|
40 |
# MariaDB requires this flag in order to link to GPLv3 readline v6 or greater |
41 |
# A note is added to the configure output |
42 |
- if [[ "${PN}" == "mariadb" ]] && mysql_version_is_at_least "5.1.61" ; then |
43 |
+ if [[ ${PN} == "mariadb" ]] && mysql_version_is_at_least "5.1.61" ; then |
44 |
myconf="${myconf} --disable-distribution" |
45 |
fi |
46 |
} |
47 |
@@ -134,7 +134,7 @@ mysql-autotools_configure_common() { |
48 |
fi |
49 |
fi |
50 |
|
51 |
- if [ -n "${MYSQL_DEFAULT_CHARSET}" -a -n "${MYSQL_DEFAULT_COLLATION}" ]; then |
52 |
+ if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then |
53 |
ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}" |
54 |
ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}." |
55 |
ewarn "You MUST file bugs without these variables set." |
56 |
@@ -220,7 +220,7 @@ mysql-autotools_configure_51() { |
57 |
# Not supporting as examples: example,daemon_example,ftexample |
58 |
plugins_sta="${plugins_sta} partition" |
59 |
|
60 |
- if [[ "${PN}" != "mariadb" ]] ; then |
61 |
+ if [[ ${PN} != "mariadb" ]] ; then |
62 |
elog "Before using the Federated storage engine, please be sure to read" |
63 |
elog "http://dev.mysql.com/doc/refman/5.1/en/federated-limitations.html" |
64 |
plugins_dyn="${plugins_dyn} federated" |
65 |
@@ -237,10 +237,10 @@ mysql-autotools_configure_51() { |
66 |
# - innobase, innodb_plugin |
67 |
# Build falcon if available for 6.x series. |
68 |
for i in innobase falcon ; do |
69 |
- [ -e "${S}"/storage/${i} ] && plugins_sta="${plugins_sta} ${i}" |
70 |
+ [[ -e ${S}/storage/${i} ]] && plugins_sta="${plugins_sta} ${i}" |
71 |
done |
72 |
for i in innodb_plugin ; do |
73 |
- [ -e "${S}"/storage/${i} ] && plugins_dyn="${plugins_dyn} ${i}" |
74 |
+ [[ -e ${S}/storage/${i} ]] && plugins_dyn="${plugins_dyn} ${i}" |
75 |
done |
76 |
|
77 |
# like configuration=max-no-ndb |
78 |
@@ -252,12 +252,12 @@ mysql-autotools_configure_51() { |
79 |
plugins_dis="${plugins_dis} ndbcluster" |
80 |
fi |
81 |
|
82 |
- if [[ "${PN}" == "mariadb" ]] ; then |
83 |
+ if [[ ${PN} == "mariadb" ]] ; then |
84 |
# In MariaDB, InnoDB is packaged in the xtradb directory, so it's not |
85 |
# caught above. |
86 |
# This is not optional, without it several upstream testcases fail. |
87 |
# Also strongly recommended by upstream. |
88 |
- if [[ "${PV}" < "5.2.0" ]] ; then |
89 |
+ if [[ ${PV} < "5.2.0" ]] ; then |
90 |
myconf="${myconf} --with-maria-tmp-tables" |
91 |
plugins_sta="${plugins_sta} maria" |
92 |
else |
93 |
@@ -265,11 +265,11 @@ mysql-autotools_configure_51() { |
94 |
plugins_sta="${plugins_sta} aria" |
95 |
fi |
96 |
|
97 |
- [ -e "${S}"/storage/innobase ] || [ -e "${S}"/storage/xtradb ] || |
98 |
+ [[ ( -e ${S}/storage/innobase ) || ( -e ${S}/storage/xtradb ) ]] || |
99 |
die "The ${P} package doesn't provide innobase nor xtradb" |
100 |
|
101 |
for i in innobase xtradb ; do |
102 |
- [ -e "${S}"/storage/${i} ] && plugins_sta="${plugins_sta} ${i}" |
103 |
+ [[ -e ${S}/storage/${i} ]] && plugins_sta="${plugins_sta} ${i}" |
104 |
done |
105 |
|
106 |
myconf="${myconf} $(use_with libevent)" |
107 |
@@ -300,7 +300,7 @@ mysql-autotools_configure_51() { |
108 |
fi |
109 |
fi |
110 |
|
111 |
- if pbxt_available && [[ "${PBXT_NEWSTYLE}" == "1" ]]; then |
112 |
+ if pbxt_available && [[ ${PBXT_NEWSTYLE} == "1" ]]; then |
113 |
use pbxt \ |
114 |
&& plugins_sta="${plugins_sta} pbxt" \ |
115 |
|| plugins_dis="${plugins_dis} pbxt" |
116 |
@@ -311,7 +311,7 @@ mysql-autotools_configure_51() { |
117 |
plugins_dyn="" |
118 |
|
119 |
# Google MySQL, bundle what upstream supports |
120 |
- if [[ "${PN}" == "google-mysql" ]]; then |
121 |
+ if [[ ${PN} == "google-mysql" ]]; then |
122 |
for x in innobase innodb_plugin innodb ; do |
123 |
plugins_sta="${plugins_sta//$x}" |
124 |
plugins_dyn="${plugins_dyn//$x}" |
125 |
@@ -389,7 +389,7 @@ mysql-autotools_src_prepare() { |
126 |
|
127 |
# last -fPIC fixup, per bug #305873 |
128 |
i="${S}"/storage/innodb_plugin/plug.in |
129 |
- [ -f "${i}" ] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}" |
130 |
+ [[ -f ${i} ]] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}" |
131 |
|
132 |
# Additional checks, remove bundled zlib |
133 |
rm -f "${S}/zlib/"*.[ch] |
134 |
@@ -417,21 +417,21 @@ mysql-autotools_src_prepare() { |
135 |
i="innobase" |
136 |
o="${WORKDIR}/storage-${i}.mysql-upstream" |
137 |
# Have we been here already? |
138 |
- [ -d "${o}" ] && rm -f "${i}" |
139 |
+ [[ -d ${o} ]] && rm -f "${i}" |
140 |
# Or maybe we haven't |
141 |
- [ -d "${i}" -a ! -d "${o}" ] && mv "${i}" "${o}" |
142 |
+ [[ ( -d ${i} ) && ! ( -d ${o} ) ]] && mv "${i}" "${o}" |
143 |
cp -ral "${WORKDIR}/${XTRADB_P}" "${i}" |
144 |
popd >/dev/null |
145 |
fi |
146 |
|
147 |
- if pbxt_patch_available && [[ "${PBXT_NEWSTYLE}" == "1" ]] && use pbxt ; then |
148 |
+ if pbxt_patch_available && [[ ${PBXT_NEWSTYLE} == "1" ]] && use pbxt ; then |
149 |
einfo "Adding storage engine: PBXT" |
150 |
pushd "${S}"/storage >/dev/null |
151 |
i='pbxt' |
152 |
- [ -d "${i}" ] && rm -rf "${i}" |
153 |
+ [[ -d ${i} ]] && rm -rf "${i}" |
154 |
cp -ral "${WORKDIR}/${PBXT_P}" "${i}" |
155 |
f="${WORKDIR}/mysql-extras/pbxt/fix-low-priority.patch" |
156 |
- [[ -f $f ]] && epatch "$f" |
157 |
+ [[ -f $f ]] && epatch "$f" |
158 |
popd >/dev/null |
159 |
fi |
160 |
|
161 |
@@ -490,7 +490,7 @@ mysql-autotools_src_configure() { |
162 |
# implicitly. Upstream might be interested in this, exclude |
163 |
# -fno-implicit-templates for google-mysql for now. |
164 |
mysql_version_is_at_least "5.0" \ |
165 |
- && [[ "${PN}" != "google-mysql" ]] \ |
166 |
+ && [[ ${PN} != "google-mysql" ]] \ |
167 |
&& CXXFLAGS="${CXXFLAGS} -fno-implicit-templates" |
168 |
export CXXFLAGS |
169 |
|
170 |
@@ -526,7 +526,7 @@ mysql-autotools_src_configure() { |
171 |
| xargs -0 -n100 sed -i \ |
172 |
-e 's|^pkglibdir *= *$(libdir)/mysql|pkglibdir = $(libdir)|;s|^pkgincludedir *= *$(includedir)/mysql|pkgincludedir = $(includedir)|' |
173 |
|
174 |
- if [[ $EAPI == 2 ]] && [[ "${PBXT_NEWSTYLE}" != "1" ]]; then |
175 |
+ if [[ $EAPI == 2 ]] && [[ ${PBXT_NEWSTYLE} != "1" ]]; then |
176 |
pbxt_patch_available && use pbxt && pbxt_src_configure |
177 |
fi |
178 |
} |
179 |
@@ -538,7 +538,7 @@ mysql-autotools_src_compile() { |
180 |
|
181 |
emake || die "emake failed" |
182 |
|
183 |
- if [[ "${PBXT_NEWSTYLE}" != "1" ]]; then |
184 |
+ if [[ ${PBXT_NEWSTYLE} != "1" ]]; then |
185 |
pbxt_patch_available && use pbxt && pbxt_src_compile |
186 |
fi |
187 |
} |
188 |
@@ -557,7 +557,7 @@ mysql-autotools_src_install() { |
189 |
testroot="${MY_SHAREDSTATEDIR}" \ |
190 |
|| die "emake install failed" |
191 |
|
192 |
- if [[ "${PBXT_NEWSTYLE}" != "1" ]]; then |
193 |
+ if [[ ${PBXT_NEWSTYLE} != "1" ]]; then |
194 |
pbxt_patch_available && use pbxt && pbxt_src_install |
195 |
fi |
196 |
|
197 |
@@ -620,7 +620,7 @@ mysql-autotools_src_install() { |
198 |
# Empty directories ... |
199 |
diropts "-m0750" |
200 |
keepdir "${MY_DATADIR#${EPREFIX}}" |
201 |
- if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then |
202 |
+ if [[ ${PREVIOUS_DATADIR} != "yes" ]] ; then |
203 |
chown -R mysql:mysql "${D}/${MY_DATADIR}" |
204 |
fi |
205 |
|
206 |
@@ -635,7 +635,7 @@ mysql-autotools_src_install() { |
207 |
# Docs |
208 |
einfo "Installing docs" |
209 |
for i in README ChangeLog EXCEPTIONS-CLIENT INSTALL-SOURCE ; do |
210 |
- [[ -f "$i" ]] && dodoc "$i" |
211 |
+ [[ -f $i ]] && dodoc "$i" |
212 |
done |
213 |
doinfo "${S}"/Docs/mysql.info |
214 |
|
215 |
@@ -648,12 +648,12 @@ mysql-autotools_src_install() { |
216 |
"${S}"/support-files/magic \ |
217 |
"${S}"/support-files/ndb-config-2-node.ini |
218 |
do |
219 |
- [[ -f "$script" ]] && dodoc "${script}" |
220 |
+ [[ -f $script ]] && dodoc "${script}" |
221 |
done |
222 |
|
223 |
docinto "scripts" |
224 |
for script in "${S}"/scripts/mysql* ; do |
225 |
- [[ -f "$script" ]] && [[ "${script%.sh}" == "${script}" ]] && dodoc "${script}" |
226 |
+ [[ ( -f $script ) && ( ${script%.sh} == ${script} ) ]] && dodoc "${script}" |
227 |
done |
228 |
|
229 |
fi |
230 |
@@ -661,7 +661,7 @@ mysql-autotools_src_install() { |
231 |
mysql_lib_symlinks "${ED}" |
232 |
|
233 |
#Remove mytop if perl is not selected |
234 |
- [[ "${PN}" == "mariadb" ]] && ! use perl \ |
235 |
+ [[ ${PN} == "mariadb" ]] && ! use perl \ |
236 |
&& mysql_version_is_at_least "5.3" \ |
237 |
&& rm -f "${ED}/usr/bin/mytop" |
238 |
|
239 |
|
240 |
diff --git a/eclass/mysql-cmake.eclass b/eclass/mysql-cmake.eclass |
241 |
index 43d0221..c00ceb2 100644 |
242 |
--- a/eclass/mysql-cmake.eclass |
243 |
+++ b/eclass/mysql-cmake.eclass |
244 |
@@ -36,29 +36,29 @@ mysql-cmake_disable_test() { |
245 |
for mysql_disabled_file in \ |
246 |
${S}/mysql-test/disabled.def \ |
247 |
${S}/mysql-test/t/disabled.def ; do |
248 |
- [ -f "${mysql_disabled_file}" ] && break |
249 |
+ [[ -f ${mysql_disabled_file} ]] && break |
250 |
done |
251 |
#mysql_disabled_file="${S}/mysql-test/t/disabled.def" |
252 |
#einfo "rawtestname=${rawtestname} testname=${testname} testsuite=${testsuite}" |
253 |
echo ${testname} : ${reason} >> "${mysql_disabled_file}" |
254 |
|
255 |
- if [ -n "${testsuite}" ] && [ "${testsuite}" != "main" ]; then |
256 |
+ if [[ ( -n ${testsuite} ) && ( ${testsuite} != "main" ) ]]; then |
257 |
for mysql_disabled_file in \ |
258 |
${S}/mysql-test/suite/${testsuite}/disabled.def \ |
259 |
${S}/mysql-test/suite/${testsuite}/t/disabled.def \ |
260 |
FAILED ; do |
261 |
- [ -f "${mysql_disabled_file}" ] && break |
262 |
+ [[ -f ${mysql_disabled_file} ]] && break |
263 |
done |
264 |
- if [ "${mysql_disabled_file}" != "FAILED" ]; then |
265 |
+ if [[ ${mysql_disabled_file} != "FAILED" ]]; then |
266 |
echo "${testname} : ${reason}" >> "${mysql_disabled_file}" |
267 |
else |
268 |
for mysql_disabled_dir in \ |
269 |
${S}/mysql-test/suite/${testsuite} \ |
270 |
${S}/mysql-test/suite/${testsuite}/t \ |
271 |
FAILED ; do |
272 |
- [ -d "${mysql_disabled_dir}" ] && break |
273 |
+ [[ -d ${mysql_disabled_dir} ]] && break |
274 |
done |
275 |
- if [ "${mysql_disabled_dir}" != "FAILED" ]; then |
276 |
+ if [[ ${mysql_disabled_dir} != "FAILED" ]]; then |
277 |
echo "${testname} : ${reason}" >> "${mysql_disabled_dir}/disabled.def" |
278 |
else |
279 |
ewarn "Could not find testsuite disabled.def location for ${rawtestname}" |
280 |
@@ -72,7 +72,7 @@ mysql-cmake_disable_test() { |
281 |
# Helper function to configure locale cmake options |
282 |
configure_cmake_locale() { |
283 |
|
284 |
- if ! use minimal && [ -n "${MYSQL_DEFAULT_CHARSET}" -a -n "${MYSQL_DEFAULT_COLLATION}" ]; then |
285 |
+ if ! use minimal && [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then |
286 |
ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}" |
287 |
ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}." |
288 |
ewarn "You MUST file bugs without these variables set." |
289 |
@@ -218,7 +218,7 @@ mysql-cmake_src_prepare() { |
290 |
|
291 |
# last -fPIC fixup, per bug #305873 |
292 |
i="${S}"/storage/innodb_plugin/plug.in |
293 |
- [ -f "${i}" ] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}" |
294 |
+ [[ -f ${i} ]] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}" |
295 |
|
296 |
rm -f "scripts/mysqlbug" |
297 |
epatch_user |
298 |
@@ -259,7 +259,7 @@ mysql-cmake_src_configure() { |
299 |
# Bug 412851 |
300 |
# MariaDB requires this flag to compile with GPLv3 readline linked |
301 |
# Adds a warning about redistribution to configure |
302 |
- if [[ "${PN}" == "mariadb" ]] ; then |
303 |
+ if [[ ${PN} == "mariadb" ]] ; then |
304 |
mycmakeargs+=( -DNOT_FOR_DISTRIBUTION=1 ) |
305 |
fi |
306 |
|
307 |
@@ -321,7 +321,7 @@ mysql-cmake_src_install() { |
308 |
dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqloptimize" |
309 |
|
310 |
# Create a mariadb_config symlink |
311 |
- [[ "${PN}" == "mariadb" ]] && dosym "/usr/bin/mysql_config" "/usr/bin/mariadb_config" |
312 |
+ [[ ${PN} == "mariadb" ]] && dosym "/usr/bin/mysql_config" "/usr/bin/mariadb_config" |
313 |
|
314 |
# INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir |
315 |
rm -Rf "${ED}/usr/data" |
316 |
@@ -370,7 +370,7 @@ mysql-cmake_src_install() { |
317 |
einfo "Creating initial directories" |
318 |
# Empty directories ... |
319 |
diropts "-m0750" |
320 |
- if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then |
321 |
+ if [[ ${PREVIOUS_DATADIR} != "yes" ]] ; then |
322 |
dodir "${MY_DATADIR#${EPREFIX}}" |
323 |
keepdir "${MY_DATADIR#${EPREFIX}}" |
324 |
chown -R mysql:mysql "${D}/${MY_DATADIR}" |
325 |
@@ -393,16 +393,16 @@ mysql-cmake_src_install() { |
326 |
"${S}"/support-files/magic \ |
327 |
"${S}"/support-files/ndb-config-2-node.ini.sh |
328 |
do |
329 |
- [[ -f "$script" ]] && dodoc "${script}" |
330 |
+ [[ -f $script ]] && dodoc "${script}" |
331 |
done |
332 |
|
333 |
docinto "scripts" |
334 |
for script in "${S}"/scripts/mysql* ; do |
335 |
- [[ -f "$script" ]] && [[ "${script%.sh}" == "${script}" ]] && dodoc "${script}" |
336 |
+ [[ ( -f $script ) && ( ${script%.sh} == ${script} ) ]] && dodoc "${script}" |
337 |
done |
338 |
fi |
339 |
|
340 |
#Remove mytop if perl is not selected |
341 |
- [[ "${PN}" == "mariadb" ]] && ! use perl \ |
342 |
+ [[ ${PN} == "mariadb" ]] && ! use perl \ |
343 |
&& rm -f "${ED}/usr/bin/mytop" |
344 |
} |
345 |
|
346 |
diff --git a/eclass/mysql-v2.eclass b/eclass/mysql-v2.eclass |
347 |
index eda43a4..cca2360 100644 |
348 |
--- a/eclass/mysql-v2.eclass |
349 |
+++ b/eclass/mysql-v2.eclass |
350 |
@@ -44,7 +44,7 @@ MYSQL_EXTRAS="" |
351 |
# @DESCRIPTION: |
352 |
# The version of the MYSQL_EXTRAS repo to use to build mysql |
353 |
# Use "none" to disable it's use |
354 |
-[[ "${MY_EXTRAS_VER}" == "live" ]] && MYSQL_EXTRAS="git-2" |
355 |
+[[ ${MY_EXTRAS_VER} == "live" ]] && MYSQL_EXTRAS="git-2" |
356 |
|
357 |
inherit eutils flag-o-matic gnuconfig ${MYSQL_EXTRAS} ${BUILD_INHERIT} mysql_fx versionator toolchain-funcs |
358 |
|
359 |
@@ -67,8 +67,8 @@ EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_ |
360 |
# and we will run a mysql server during test phase |
361 |
S="${WORKDIR}/mysql" |
362 |
|
363 |
-[[ "${MY_EXTRAS_VER}" == "latest" ]] && MY_EXTRAS_VER="20090228-0714Z" |
364 |
-if [[ "${MY_EXTRAS_VER}" == "live" ]]; then |
365 |
+[[ ${MY_EXTRAS_VER} == "latest" ]] && MY_EXTRAS_VER="20090228-0714Z" |
366 |
+if [[ ${MY_EXTRAS_VER} == "live" ]]; then |
367 |
EGIT_PROJECT=mysql-extras |
368 |
EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/mysql-extras.git" |
369 |
fi |
370 |
@@ -113,9 +113,9 @@ mysql_version_is_at_least "5.1.50" || die "This eclass should only be used with |
371 |
# Designation by PERCONA for a MySQL version to apply an XTRADB release |
372 |
|
373 |
# Work out the default SERVER_URI correctly |
374 |
-if [ -z "${SERVER_URI}" ]; then |
375 |
- [ -z "${MY_PV}" ] && MY_PV="${PV//_/-}" |
376 |
- if [ "${PN}" == "mariadb" ] || [ "${PN}" == "mariadb-galera" ]; then |
377 |
+if [[ -z ${SERVER_URI} ]]; then |
378 |
+ [[ -z ${MY_PV} ]] && MY_PV="${PV//_/-}" |
379 |
+ if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]]; then |
380 |
MARIA_FULL_PV="$(replace_version_separator 3 '-' ${MY_PV})" |
381 |
MARIA_FULL_P="${PN}-${MARIA_FULL_PV}" |
382 |
SERVER_URI=" |
383 |
@@ -126,8 +126,8 @@ if [ -z "${SERVER_URI}" ]; then |
384 |
http://mirrors.fe.up.pt/pub/${PN}/${MARIA_FULL_P}/kvm-tarbake-jaunty-x86/${MARIA_FULL_P}.tar.gz |
385 |
http://ftp-stud.hs-esslingen.de/pub/Mirrors/${PN}/${MARIA_FULL_P}/kvm-tarbake-jaunty-x86/${MARIA_FULL_P}.tar.gz |
386 |
" |
387 |
- if [ "${PN}" == "mariadb-galera" ]; then |
388 |
- MY_SOURCEDIR="${PN%%-galera}-${GALERA_FULL_PV}" |
389 |
+ if [[ ${PN} == "mariadb-galera" ]]; then |
390 |
+ MY_SOURCEDIR="${PN%%-galera}-${MARIA_FULL_PV}" |
391 |
fi |
392 |
else |
393 |
URI_DIR="MySQL" |
394 |
@@ -144,20 +144,21 @@ fi |
395 |
SRC_URI="${SERVER_URI}" |
396 |
|
397 |
# Gentoo patches to MySQL |
398 |
-[[ ${MY_EXTRAS_VER} != live ]] && [[ ${MY_EXTRAS_VER} != none ]] \ |
399 |
-&& SRC_URI="${SRC_URI} |
400 |
+if [[ ${MY_EXTRAS_VER} != "live" && ${MY_EXTRAS_VER} != "none" ]]; then |
401 |
+ SRC_URI="${SRC_URI} |
402 |
mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
403 |
http://g3nt8.org/patches/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
404 |
http://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 |
405 |
http://dev.gentoo.org/~jmbsvicetto/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2" |
406 |
+fi |
407 |
|
408 |
DESCRIPTION="A fast, multi-threaded, multi-user SQL database server." |
409 |
HOMEPAGE="http://www.mysql.com/" |
410 |
-if [[ "${PN}" == "mariadb" ]]; then |
411 |
+if [[ ${PN} == "mariadb" ]]; then |
412 |
HOMEPAGE="http://mariadb.org/" |
413 |
DESCRIPTION="An enhanced, drop-in replacement for MySQL" |
414 |
fi |
415 |
-if [ "${PN}" == "mariadb-galera" ]; then |
416 |
+if [[ ${PN} == "mariadb-galera" ]]; then |
417 |
HOMEPAGE="http://mariadb.org/" |
418 |
DESCRIPTION="An enhanced, drop-in replacement for MySQL with Galera Replication" |
419 |
fi |
420 |
@@ -181,31 +182,23 @@ IUSE="${IUSE} cluster" |
421 |
IUSE="${IUSE} max-idx-128" |
422 |
IUSE="${IUSE} +community profiling" |
423 |
|
424 |
-[[ ${PN} == "mariadb" ]] \ |
425 |
-&& mysql_check_version_range "5.1.38 to 5.3.99" \ |
426 |
-&& IUSE="${IUSE} libevent" |
427 |
- |
428 |
-([[ ${PN} == "mariadb" ]] || [[ "${PN}" == "mariadb-galera" ]])\ |
429 |
-&& mysql_version_is_at_least "5.2" \ |
430 |
-&& IUSE="${IUSE} oqgraph" |
431 |
- |
432 |
-([[ ${PN} == "mariadb" ]] || [[ "${PN}" == "mariadb-galera" ]])\ |
433 |
-&& mysql_version_is_at_least "5.2.5" \ |
434 |
-&& IUSE="${IUSE} sphinx" |
435 |
- |
436 |
-([[ ${PN} == "mariadb" ]] || [[ "${PN}" == "mariadb-galera" ]])\ |
437 |
-&& mysql_version_is_at_least "5.2.10" \ |
438 |
-&& IUSE="${IUSE} pam" |
439 |
+if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]]; then |
440 |
+ mysql_check_version_range "5.1.38 to 5.3.99" && IUSE="${IUSE} libevent" |
441 |
+ mysql_version_is_at_least "5.2" && IUSE="${IUSE} oqgraph" |
442 |
+ mysql_version_is_at_least "5.2.5" && IUSE="${IUSE} sphinx" |
443 |
+ mysql_version_is_at_least "5.2.10" && IUSE="${IUSE} pam" |
444 |
+fi |
445 |
|
446 |
if mysql_version_is_at_least "5.5"; then |
447 |
REQUIRED_USE="tcmalloc? ( !jemalloc ) jemalloc? ( !tcmalloc )" |
448 |
IUSE="${IUSE} jemalloc tcmalloc" |
449 |
fi |
450 |
|
451 |
-REQUIRED_USE="${REQUIRED_USE} minimal? ( !cluster !extraengine !embedded ) static? ( !ssl )" |
452 |
+if mysql_version_is_at_least "5.5.7"; then |
453 |
+ IUSE="${IUSE} systemtap" |
454 |
+fi |
455 |
|
456 |
-mysql_version_is_at_least "5.5.7" \ |
457 |
-&& IUSE="${IUSE} systemtap" |
458 |
+REQUIRED_USE="${REQUIRED_USE} minimal? ( !cluster !extraengine !embedded ) static? ( !ssl )" |
459 |
|
460 |
# |
461 |
# DEPENDENCIES: |
462 |
@@ -222,9 +215,23 @@ DEPEND=" |
463 |
>=sys-libs/zlib-1.2.3 |
464 |
" |
465 |
|
466 |
-([[ ${PN} == "mariadb" ]] || [[ "${PN}" == "mariadb-galera" ]])\ |
467 |
-&& mysql_check_version_range "5.1.38 to 5.3.99" \ |
468 |
-&& DEPEND="${DEPEND} libevent? ( >=dev-libs/libevent-1.4 )" |
469 |
+if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] ; then |
470 |
+ mysql_check_version_range "5.1.38 to 5.3.99" && DEPEND="${DEPEND} libevent? ( >=dev-libs/libevent-1.4 )" |
471 |
+ mysql_version_is_at_least "5.2" && DEPEND="${DEPEND} oqgraph? ( >=dev-libs/boost-1.40.0 )" |
472 |
+ mysql_version_is_at_least "5.2.5" && DEPEND="${DEPEND} sphinx? ( app-misc/sphinx )" |
473 |
+ mysql_version_is_at_least "5.2.10" && DEPEND="${DEPEND} !minimal? ( pam? ( virtual/pam ) )" |
474 |
+ # Bug 441700 MariaDB >=5.3 include custom mytop |
475 |
+ mysql_version_is_at_least "5.3" && DEPEND="${DEPEND} perl? ( !dev-db/mytop )" |
476 |
+ |
477 |
+ # Bug 455016 Add dependancies of mytop |
478 |
+ if mysql_version_is_at_least "5.3" ; then |
479 |
+ RDEPEND="${RDEPEND} perl? ( |
480 |
+ virtual/perl-Getopt-Long |
481 |
+ dev-perl/TermReadKey |
482 |
+ virtual/perl-Term-ANSIColor |
483 |
+ virtual/perl-Time-HiRes ) " |
484 |
+ fi |
485 |
+fi |
486 |
|
487 |
# Having different flavours at the same time is not a good idea |
488 |
for i in "mysql" "mariadb" "mariadb-galera" ; do |
489 |
@@ -232,32 +239,15 @@ for i in "mysql" "mariadb" "mariadb-galera" ; do |
490 |
DEPEND="${DEPEND} !dev-db/${i}" |
491 |
done |
492 |
|
493 |
-([[ ${PN} == "mariadb" ]] || [[ "${PN}" == "mariadb-galera" ]])\ |
494 |
-&& mysql_version_is_at_least "5.2" \ |
495 |
-&& DEPEND="${DEPEND} oqgraph? ( >=dev-libs/boost-1.40.0 )" |
496 |
- |
497 |
-([[ ${PN} == "mariadb" ]] || [[ "${PN}" == "mariadb-galera" ]])\ |
498 |
-&& mysql_version_is_at_least "5.2.5" \ |
499 |
-&& DEPEND="${DEPEND} sphinx? ( app-misc/sphinx )" |
500 |
- |
501 |
-([[ ${PN} == "mariadb" ]] || [[ "${PN}" == "mariadb-galera" ]])\ |
502 |
-&& mysql_version_is_at_least "5.2.10" \ |
503 |
-&& DEPEND="${DEPEND} !minimal? ( pam? ( virtual/pam ) )" |
504 |
- |
505 |
-# Bug 441700 MariaDB >=5.3 include custom mytop |
506 |
-([[ ${PN} == "mariadb" ]] || [[ "${PN}" == "mariadb-galera" ]])\ |
507 |
-&& mysql_version_is_at_least "5.3" \ |
508 |
-&& DEPEND="${DEPEND} perl? ( !dev-db/mytop )" |
509 |
- |
510 |
-mysql_version_is_at_least "5.5.7" \ |
511 |
-&& DEPEND="${DEPEND} systemtap? ( >=dev-util/systemtap-1.3 )" \ |
512 |
-&& DEPEND="${DEPEND} kernel_linux? ( dev-libs/libaio )" |
513 |
- |
514 |
-mysql_version_is_at_least "5.5" \ |
515 |
-&& DEPEND="${DEPEND} jemalloc? ( dev-libs/jemalloc )" |
516 |
+if mysql_version_is_at_least "5.5" ; then |
517 |
+ DEPEND="${DEPEND} jemalloc? ( dev-libs/jemalloc )" |
518 |
+ DEPEND="${DEPEND} tcmalloc? ( dev-util/google-perftools )" |
519 |
+fi |
520 |
|
521 |
-mysql_version_is_at_least "5.5" \ |
522 |
-&& DEPEND="${DEPEND} tcmalloc? ( dev-util/google-perftools )" |
523 |
+if mysql_version_is_at_least "5.5.7" ; then |
524 |
+ DEPEND="${DEPEND} systemtap? ( >=dev-util/systemtap-1.3 )" |
525 |
+ DEPEND="${DEPEND} kernel_linux? ( dev-libs/libaio )" |
526 |
+fi |
527 |
|
528 |
# prefix: first need to implement something for #196294 |
529 |
RDEPEND="${DEPEND} |
530 |
@@ -265,15 +255,6 @@ RDEPEND="${DEPEND} |
531 |
selinux? ( sec-policy/selinux-mysql ) |
532 |
" |
533 |
|
534 |
-# Bug 455016 Add dependancies of mytop |
535 |
-([[ ${PN} == "mariadb" ]] || [[ "${PN}" == "mariadb-galera" ]])\ |
536 |
-&& mysql_version_is_at_least "5.3" \ |
537 |
-&& RDEPEND="${RDEPEND} perl? ( |
538 |
- virtual/perl-Getopt-Long |
539 |
- dev-perl/TermReadKey |
540 |
- virtual/perl-Term-ANSIColor |
541 |
- virtual/perl-Time-HiRes ) " |
542 |
- |
543 |
DEPEND="${DEPEND} |
544 |
virtual/yacc |
545 |
" |
546 |
@@ -284,8 +265,9 @@ DEPEND="${DEPEND} static? ( sys-libs/ncurses[static-libs] )" |
547 |
DEPEND="${DEPEND} >=dev-util/cmake-2.4.3" |
548 |
|
549 |
# compile-time-only |
550 |
-mysql_version_is_at_least "5.5.8" \ |
551 |
-&& DEPEND="${DEPEND} >=dev-util/cmake-2.6.3" |
552 |
+if mysql_version_is_at_least "5.5.8" ; then |
553 |
+ DEPEND="${DEPEND} >=dev-util/cmake-2.6.3" |
554 |
+fi |
555 |
|
556 |
# dev-perl/DBD-mysql is needed by some scripts installed by MySQL |
557 |
PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )" |
558 |
@@ -301,14 +283,11 @@ PDEPEND="${PDEPEND} =virtual/mysql-${MYSQL_PV_MAJOR}" |
559 |
# PBXT_VERSION means that we have a PBXT patch for this PV |
560 |
# PBXT was only introduced after 5.1.12 |
561 |
pbxt_patch_available() { |
562 |
- [[ ${PN} != "mariadb" ]] && [[ ${PN} != "mariadb-galera" ]]\ |
563 |
- && [[ -n "${PBXT_VERSION}" ]] |
564 |
- return $? |
565 |
+ [[ ${PN} != "mariadb" && ${PN} != "mariadb-galera" && ( -n "${PBXT_VERSION}" ) ]] |
566 |
} |
567 |
|
568 |
pbxt_available() { |
569 |
- pbxt_patch_available || [[ ${PN} == "mariadb" ]] || [[ ${PN} == "mariadb-galera" ]] |
570 |
- return $? |
571 |
+ pbxt_patch_available || [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] |
572 |
} |
573 |
|
574 |
# Get the percona tarball if XTRADB_VER and PERCONA_VER are both set |
575 |
@@ -316,18 +295,15 @@ pbxt_available() { |
576 |
# XTRADB_VERS means that we have a XTRADB patch for this PV |
577 |
# XTRADB was only introduced after 5.1.26 |
578 |
xtradb_patch_available() { |
579 |
- [[ ${PN} != "mariadb" ]] && [[ ${PN} != "mariadb-galera" ]] \ |
580 |
- && [[ -n "${XTRADB_VER}" && -n "${PERCONA_VER}" ]] |
581 |
- return $? |
582 |
+ [[ ${PN} != "mariadb" && ${PN} != "mariadb-galera" |
583 |
+ && ( -n "${XTRADB_VER}" ) && ( -n "${PERCONA_VER}" ) ]] |
584 |
} |
585 |
|
586 |
- |
587 |
if pbxt_patch_available; then |
588 |
|
589 |
PBXT_P="pbxt-${PBXT_VERSION}" |
590 |
PBXT_SRC_URI="http://www.primebase.org/download/${PBXT_P}.tar.gz mirror://sourceforge/pbxt/${PBXT_P}.tar.gz" |
591 |
SRC_URI="${SRC_URI} pbxt? ( ${PBXT_SRC_URI} )" |
592 |
- |
593 |
fi |
594 |
|
595 |
# PBXT_NEWSTYLE means pbxt is in storage/ and gets enabled as other plugins |
596 |
@@ -399,8 +375,7 @@ mysql-v2_pkg_setup() { |
597 |
fi |
598 |
|
599 |
# Check for USE flag problems in pkg_setup |
600 |
- if ! mysql_version_is_at_least "5.2" \ |
601 |
- && use debug ; then |
602 |
+ if ! mysql_version_is_at_least "5.2" && use debug ; then |
603 |
# Also in package.use.mask |
604 |
die "Bug #344885: Upstream has broken USE=debug for 5.1 series >=5.1.51" |
605 |
fi |
606 |
@@ -502,13 +477,13 @@ mysql-v2_pkg_postinst() { |
607 |
|
608 |
docinto "scripts" |
609 |
for script in scripts/mysql* ; do |
610 |
- [[ -f "${script}" ]] \ |
611 |
- && [[ "${script%.sh}" == "${script}" ]] \ |
612 |
- && dodoc "${script}" |
613 |
+ if [[ -f "${script}" && "${script%.sh}" == "${script}" ]]; then |
614 |
+ dodoc "${script}" |
615 |
+ fi |
616 |
done |
617 |
|
618 |
- if [ ${PN} == "mariadb" ] \ |
619 |
- && mysql_version_is_at_least "5.2.10" && use pam ; then |
620 |
+ if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] \ |
621 |
+ && mysql_version_is_at_least "5.2.10" && use pam ; then |
622 |
einfo |
623 |
elog "This install includes the PAM authentication plugin." |
624 |
elog "To activate and configure the PAM plugin, please read:" |
625 |
@@ -589,7 +564,7 @@ mysql-v2_pkg_config() { |
626 |
local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}" |
627 |
old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}" |
628 |
|
629 |
- if [[ -d "${old_MY_DATADIR_s}" ]] && [[ "${old_MY_DATADIR_s}" != / ]]; then |
630 |
+ if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then |
631 |
if [[ -d "${MY_DATADIR_s}" ]]; then |
632 |
ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist" |
633 |
ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}" |
634 |
@@ -692,7 +667,7 @@ mysql-v2_pkg_config() { |
635 |
pushd "${TMPDIR}" &>/dev/null |
636 |
#cmd="'${EROOT}/usr/share/mysql/scripts/mysql_install_db' '--basedir=${EPREFIX}/usr' ${options}" |
637 |
cmd=${EROOT}usr/share/mysql/scripts/mysql_install_db |
638 |
- [ -f ${cmd} ] || cmd=${EROOT}usr/bin/mysql_install_db |
639 |
+ [[ -f ${cmd} ]] || cmd=${EROOT}usr/bin/mysql_install_db |
640 |
cmd="'$cmd' '--basedir=${EPREFIX}/usr' ${options}" |
641 |
einfo "Command: $cmd" |
642 |
eval $cmd \ |
643 |
@@ -773,7 +748,7 @@ mysql-v2_pkg_config() { |
644 |
mysql < "${sqltmp}" |
645 |
rc=$? |
646 |
eend $? |
647 |
- [ $rc -ne 0 ] && ewarn "Failed to load zoneinfo!" |
648 |
+ [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!" |
649 |
|
650 |
# Stop the server and cleanup |
651 |
einfo "Stopping the server ..." |