Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-db/mysql/
Date: Tue, 16 Oct 2018 16:23:29
Message-Id: 1539706997.1b14a8ec3aec4dd63d0770e5a9aea0b830e2fb38.whissi@gentoo
1 commit: 1b14a8ec3aec4dd63d0770e5a9aea0b830e2fb38
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Tue Oct 16 16:19:15 2018 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Tue Oct 16 16:23:17 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1b14a8ec
7
8 dev-db/mysql: small changes
9
10 - Build system will always check for dev-libs/protobuf when USE=server
11
12 - Make sure to subscribe to protobuf's subslot when USE=rocksdb
13
14 - Don't install files in /usr/share/doc/${P}/scripts -- they are
15 already installed in /usr/share/mysql
16
17 - Sync style with dev-db/percona-server ebuild
18
19 Package-Manager: Portage-2.3.51, Repoman-2.3.11
20 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
21
22 dev-db/mysql/Manifest | 2 +-
23 dev-db/mysql/metadata.xml | 1 +
24 ...sql-5.7.23-r1.ebuild => mysql-5.7.23-r2.ebuild} | 142 ++++++++++++---------
25 3 files changed, 87 insertions(+), 58 deletions(-)
26
27 diff --git a/dev-db/mysql/Manifest b/dev-db/mysql/Manifest
28 index c5d769125da..7641b811b68 100644
29 --- a/dev-db/mysql/Manifest
30 +++ b/dev-db/mysql/Manifest
31 @@ -3,4 +3,4 @@ DIST mysql-5.6.40.tar.gz 32083035 BLAKE2B efcc078341bae239df28ac0504111aa3492688
32 DIST mysql-5.6.41.tar.gz 32111985 BLAKE2B 5ccad59333525b354db4fa892857e237cddf8fe1a4d289c6e410c31d6142a71d3ce4dab8d954fa9932ec1f83b50e8eccd5845e082deaaa56f1c0c5e21b2ce6c0 SHA512 a62d7a68c6bb49de33f8c9e634bce53cb453a87238e92967115e8e928fa9ed291727b8bd5a5271a0b5b634d957eb310c745edfb14b6be1deb9099bb757aa2cff
33 DIST mysql-boost-5.7.23.tar.gz 49025014 BLAKE2B 669f10779bc2cda866d6bd876b4efe55fb4b0c796f596f66513a3ca85f322e2a03e9879eecd72a69729a0cb71d408c46cdd9086ae456712b4adff6ae7c584c97 SHA512 e4317f89d108a68652cd95e41ffd670c37b6663aabd6af3985d18052fb7e8d8879b5822399caf9091cecc0a949ec588c121c87cfd60d69941f68d0ecbedd0953
34 DIST mysql-extras-20180804-2323Z.tar.bz2 322215 BLAKE2B cca9e502e375bf43473335868517f6c450fc7bcf03e55de5a294c8bdcfcac2bb783dec09bbb3b6c30a561ba7e3a943543c017e2d42b61d466e699acdef4c0231 SHA512 efd9d416f394cc61b977ab76f05ab3acc5803ff8bdee8e1dbc65cc5b3f07e4f9742140d9586c028908b10fcc44f21c98ebffdebcc5c3578acbe05b07526bcb3d
35 -DIST mysql-extras-20181013-2117Z.tar.bz2 326504 BLAKE2B 5df10abacafc6835536742b10fc268d76ed39818ed704fca21e3b0d5241152640557a37ad1c0a87173223763efd6f6cba87c2e203088227738cb6eb9f4224beb SHA512 03d3ef9add033699dc6d8b6120d1fb323268a2e2b8ec9f375edfeb1c6b3878724db091bf4ae78462872efa81d1bb2e23f8ff4f6e0831d2ce8efd30465e415fa9
36 +DIST mysql-extras-20181016-1606Z.tar.bz2 327537 BLAKE2B 885b21b9f576844edf7e850cb8c7484fdadb469297adcbcd885ed0d12bb4a24324f26c4546a1fa077502f7f306b436ed48667fbfccce11be8873ff723f435b85 SHA512 b6fb00c2971cf91f0765b08b4f0449179eb5701b0eb92a184103f1129f365fee2271d27150c30a3f2fb3c2e8b669f77e65a54956f2862c6d3fe6be49e4bc0f88
37
38 diff --git a/dev-db/mysql/metadata.xml b/dev-db/mysql/metadata.xml
39 index c20a8004a28..2ec6490392c 100644
40 --- a/dev-db/mysql/metadata.xml
41 +++ b/dev-db/mysql/metadata.xml
42 @@ -13,6 +13,7 @@ dev-db/mariadb
43 <use>
44 <flag name="cjk">Add CJK support for InnoDB fulltext search using <pkg>app-text/mecab</pkg></flag>
45 <flag name="client-libs">Build the client libraries from the server package instead of the C Connector packages (not recommended)</flag>
46 + <flag name="experimental">Build experimental features aka "rapid" plugins</flag>
47 <flag name="extraengine">Add support for alternative storage engines (Archive, CSV, Blackhole, Federated(X), Partition)</flag>
48 <flag name="jemalloc">Use <pkg>dev-libs/jemalloc</pkg> for allocations.</flag>
49 <flag name="latin1">Use LATIN1 encoding instead of UTF8</flag>
50
51 diff --git a/dev-db/mysql/mysql-5.7.23-r1.ebuild b/dev-db/mysql/mysql-5.7.23-r2.ebuild
52 similarity index 91%
53 rename from dev-db/mysql/mysql-5.7.23-r1.ebuild
54 rename to dev-db/mysql/mysql-5.7.23-r2.ebuild
55 index d9f2fd4117b..ef6b22685df 100644
56 --- a/dev-db/mysql/mysql-5.7.23-r1.ebuild
57 +++ b/dev-db/mysql/mysql-5.7.23-r2.ebuild
58 @@ -2,21 +2,21 @@
59 # Distributed under the terms of the GNU General Public License v2
60
61 EAPI="6"
62 -MY_EXTRAS_VER="20181013-2117Z"
63 +MY_EXTRAS_VER="20181016-1606Z"
64
65 CMAKE_MAKEFILE_GENERATOR=emake
66
67 # Keeping eutils in EAPI=6 for emktemp in pkg_config
68
69 -inherit eutils flag-o-matic prefix toolchain-funcs \
70 - user cmake-utils multilib-minimal
71 +inherit cmake-utils eutils flag-o-matic linux-info \
72 + prefix toolchain-funcs user multilib-minimal
73
74 SRC_URI="https://cdn.mysql.com/Downloads/MySQL-5.7/${PN}-boost-${PV}.tar.gz
75 https://cdn.mysql.com/archives/mysql-5.7/mysql-boost-${PV}.tar.gz
76 http://downloads.mysql.com/archives/MySQL-5.7/${PN}-boost-${PV}.tar.gz"
77
78 # Gentoo patches to MySQL
79 -if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]]; then
80 +if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]] ; then
81 SRC_URI="${SRC_URI}
82 mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
83 https://gitweb.gentoo.org/proj/mysql-extras.git/snapshot/mysql-extras-${MY_EXTRAS_VER}.tar.bz2"
84 @@ -26,8 +26,8 @@ HOMEPAGE="https://www.mysql.com/"
85 DESCRIPTION="A fast, multi-threaded, multi-user SQL database server"
86 LICENSE="GPL-2"
87 SLOT="0/18"
88 -IUSE="cjk client-libs cracklib debug jemalloc latin1 libressl numa +perl profiling selinux
89 - +server static static-libs systemtap tcmalloc test yassl"
90 +IUSE="cjk client-libs cracklib debug experimental jemalloc latin1 libressl numa +perl profiling
91 + selinux +server static static-libs systemtap tcmalloc test yassl"
92
93 # Tests always fail when libressl is enabled due to hard-coded ciphers in the tests
94 RESTRICT="libressl? ( test )"
95 @@ -65,7 +65,7 @@ PATCHES=(
96 # Be warned, *DEPEND are version-dependant
97 # These are used for both runtime and compiletime
98 # MULTILIB_USEDEP only set for libraries used by the client library
99 -COMMON_DEPEND="net-misc/curl
100 +COMMON_DEPEND="net-misc/curl:=
101 >=sys-apps/sed-4
102 >=sys-apps/texinfo-4.7-r1
103 sys-libs/ncurses:0=
104 @@ -82,6 +82,11 @@ COMMON_DEPEND="net-misc/curl
105 server? (
106 >=app-arch/lz4-0_p131:=
107 cjk? ( app-text/mecab:= )
108 + experimental? (
109 + dev-libs/libevent:=
110 + dev-libs/protobuf:=
111 + net-libs/libtirpc:=
112 + )
113 numa? ( sys-process/numactl )
114 )
115 systemtap? ( >=dev-util/systemtap-1.3:0= )
116 @@ -98,10 +103,13 @@ COMMON_DEPEND="net-misc/curl
117 )
118 "
119 DEPEND="${COMMON_DEPEND}
120 - dev-libs/protobuf
121 || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )
122 + dev-libs/protobuf
123 virtual/yacc
124 - server? ( dev-libs/libevent )
125 + server? (
126 + dev-libs/libevent
127 + experimental? ( net-libs/rpcsvc-proto )
128 + )
129 static? ( sys-libs/ncurses[static-libs] )
130 "
131 RDEPEND="${COMMON_DEPEND}
132 @@ -150,13 +158,13 @@ mysql_init_vars() {
133 export PREVIOUS_DATADIR
134 fi
135 else
136 - if [[ ${EBUILD_PHASE} == "config" ]]; then
137 + if [[ ${EBUILD_PHASE} == "config" ]] ; then
138 local new_MY_DATADIR
139 new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \
140 | sed -ne '/datadir/s|^--datadir=||p' \
141 | tail -n1`
142
143 - if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then
144 + if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]] ; then
145 ewarn "MySQL MY_DATADIR has changed"
146 ewarn "from ${MY_DATADIR}"
147 ewarn "to ${new_MY_DATADIR}"
148 @@ -170,6 +178,17 @@ mysql_init_vars() {
149 export MY_DATADIR
150 }
151
152 +pkg_pretend() {
153 + if use numa ; then
154 + local CONFIG_CHECK="~NUMA"
155 +
156 + local WARNING_NUMA="This package expects NUMA support in kernel which this system does not have at the moment;"
157 + WARNING_NUMA+=" Either expect runtime errors, enable NUMA support in kernel or rebuild the package without NUMA support"
158 +
159 + check_extra_config
160 + fi
161 +}
162 +
163 pkg_setup() {
164 if [[ ${MERGE_TYPE} != binary ]] ; then
165 local GCC_MAJOR_SET=$(gcc-major-version)
166 @@ -183,6 +202,7 @@ pkg_setup() {
167 die
168 fi
169 fi
170 +
171 if has test ${FEATURES} && \
172 use server && ! has userpriv ${FEATURES} ; then
173 eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
174 @@ -233,10 +253,10 @@ pkg_postinst() {
175
176 # Note about configuration change
177 einfo
178 - elog "This version of mysql reorganizes the configuration from a single my.cnf"
179 - elog "to several files in /etc/mysql/${PN}.d."
180 + elog "This version of ${PN} reorganizes the configuration from a single my.cnf"
181 + elog "to several files in /etc/mysql/mysql.d."
182 elog "Please backup any changes you made to /etc/mysql/my.cnf"
183 - elog "and add them as a new file under /etc/mysql/${PN}.d with a .cnf extension."
184 + elog "and add them as a new file under /etc/mysql/mysql.d with a .cnf extension."
185 elog "You may have as many files as needed and they are read alphabetically."
186 elog "Be sure the options have the appropriate section headers, i.e. [mysqld]."
187 einfo
188 @@ -251,30 +271,38 @@ src_unpack() {
189 }
190
191 src_prepare() {
192 + cmake-utils_src_prepare
193 +
194 if use jemalloc ; then
195 echo "TARGET_LINK_LIBRARIES(mysqld jemalloc)" >> "${S}/sql/CMakeLists.txt" || die
196 fi
197 - if use tcmalloc; then
198 +
199 + if use tcmalloc ; then
200 echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt" || die
201 fi
202 +
203 # Remove the centos and rhel selinux policies to support mysqld_safe under SELinux
204 if [[ -d "${S}/support-files/SELinux" ]] ; then
205 echo > "${S}/support-files/SELinux/CMakeLists.txt" || die
206 fi
207
208 + # Remove bundled libs so we cannot accidentally use them
209 + # We keep extra/lz4 directory because we use extra/lz4/xxhash.c via sql/CMakeLists.txt:394
210 + rm -rv \
211 + "${S}"/extra/protobuf \
212 + "${S}"/libevent \
213 + "${S}"/zlib \
214 + || die
215 +
216 if use libressl ; then
217 sed -i 's/OPENSSL_MAJOR_VERSION STREQUAL "1"/OPENSSL_MAJOR_VERSION STREQUAL "2"/' \
218 "${S}/cmake/ssl.cmake" || die
219 fi
220
221 sed -i 's~ADD_SUBDIRECTORY(storage/ndb)~~' CMakeLists.txt || die
222 -
223 - cmake-utils_src_prepare
224 }
225
226 src_configure(){
227 - # bug 508724 mariadb cannot use ld.gold
228 - tc-ld-disable-gold
229 # Bug #114895, bug #110149
230 filter-flags "-O" "-O[01]"
231
232 @@ -332,7 +360,6 @@ multilib_src_configure() {
233 # The build forces this to be defined when cross-compiling. We pass it
234 # all the time for simplicity and to make sure it is actually correct.
235 -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1)
236 - -DWITH_RAPID=OFF
237 -DWITH_CURL=system
238 -DWITH_BOOST="${S}/boost"
239 -DWITH_PROTOBUF=system
240 @@ -355,7 +382,7 @@ multilib_src_configure() {
241
242 # bfd.h is only used starting with 10.1 and can be controlled by NOT_FOR_DISTRIBUTION
243 # systemtap only works on native ABI, bug 530132
244 - if multilib_is_native_abi; then
245 + if multilib_is_native_abi ; then
246 mycmakeargs+=(
247 -DENABLE_DTRACE=$(usex systemtap)
248 )
249 @@ -368,15 +395,15 @@ multilib_src_configure() {
250 fi
251
252 if multilib_is_native_abi && use server ; then
253 -
254 mycmakeargs+=(
255 -DWITH_LIBEVENT=system
256 -DWITH_LZ4=system
257 -DWITH_MECAB=$(usex cjk system OFF)
258 -DWITH_NUMA=$(usex numa ON OFF)
259 + -DWITH_RAPID=$(usex experimental ON OFF)
260 )
261
262 - if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then
263 + if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]] ; then
264 ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}"
265 ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}."
266 ewarn "You MUST file bugs without these variables set."
267 @@ -411,7 +438,7 @@ multilib_src_configure() {
268 mycmakeargs+=( -DENABLED_PROFILING=ON )
269 fi
270
271 - if use static; then
272 + if use static ; then
273 mycmakeargs+=( -DWITH_PIC=1 )
274 fi
275
276 @@ -424,10 +451,10 @@ multilib_src_configure() {
277 -DWITH_FEDERATED_STORAGE_ENGINE=1
278 -DWITH_HEAP_STORAGE_ENGINE=1
279 -DWITH_INNOBASE_STORAGE_ENGINE=1
280 + -DWITH_INNODB_MEMCACHED=0
281 -DWITH_MYISAMMRG_STORAGE_ENGINE=1
282 -DWITH_MYISAM_STORAGE_ENGINE=1
283 -DWITH_PARTITION_STORAGE_ENGINE=1
284 - -DWITH_INNODB_MEMCACHED=0
285 )
286
287 else
288 @@ -481,7 +508,7 @@ src_test() {
289 # localhost. Also causes weird failures.
290 [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
291
292 - if [[ $UID -eq 0 ]]; then
293 + if [[ $UID -eq 0 ]] ; then
294 die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
295 fi
296 has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox"
297 @@ -515,6 +542,15 @@ src_test() {
298 _disable_test "$t" "False positives in Gentoo"
299 done
300
301 + if use numa && use kernel_linux ; then
302 + # bug 584880
303 + if ! linux_config_exists || ! linux_chkconfig_present NUMA ; then
304 + for t in sys_vars.innodb_numa_interleave_basic ; do
305 + _disable_test "$t" "Test $t requires system with NUMA support"
306 + done
307 + fi
308 + fi
309 +
310 if ! use latin1 ; then
311 # The following tests will fail if DEFAULT_CHARSET
312 # isn't set to latin1:
313 @@ -646,31 +682,21 @@ multilib_src_install_all() {
314 sed -e "s!@DATADIR@!${MY_DATADIR}!g" \
315 "${FILESDIR}/${mycnf_src}" \
316 > "${TMPDIR}/my.cnf.ok" || die
317 +
318 if use prefix ; then
319 sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' \
320 "${TMPDIR}/my.cnf.ok" || die
321 fi
322 +
323 if use latin1 ; then
324 sed -i \
325 -e "/character-set/s|utf8|latin1|g" \
326 "${TMPDIR}/my.cnf.ok" || die
327 fi
328 - eprefixify "${TMPDIR}/my.cnf.ok"
329 - newins "${TMPDIR}/my.cnf.ok" 50-distro-server.cnf
330
331 - einfo "Including support files and sample configurations"
332 - docinto "support-files"
333 - local script
334 - for script in \
335 - "${S}"/support-files/magic
336 - do
337 - [[ -f "$script" ]] && dodoc "${script}"
338 - done
339 + eprefixify "${TMPDIR}/my.cnf.ok"
340
341 - docinto "scripts"
342 - for script in "${S}"/scripts/mysql* ; do
343 - [[ ( -f "$script" ) && ( "${script%.sh}" == "${script}" ) ]] && dodoc "${script}"
344 - done
345 + newins "${TMPDIR}/my.cnf.ok" 50-distro-server.cnf
346 fi
347
348 #Remove mytop if perl is not selected
349 @@ -698,14 +724,14 @@ pkg_config() {
350 die "Minimal builds do NOT include the MySQL server"
351 fi
352
353 - if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then
354 + if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]] ; then
355 local MY_DATADIR_s="${ROOT%/}/${MY_DATADIR}"
356 MY_DATADIR_s="${MY_DATADIR_s%%/}"
357 local old_MY_DATADIR_s="${ROOT%/}/${old_MY_DATADIR}"
358 old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}"
359
360 - if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then
361 - if [[ -d "${MY_DATADIR_s}" ]]; then
362 + if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]] ; then
363 + if [[ -d "${MY_DATADIR_s}" ]] ; then
364 ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist"
365 ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}"
366 else
367 @@ -715,7 +741,7 @@ pkg_config() {
368 fi
369 else
370 ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist"
371 - if [[ -d "${MY_DATADIR_s}" ]]; then
372 + if [[ -d "${MY_DATADIR_s}" ]] ; then
373 ewarn "Attempting to use ${MY_DATADIR_s}"
374 else
375 eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist"
376 @@ -728,14 +754,14 @@ pkg_config() {
377 local pwd2="b"
378 local maxtry=15
379
380 - if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then
381 + if [[ -z "${MYSQL_ROOT_PASSWORD}" ]] ; then
382 local tmp_mysqld_password_source=
383
384 - for tmp_mysqld_password_source in mysql client; do
385 + for tmp_mysqld_password_source in mysql client ; do
386 einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..."
387 MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)"
388 - if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then
389 - if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then
390 + if [[ -n "${MYSQL_ROOT_PASSWORD}" ]] ; then
391 + if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]] ; then
392 ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!"
393 MYSQL_ROOT_PASSWORD=
394 continue
395 @@ -747,7 +773,7 @@ pkg_config() {
396 done
397
398 # Sometimes --show is required to display passwords in some implementations of my_print_defaults
399 - if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then
400 + if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]] ; then
401 MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)"
402 fi
403
404 @@ -760,15 +786,17 @@ pkg_config() {
405 MYSQL_LOG_BIN="$(_getoptval mysqld log-bin)"
406 MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*}
407
408 - if [[ ! -d "${EROOT%/}/$MYSQL_TMPDIR" ]]; then
409 + if [[ ! -d "${EROOT%/}/$MYSQL_TMPDIR" ]] ; then
410 einfo "Creating MySQL tmpdir $MYSQL_TMPDIR"
411 install -d -m 770 -o mysql -g mysql "${EROOT%/}/$MYSQL_TMPDIR"
412 fi
413 - if [[ ! -d "${EROOT%/}/$MYSQL_LOG_BIN" ]]; then
414 +
415 + if [[ ! -d "${EROOT%/}/$MYSQL_LOG_BIN" ]] ; then
416 einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN"
417 install -d -m 770 -o mysql -g mysql "${EROOT%/}/$MYSQL_LOG_BIN"
418 fi
419 - if [[ ! -d "${EROOT%/}/$MYSQL_RELAY_LOG" ]]; then
420 +
421 + if [[ ! -d "${EROOT%/}/$MYSQL_RELAY_LOG" ]] ; then
422 einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG"
423 install -d -m 770 -o mysql -g mysql "${EROOT%/}/$MYSQL_RELAY_LOG"
424 fi
425 @@ -784,7 +812,7 @@ pkg_config() {
426 # localhost. Also causes weird failures.
427 [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
428
429 - if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then
430 + if [[ -z "${MYSQL_ROOT_PASSWORD}" ]] ; then
431
432 einfo "Please provide a password for the mysql 'root' user now"
433 einfo "or through the ${HOME}/.my.cnf file."
434 @@ -823,11 +851,11 @@ pkg_config() {
435
436 # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it
437 PID_DIR="${EROOT%/}/var/run/mysqld"
438 - if [[ ! -d "${PID_DIR}" ]]; then
439 + if [[ ! -d "${PID_DIR}" ]] ; then
440 install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory"
441 fi
442
443 - if [[ ! -d "${MY_DATADIR}" ]]; then
444 + if [[ ! -d "${MY_DATADIR}" ]] ; then
445 install -d -m 750 -o mysql -g mysql "${MY_DATADIR}" || die "Could not create data directory"
446 fi
447
448 @@ -846,7 +874,7 @@ pkg_config() {
449 einfo "Command: ${cmd[*]}"
450 su -s /bin/sh -c "${cmd[*]}" mysql \
451 >"${TMPDIR%/}"/mysql_install_db.log 2>&1
452 - if [ $? -ne 0 ]; then
453 + if [[ $? -ne 0 ]] ; then
454 grep -B5 -A999 -i "ERROR" "${TMPDIR%/}"/mysql_install_db.log 1>&2
455 die "Failed to initialize mysqld. Please review ${EPREFIX%/}/var/log/mysql/mysqld.err AND ${TMPDIR%/}/mysql_install_db.log"
456 fi
457 @@ -881,7 +909,7 @@ pkg_config() {
458 done
459 eend $rc
460
461 - if ! [[ -S "${socket}" ]]; then
462 + if ! [[ -S "${socket}" ]] ; then
463 die "Completely failed to start up mysqld with: ${mysqld}"
464 fi