summaryrefslogtreecommitdiff
path: root/dev-db
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-07-04 08:06:08 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-07-04 08:06:08 +0100
commit2a8d2f71d1d9963368e0ef3d641d75979a689d12 (patch)
tree83e283f960ab2ebbc1a042b8ed6c37b78d47b37b /dev-db
parent8435c842b9e8fbb2bcc80397ab3aa655000459e2 (diff)
gentoo auto-resync : 04:07:2024 - 08:06:07
Diffstat (limited to 'dev-db')
-rw-r--r--dev-db/Manifest.gzbin16769 -> 16770 bytes
-rw-r--r--dev-db/firebird/Manifest6
-rw-r--r--dev-db/firebird/files/firebird.logrotate2
-rw-r--r--dev-db/firebird/firebird-3.0.10.33601.0-r2.ebuild (renamed from dev-db/firebird/firebird-3.0.10.33601.0-r1.ebuild)0
-rw-r--r--dev-db/firebird/firebird-3.0.4.33054.0-r3.ebuild (renamed from dev-db/firebird/firebird-3.0.4.33054.0-r2.ebuild)0
-rw-r--r--dev-db/mysql/Manifest2
-rw-r--r--dev-db/mysql/mysql-8.0.37.ebuild1281
-rw-r--r--dev-db/sqlcl-bin/Manifest4
-rw-r--r--dev-db/sqlcl-bin/sqlcl-bin-24.1.0.087.0929.ebuild (renamed from dev-db/sqlcl-bin/sqlcl-bin-23.4.0.023.2321.ebuild)8
9 files changed, 1293 insertions, 10 deletions
diff --git a/dev-db/Manifest.gz b/dev-db/Manifest.gz
index 883b6c8fa53c..78611b424f9a 100644
--- a/dev-db/Manifest.gz
+++ b/dev-db/Manifest.gz
Binary files differ
diff --git a/dev-db/firebird/Manifest b/dev-db/firebird/Manifest
index 0c65fafc6bad..8066097c629e 100644
--- a/dev-db/firebird/Manifest
+++ b/dev-db/firebird/Manifest
@@ -6,7 +6,7 @@ AUX firebird-3.0.2.32703.0-cloop-compiler.patch 349 BLAKE2B 6906993819f5aa68c395
AUX firebird-3.0.2.32703.0-unbundle.patch 1786 BLAKE2B 660af04975ecfdac0ae12a1ee89e0a4d97d321ac7de7e17ba53484a909962584828c18d1f119ecc1af63c1cb2b93f451b847c9363a25831630a807b89ad13bc8 SHA512 bb0f8cb283ee230f9128a9da16da21933a1709615b34bbfac117a0563e2451a07381b52ffc1fed665e74688ff8e2c2548f86c1413427665914cb3df8500543c5
AUX firebird.init.d.3.0 642 BLAKE2B 70f9b07a69c01e391ea8b1f1747a35eb303ff43a4923d65f76064257bfe5178601fa0b06dbf332b6a3529df30ddbe3e3c58e170ca33acfeb06a32474f1806938 SHA512 0805311d7e4ceb9cd5266be88fe61fb7d2d7cf5bf3c9482841c6431767cba9960d4f38418629519b23cdf64893173ebd01641056123ddc7f24c1f1bbf969812b
AUX firebird.init.d.3.0-r1 637 BLAKE2B 18d947e20229f217ba0fb2d1df2cab8241c1f7e48087c0673cd02c43f3653b3d68fcc99359dffd1c5c6dffec0c0f50ca7ea16eb1042ca4a1fd0deb386c0847b9 SHA512 91393e1dd2a543a0382502897bed38f1d77f20c291e76bf6c27d77bf9e820cae714c6643b7f464d1e3b3294c4fee49e818c8cf57601bdf72221fcf63105fa50a
-AUX firebird.logrotate 169 BLAKE2B 84d2d17eb1b2afa10ec17788add2ec09e42b354d7e4c9e513fe0c0f7d88390d26d41293b327b658c940d620b871796f3c41eb6b6fc69d9aae61ccb04308425c5 SHA512 d2c7c218e3ce5570e3c89408b391f754c900f5d7074a75f38eb08c66c6f0695eae5db62c80d7937d076f32f1b62b3cbc755f1d4ec633b24ed2b9a7043e531d2f
+AUX firebird.logrotate 178 BLAKE2B 3ec7db249080dc42ad063d3288d24c0c2c3a1172a48099a7a65d34249b8509ee482bcad964700cc57ed4749715b12ba756440888b81312f3d5695f99fee606fc SHA512 82ce8d2cdb2907f4e2e12cac520ec379a6e748ea4f5cb4c1c88167349a3d653bfaf58ceeaf1ce4acd65bdc8ad49eb0601c7c77527847e1a134cddc397355d98a
AUX firebird.xinetd.3.0 193 BLAKE2B 34017b978344bc2b05cfe7b92eafd56ba20dd78d1fa21dfb5455d7972325cedae9a6ac25b4fa491899b19cb3bbe2949b8ca78626467100661767f6c944b01c20 SHA512 e02c011b55c1d6823b051d14dbfabef6d034db32ee8046adc796fdf393c837b995c270e0efdcb97950f6fead82cd73773099a247dc29961b0e8f6c4f6c0723ae
DIST Firebird-3.0.10.33601-0.tar.bz2 13270269 BLAKE2B 1c30b002525287b239a6e24e59f146fdb61e1a9880cf66f2c59605b9f2a28c42603e21b2c5275e03a319af24c18f8fa5a7fa73f34c9a0d6c19e36e69864ad122 SHA512 0297a191ea1d0eda9557519d8ce6b7686cc3698a98b9c6c00547c2d36bf098083ae9d34b61614a7232b6195344bea1d66d2cbd3b092844b11f5b139162f8f886
DIST Firebird-3.0.4.33054-0.tar.bz2 9778106 BLAKE2B 4b9116cbc351e0c2e10d15e6ea8e9754a383da77d8e016337604143eb2677ff2519da34b1a5c2e9b7b071fa9774eddbb535e9f926058ee626573b0411f6c042d SHA512 a346ebd53aeccf0b33eac5d35c3c3356624c1fbd0ad897173b3f68d940143062b28460a2822df807e8e8a1ea8792ebf98ed33e5b3ae273d86e6e36295a7fc8ad
@@ -26,6 +26,6 @@ DIST firebird-nbackup.pdf 202108 BLAKE2B 5ee794890f69935ec238d946649d05a72c31086
DIST firebird-null-guide.pdf 487359 BLAKE2B 346d942b7d4780496c2c212433660415437f6b17a42bb109aaf1cd8a8de31a394a1d2a3b52bb6dc1c3830bc839a692b611c7fe3289243e86ab874a84d989a7b8 SHA512 b5b9981a3f15fe933a44deb001d1d85b0dc340ae0ff55e79d160da8590406515f0ba73360a3904556aa36d94cdafb17fe2452b5f63138cb1f585d70842511cd3
DIST ib_b60_doc.zip 10530848 BLAKE2B b4008b3e8b0416014d024cbbc9ac2e648ad671c71b91b7aeb0eedf0f8479aef80e22aff7105c5e7417e88bcf57f2cdacbc2d5f51a2ef7fb870f9d361c5f0ed6d SHA512 59eccf1d6b1f0410eddbc5967fd77a3d00e09749640b3f81e2f8b624f5a45461dffad4af5ec61488e941fb3d3af266fe86c0b56e6b7e023239537cb6557a145a
DIST using-firebird.pdf 236646 BLAKE2B 54b296ac8c6281ff501678a24dac76e203a66e569b1cda7dc475a7fe9bbed9fc03923377c320a621a225d0277fc68cfb9820514d3f12191902cdeb18ccb87270 SHA512 ec16c33082524aa5df8907c1143a8707f1193c42882956c220e6c95442d43751ec3e2ba77ded004866f7dab7f58ecf4fac3a0027cf89ec7536c0771260f09cc4
-EBUILD firebird-3.0.10.33601.0-r1.ebuild 7583 BLAKE2B 02034a69e21c20f544fd9c4382ce510b6100c9bc7441a9a3d4304bbcdafaab5ed0819ac09313bbbfcb9c8bd2e7e2adc089a8646dd9609008631749dc00e6104e SHA512 6f2d64570889c30039f8e66be20283406d98603b5b742a2acf98dbcb173b048c387c1b16dfdf82819f7d13c9f0c7b3906bef121fa77fd06cbe3fdd718a269bac
-EBUILD firebird-3.0.4.33054.0-r2.ebuild 6110 BLAKE2B ab478e5c0d594e636315bc767969d3c7fc528b80e0620bac543a9fc35c2027cadbb2537686d83d3f8fc22d1a6ef3751b2676462a25319cff21f1670471c5f6df SHA512 07a1b3c480218bcafdad9c64cd3e42eb61279132f8bef1cd63890acd95f326eb9a5ce5096c5b903a5f82d7f829b1c50c2d5a5a513d03495f6e20e8cd6796f0b7
+EBUILD firebird-3.0.10.33601.0-r2.ebuild 7583 BLAKE2B 02034a69e21c20f544fd9c4382ce510b6100c9bc7441a9a3d4304bbcdafaab5ed0819ac09313bbbfcb9c8bd2e7e2adc089a8646dd9609008631749dc00e6104e SHA512 6f2d64570889c30039f8e66be20283406d98603b5b742a2acf98dbcb173b048c387c1b16dfdf82819f7d13c9f0c7b3906bef121fa77fd06cbe3fdd718a269bac
+EBUILD firebird-3.0.4.33054.0-r3.ebuild 6110 BLAKE2B ab478e5c0d594e636315bc767969d3c7fc528b80e0620bac543a9fc35c2027cadbb2537686d83d3f8fc22d1a6ef3751b2676462a25319cff21f1670471c5f6df SHA512 07a1b3c480218bcafdad9c64cd3e42eb61279132f8bef1cd63890acd95f326eb9a5ce5096c5b903a5f82d7f829b1c50c2d5a5a513d03495f6e20e8cd6796f0b7
MISC metadata.xml 898 BLAKE2B 0233f529337d00c8f0682983bf17e684ecabf35e0def11b284043d3df03d330ac3dfac04ebe613dca6de39628fcbd9f93783cfa537a3fb2943db66ac893cebd9 SHA512 427aa3c158e914471cb3d71058e3a067afce5bb4313fed1ea22f6777443d73dcc88f52c6526aafd69b6f0f8137a340f42676a85c6351c025c45dd91558715070
diff --git a/dev-db/firebird/files/firebird.logrotate b/dev-db/firebird/files/firebird.logrotate
index a4542b47ea93..ac4a74b26041 100644
--- a/dev-db/firebird/files/firebird.logrotate
+++ b/dev-db/firebird/files/firebird.logrotate
@@ -6,5 +6,5 @@
size +1024k
delaycompress
notifempty
- create 644 firebird
+ create 644 firebird firebird
}
diff --git a/dev-db/firebird/firebird-3.0.10.33601.0-r1.ebuild b/dev-db/firebird/firebird-3.0.10.33601.0-r2.ebuild
index 5fd90979b8e5..5fd90979b8e5 100644
--- a/dev-db/firebird/firebird-3.0.10.33601.0-r1.ebuild
+++ b/dev-db/firebird/firebird-3.0.10.33601.0-r2.ebuild
diff --git a/dev-db/firebird/firebird-3.0.4.33054.0-r2.ebuild b/dev-db/firebird/firebird-3.0.4.33054.0-r3.ebuild
index 6f2ba7ca3b89..6f2ba7ca3b89 100644
--- a/dev-db/firebird/firebird-3.0.4.33054.0-r2.ebuild
+++ b/dev-db/firebird/firebird-3.0.4.33054.0-r3.ebuild
diff --git a/dev-db/mysql/Manifest b/dev-db/mysql/Manifest
index dbce67ecb7cb..a256bf70e93d 100644
--- a/dev-db/mysql/Manifest
+++ b/dev-db/mysql/Manifest
@@ -18,10 +18,12 @@ DIST mysql-boost-8.0.31.tar.gz 334504577 BLAKE2B 0506472c732351a1055be9bbd81212e
DIST mysql-boost-8.0.32.tar.gz 436207624 BLAKE2B 8a75fd6fe12d4f870622b3386118737b8f17d116df625ef6187647c870d456823543e0a1e9aa05fff53313c3872df1df23add2508ec735bb7972718fc1e90539 SHA512 937e0d0350cb583bb4de15b080f08ed92b253a6d7c09f13a028855dae154fc84f0c95fb082b818b2fa6fa792cd2d9db8d7dc7a20a2a0d3d2b6839fbd2c821b44
DIST mysql-boost-8.0.34.tar.gz 439550780 BLAKE2B f50701b7e97e6cec21d6ce0f80f07a8df68a14c637a67841c06f578be8ed01d216dcb3b859a29f1befd4223b99e60675d6fa70f4b227bf6af81804e2c43161d4 SHA512 e5e79ac6870c214cf62c8e2830106d60e09d2e6df30654b84bb5d26864b4eabe777468a223e6ee4c1e22b7f6ec086c73e85e3f4c1fa66912b0e59b606ab46cd6
DIST mysql-boost-8.0.36.tar.gz 438154682 BLAKE2B 066c9dd7f2804ad29808c3bfcf5eae53466f7c40cf1386a9c1f26a0b45dcc3eda8d9618de36e8008e5e4d58b726d6c8ca85aec8d1eda8981f5a49e495b32f046 SHA512 a6c1c009a322b7e7aa2aa607573060414c847c77d48f44a24058ffb89673621f2ebbcc1a4448fa841a87ff721159cc8eaf44a57721c7dc233c130691c16a9d4a
+DIST mysql-boost-8.0.37.tar.gz 445594692 BLAKE2B 105521985ec8c622a28b5e0f7f13e519b2d91af6ce7c2b483cf1c096aa79f156cc59eabb6281b485d6f558eb6e20a95d5edc349bbd72d1c4a2591eef59270f4c SHA512 4c6033d4f96990d3f324f0d5733273425ddf7cc11660e110e0dc848da6cfa47b7565c1eb0b5d1e08878a0ea2c7d1eb85b400ccca28e5b4383f7e9216ba3e1660
EBUILD mysql-5.7.41.ebuild 38694 BLAKE2B 4a9759253852a10b64d093d756f533c00c9f11c0864831e570bedbe4cdbc2d53fe8e3a122e13335a924ab27bb4c69bd58d13768456efecb5dc55d9ae9ee490fa SHA512 d4777b8a2c029e1a744814463e3fc05525379575f6820ed9fcda7f3278c651acc054a5e130fa8d4c312bc5b04a4ef36c739f16da9af46183a3e57ccabeb5bee9
EBUILD mysql-8.0.27-r1.ebuild 40508 BLAKE2B 5f2e62ce42582929b30cf3f4536d43d1c85a9569e77a1a6f01b02f96367a0b4841ac140b2c0a8689fc1330dcae7e7acc5478b95703f55f807c8284569a34bf05 SHA512 32760dc886c67e2d9a343037fca648d73356e830cd627e848b4495e1ce8408bd2db701907f815452802ca242f14c983a582c220e4131e2b5cc591dcf99ea1dea
EBUILD mysql-8.0.31-r2.ebuild 40554 BLAKE2B 3c1930c3dbc66783e490cbe0e9583d54ea74119f51c9ee9cdffe54d1b7039ed2195954465c1f3bba7e2dd812f3658e9ff74999ceed08113b5c7158f3967594dd SHA512 ccd8c45981644edca27e3f022dddee64defaf6fd4c0e7bfc6aa4faed956492d2ace1836bdeb95f1a47b014d1c86617121ad07939bc257a88adb3531def756e42
EBUILD mysql-8.0.32-r2.ebuild 40298 BLAKE2B 26ece821d8aebd85b745b0ce3bd72466616f92418a92b6496b49f2206d7e23d9eb86139c6a4b9aaa2a63738748cf53a65863f2910e89f8400f2852afc4b065c6 SHA512 23bc6425039c3ea2aae640663608d36f4b8d639dcebf8e53fc4da28c50a181673361bb3fe02bf93bc8bee95e4be3c3781defe6f24441f211469da21a2f583c83
EBUILD mysql-8.0.34.ebuild 39617 BLAKE2B e850c6dc5976c6a6057b6ad98526405204dc2ec2c47c3a43100a2db0ba4391f1b98343155eefd329deebae45fb78c09a12c1d533ae4ad6de18372c300e921705 SHA512 6aca4b08baeff43337034f3198172327382816b7212143d7bdb1d59db0efa085d89648f264f170d5bc243f16bf24d927274cc59aa09f59729d9d6e210575cce3
EBUILD mysql-8.0.36.ebuild 41209 BLAKE2B f0573eae1a7b9ebfbd65cf634205d0a2577a5ae9fda14a272b2702a55e2c3ac1ed2ef6dd52af2dfd2ef0a965d761dc28b75d5ff482b56cb327493dfe10f6c778 SHA512 6e29a2a355aa677b52ce39807cdbf0f5bd457140fb735be0863c57bd613ca403d35a3871a0fedda3c1825b001558a3d9fab9b5f0b963e32a228d05e4ae188fff
+EBUILD mysql-8.0.37.ebuild 41727 BLAKE2B 824dda587be695ea6af4c804abfbaf27f8bc9b84447f40b5a54ae8a7be355f385a9be31a98bb14908ea4f7adfc201e287666ea167364d5c0f244459c0961a36d SHA512 6afa304b08546a958d6c2a4c907b80b330e61514ee36af71702c00ae5044a4cbd7a63d9b9332fa323cb27c4dea39ccb651dcdfdd039e82782d46966738599959
MISC metadata.xml 1353 BLAKE2B ec0454ffdcce75567e9817fa199f1e6ec1ac73520001c299b794cbfebcd42f9e5abfcf9e6faec47bd0b04f40b03846798f1735e1561c91e4e3c0df48627fe4da SHA512 d5f33d05fd1505d13afa2e968cbfcbe1c6ad6a581468608ed1fd88daf1dd17dd66fbc55b8b6eceb42e2d03bd4327985ff7432c668f983775b103e4375b4ad8c6
diff --git a/dev-db/mysql/mysql-8.0.37.ebuild b/dev-db/mysql/mysql-8.0.37.ebuild
new file mode 100644
index 000000000000..27ef30ae8d8c
--- /dev/null
+++ b/dev-db/mysql/mysql-8.0.37.ebuild
@@ -0,0 +1,1281 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit check-reqs cmake edo flag-o-matic linux-info multiprocessing prefix toolchain-funcs
+
+MY_PV="${PV//_pre*}"
+MY_P="${PN}-${MY_PV}"
+
+# Patch version
+PATCH_SET=( https://github.com/parona-source/mysql-server/releases/download/mysql-8.0.36-patches-01/mysql-8.0.36-patches-01.tar.xz )
+
+DESCRIPTION="A fast, multi-threaded, multi-user SQL database server"
+HOMEPAGE="https://www.mysql.com/"
+SRC_URI="https://cdn.mysql.com/Downloads/MySQL-$(ver_cut 1-2)/mysql-boost-${MY_PV}.tar.gz"
+SRC_URI+=" https://cdn.mysql.com/archives/mysql-$(ver_cut 1-2)/mysql-boost-${MY_PV}.tar.gz"
+SRC_URI+=" https://downloads.mysql.com/archives/MySQL-$(ver_cut 1-2)/${PN}-boost-${MY_PV}.tar.gz"
+SRC_URI+=" ${PATCH_SET[@]}"
+# Shorten the path because the socket path length must be shorter than 107 chars
+# and we will run a mysql server during test phase
+S="${WORKDIR}/mysql"
+
+LICENSE="GPL-2"
+SLOT="8.0"
+# -ppc for bug #761715
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips -ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris"
+IUSE="cjk cracklib debug jemalloc latin1 numa +perl profiling router selinux +server tcmalloc test"
+RESTRICT="!test? ( test )"
+
+REQUIRED_USE="?? ( tcmalloc jemalloc )
+ cjk? ( server )
+ jemalloc? ( server )
+ numa? ( server )
+ profiling? ( server )
+ router? ( server )
+ tcmalloc? ( server )"
+
+# Be warned, *DEPEND are version-dependent
+# These are used for both runtime and compiletime
+COMMON_DEPEND="
+ >=app-arch/lz4-1.9.4:=
+ >=app-arch/zstd-1.2.0:=
+ >=dev-libs/openssl-1.0.0:=
+ sys-libs/ncurses:=
+ >=sys-libs/zlib-1.2.13:=
+ server? (
+ dev-libs/icu:=
+ dev-libs/libevent:=[ssl,threads(+)]
+ net-libs/libtirpc:=
+ cjk? ( app-text/mecab )
+ jemalloc? ( dev-libs/jemalloc:= )
+ kernel_linux? (
+ dev-libs/libaio
+ sys-process/procps
+ )
+ numa? ( sys-process/numactl )
+ tcmalloc? ( dev-util/google-perftools:= )
+ )
+"
+
+# https://bugs.gentoo.org/623962
+# tests set TZ for tests leading to failures on musl if sys-libs/timezone-data isnt installed
+DEPEND="
+ ${COMMON_DEPEND}
+ app-alternatives/yacc
+ server? ( net-libs/rpcsvc-proto )
+ test? (
+ acct-group/mysql acct-user/mysql
+ dev-perl/Expect
+ dev-perl/JSON
+ sys-libs/timezone-data
+ )
+"
+RDEPEND="
+ ${COMMON_DEPEND}
+ !dev-db/mariadb
+ !dev-db/mariadb-galera
+ !dev-db/percona-server
+ !dev-db/mysql-cluster
+ !dev-db/mysql:0
+ !dev-db/mysql:5.7
+ selinux? ( sec-policy/selinux-mysql )
+ !prefix? (
+ acct-group/mysql acct-user/mysql
+ dev-db/mysql-init-scripts
+ )
+"
+# For other stuff to bring us in
+# dev-perl/DBD-mysql is needed by some scripts installed by MySQL
+PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )"
+
+PATCHES=(
+ "${WORKDIR}"/mysql-patches
+ # Needed due to bundled boost-1.77, this fix is included in boost-1.81
+ "${FILESDIR}"/mysql-8.0.36-boost-clang-fix.patch
+)
+
+mysql_init_vars() {
+ : ${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mysql"}
+ : ${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"}
+ : ${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"}
+ : ${MY_LOGDIR="${EPREFIX}/var/log/mysql"}
+ MY_DATADIR="${MY_LOCALSTATEDIR}"
+
+ export MY_SHAREDSTATEDIR MY_SYSCONFDIR
+ export MY_LOCALSTATEDIR MY_LOGDIR
+ export MY_DATADIR
+}
+
+pkg_pretend() {
+ if [[ ${MERGE_TYPE} != binary ]] ; then
+ if use server ; then
+ CHECKREQS_DISK_BUILD="3G"
+
+ if has test ${FEATURES} ; then
+ CHECKREQS_DISK_BUILD="10G"
+
+ if use elibc_musl; then
+ # <parona@protonmail.com> i've seen it take 17GB on musl with FEATURES="test" USE="perl server"
+ CHECKREQS_DISK_BUILD="18G"
+ fi
+ fi
+
+ check-reqs_pkg_pretend
+ fi
+ fi
+}
+
+pkg_setup() {
+ if [[ ${MERGE_TYPE} != binary ]] ; then
+ CHECKREQS_DISK_BUILD="3G"
+
+ if has test ${FEATURES} ; then
+ CHECKREQS_DISK_BUILD="10G"
+
+ if use elibc_musl; then
+ # <parona@protonmail.com> i've seen it take 17GB on musl with FEATURES="test" USE="perl server"
+ CHECKREQS_DISK_BUILD="18G"
+ fi
+
+ # Bug #213475 - MySQL _will_ object strenuously if your machine is named
+ # localhost. Also causes weird failures.
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
+
+ if ! has userpriv ${FEATURES} ; then
+ die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
+ fi
+
+ local aio_max_nr=$(sysctl -n fs.aio-max-nr 2>/dev/null)
+ if [[ -z "${aio_max_nr}" || ${aio_max_nr} -lt 250000 ]] ; then
+ die "FEATURES=test will require fs.aio-max-nr=250000 at minimum!"
+ fi
+
+ if use latin1 ; then
+ # Upstream only supports tests with default charset
+ die "Testing with USE=latin1 is not supported."
+ fi
+ fi
+
+ if use kernel_linux && use numa ; then
+ linux-info_get_any_version
+
+ local CONFIG_CHECK="~NUMA"
+
+ local WARNING_NUMA="This package expects NUMA support in kernel which this system does not have at the moment;"
+ WARNING_NUMA+=" Either expect runtime errors, enable NUMA support in kernel or rebuild the package without NUMA support"
+
+ check_extra_config
+ fi
+
+ use server && check-reqs_pkg_setup
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+
+ mv -f "${WORKDIR}/${MY_P}" "${S}" || die
+}
+
+src_prepare() {
+ # Avoid rpm call which would trigger sandbox, #692368
+ sed -i \
+ -e 's/MY_RPM rpm/MY_RPM rpmNOTEXISTENT/' \
+ CMakeLists.txt || die
+
+ # Remove the centos and rhel selinux policies to support mysqld_safe under SELinux
+ if [[ -d "${S}/support-files/SELinux" ]] ; then
+ echo > "${S}/support-files/SELinux/CMakeLists.txt" || die
+ fi
+
+ # Remove man pages for client-lib tools we don't install
+ rm \
+ man/my_print_defaults.1 \
+ man/perror.1 \
+ man/zlib_decompress.1 \
+ || die
+
+ cmake_src_prepare
+}
+
+src_configure() {
+ # Bug #114895, bug #110149
+ filter-flags "-O" "-O[01]"
+
+ # Code is now requiring C++17 due to https://github.com/mysql/mysql-server/commit/236ab55bedd8c9eacd80766d85edde2a8afacd08
+ append-cxxflags -std=c++17
+
+ if has sandbox ${FEATURES} ; then
+ # bug #823656
+ append-cppflags -DGTEST_NO_DEATH_TEST=1
+ fi
+
+ local mycmakeargs=(
+ -Wno-dev # less noise
+
+ # Building everything as shared breaks upstream assumptions.
+ # For example bundled abseil is excpected to be static and is therefore not installed.
+ # Breaking the assumption leading the mysql to being built against bundled abseil,
+ # but then dynamically linked against system abseil once installed.
+ -DBUILD_SHARED_LIBS=OFF
+
+ -DMYSQL_DATADIR="${EPREFIX}/var/lib/mysql"
+ -DSYSCONFDIR="${EPREFIX}/etc/mysql"
+
+ -DINSTALL_BINDIR=bin
+ -DINSTALL_DOCDIR=share/doc/${PF}
+ -DINSTALL_DOCREADMEDIR=share/doc/${PF}
+ -DINSTALL_INCLUDEDIR=include/mysql
+ -DINSTALL_INFODIR=share/info
+ -DINSTALL_LIBDIR=$(get_libdir)
+ -DINSTALL_MANDIR=share/man
+ -DINSTALL_MYSQLSHAREDIR=share/mysql
+ -DINSTALL_PLUGINDIR=$(get_libdir)/mysql/plugin
+ -DINSTALL_MYSQLDATADIR="${EPREFIX}/var/lib/mysql"
+ -DINSTALL_SBINDIR=sbin
+ -DINSTALL_SUPPORTFILESDIR="${EPREFIX}/usr/share/mysql"
+
+ -DROUTER_INSTALL_LOGROTATEDIR="${EPREFIX}/etc/logrotate.d"
+ -DROUTER_INSTALL_DOCDIR="share/doc/${PF}"
+
+ -DCOMPILATION_COMMENT="Gentoo Linux ${PF}"
+ -DWITH_UNIT_TESTS=$(usex test ON OFF)
+
+ # Enables -Werror
+ -DMYSQL_MAINTAINER_MODE=OFF
+
+ # Causes issues on musl bug #922808
+ -DWITH_BUILD_ID=OFF
+
+ # Using bundled editline to get CTRL+C working
+ -DWITH_EDITLINE=bundled
+ -DWITH_ZLIB=system
+ -DWITH_SSL=system
+ -DWITH_LIBWRAP=0
+ -DENABLED_LOCAL_INFILE=1
+ -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock"
+ -DWITH_DEFAULT_COMPILER_OPTIONS=0
+ -DCMAKE_POSITION_INDEPENDENT_CODE=ON
+
+ -DWITH_CURL=system
+ -DWITH_BOOST="${S}/boost"
+ -DWITH_ROUTER=$(usex router ON OFF)
+ )
+
+ if use debug; then
+ # Debug build type used extensively to add preprocessor definitions
+ local -x CMAKE_BUILD_TYPE="Debug"
+ else
+ # debug hack wrt #497532
+ mycmakeargs+=(
+ -DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usev !debug '-DNDEBUG' )"
+ -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usev !debug '-DNDEBUG' )"
+ )
+ fi
+
+ if tc-is-lto ; then
+ mycmakeargs+=( -DWITH_LTO=ON )
+ else
+ mycmakeargs+=( -DWITH_LTO=OFF )
+ fi
+
+ if use test ; then
+ mycmakeargs+=( -DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test )
+ else
+ mycmakeargs+=( -DINSTALL_MYSQLTESTDIR='' )
+ fi
+
+ mycmakeargs+=( -DWITHOUT_CLIENTLIBS=YES )
+
+ mycmakeargs+=(
+ -DWITH_ICU=system
+ -DWITH_LZ4=system
+ # Our dev-libs/rapidjson doesn't carry necessary fixes for std::regex
+ -DWITH_RAPIDJSON=bundled
+ -DWITH_ZSTD=system
+ )
+
+ 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."
+ ewarn "Tests will probably fail!"
+
+ mycmakeargs+=(
+ -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET}
+ -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION}
+ )
+ elif use latin1 ; then
+ mycmakeargs+=(
+ -DDEFAULT_CHARSET=latin1
+ -DDEFAULT_COLLATION=latin1_swedish_ci
+ )
+ else
+ mycmakeargs+=(
+ -DDEFAULT_CHARSET=utf8mb4
+ -DDEFAULT_COLLATION=utf8mb4_0900_ai_ci
+ )
+ fi
+
+ if use server ; then
+ mycmakeargs+=(
+ -DWITH_EXTRA_CHARSETS=all
+ -DWITH_DEBUG=$(usex debug)
+ -DWITH_MECAB=$(usex cjk system OFF)
+ -DWITH_LIBEVENT=system
+ # Cannot handle protobuf >23 bug #912797
+ # 05/06/2024: protobuf has been updated,
+ # but it cannot handle abseil when building against system
+ # Currently bundles protobuf-25.1
+ -DWITH_PROTOBUF=bundled
+ -DWITH_NUMA=$(usex numa ON OFF)
+ )
+
+ if use jemalloc ; then
+ mycmakeargs+=( -DWITH_JEMALLOC=ON )
+ elif use tcmalloc ; then
+ mycmakeargs+=( -DWITH_TCMALLOC=ON )
+ fi
+
+ if use profiling ; then
+ # Setting to OFF doesn't work: Once set, profiling options will be added
+ # to `mysqld --help` output via sql/sys_vars.cc causing
+ # "main.mysqld--help-notwin" test to fail
+ mycmakeargs+=( -DENABLED_PROFILING=ON )
+ fi
+
+ # Storage engines
+ mycmakeargs+=(
+ -DWITH_EXAMPLE_STORAGE_ENGINE=0
+ -DWITH_ARCHIVE_STORAGE_ENGINE=1
+ -DWITH_BLACKHOLE_STORAGE_ENGINE=1
+ -DWITH_CSV_STORAGE_ENGINE=1
+ -DWITH_FEDERATED_STORAGE_ENGINE=1
+ -DWITH_HEAP_STORAGE_ENGINE=1
+ -DWITH_INNOBASE_STORAGE_ENGINE=1
+ -DWITH_INNODB_MEMCACHED=0
+ -DWITH_MYISAMMRG_STORAGE_ENGINE=1
+ -DWITH_MYISAM_STORAGE_ENGINE=1
+ )
+ else
+ mycmakeargs+=(
+ -DWITHOUT_SERVER=1
+ -DWITH_SYSTEMD=no
+ )
+ fi
+
+ cmake_src_configure
+}
+
+# Official test instructions:
+# ulimit -n 16500 && USE='perl server' FEATURES='test userpriv' \
+# ebuild mysql-X.X.XX.ebuild digest clean test install
+src_test() {
+ _disable_test() {
+ local rawtestname bug reason
+ rawtestname="${1}" ; shift
+ bug="${1}" ; shift
+ reason="${@}"
+
+ ewarn "test '${rawtestname}' disabled: '${reason}' (BUG#${bug})"
+ echo "${rawtestname} : BUG#${bug} ${reason}" >> "${T}/disabled.def"
+ }
+
+ local TESTDIR="${BUILD_DIR}/mysql-test"
+ local retstatus_tests
+
+ einfo "Official test instructions:"
+ einfo "ulimit -n 16500 && USE='perl server' FEATURES='test userpriv' ebuild ..."
+
+ if ! use server ; then
+ ewarn "Skipping server tests due to minimal build!"
+ return 0
+ fi
+
+ # Ensure that parallel runs don't die
+ local -x MTR_BUILD_THREAD="$((${RANDOM} % 100))"
+
+ local -x MTR_PARALLEL=${MTR_PARALLEL:-$(makeopts_jobs)}
+ einfo "MTR_PARALLEL is set to '${MTR_PARALLEL}'"
+
+ # Disable unit tests, run them separately with eclass defaults
+ local -x MTR_UNIT_TESTS=0
+
+ # Increase test timeouts
+ # bug #923649
+ # https://github.com/gentoo/gentoo/pull/35002#issuecomment-1926101030
+ local -x MTR_SUITE_TIMEOUT=$(( 60 * 40 )) # minutes
+ local -x MTR_TESTCASE_TIMEOUT=60 # minutes
+
+ # Include config for tests, this is for scenarios where mysql wasn't installed previously or if the
+ # configuration was from an older version.
+ sed \
+ -e "s/@GENTOO_PORTAGE_EPREFIX@/${EPREFIX}/" \
+ -e "s/@DATADIR@/${MY_DATADIR}/" \
+ "${FILESDIR}"/my.cnf-8.0.distro-client \
+ "${FILESDIR}"/my.cnf-8.0.distro-server \
+ > "${T}"/my.cnf || die
+ local -X PATH_CONFIG_FILE="${T}/my.cnf"
+
+ # Create directories because mysqladmin might run out of order
+ mkdir -p "${T}"/var-tests{,/log} || die
+
+ # Run mysql tests
+ pushd "${TESTDIR}" &>/dev/null || die
+
+ touch "${T}/disabled.def" || die
+
+ local -a disabled_tests=(
+ "auth_sec.atomic_rename_user;103512;Depends on user running test"
+ "auth_sec.keyring_file_data_qa;0;Won't work with user privileges"
+ "auth_sec.openssl_without_fips;94718;Known test failure"
+
+ "gis.geometry_class_attri_prop;5452;Known rounding error with latest AMD processors (PS)"
+ "gis.geometry_property_function_issimple;5452;Known rounding error with latest AMD processors (PS)"
+ "gis.gis_bugs_crashes;5452;Known rounding error with latest AMD processors (PS)"
+ "gis.spatial_analysis_functions_buffer;5452;Known rounding error with latest AMD processors (PS)"
+ "gis.spatial_analysis_functions_centroid;5452;Known rounding error with latest AMD processors (PS)"
+ "gis.spatial_analysis_functions_distance;5452;Known rounding error with latest AMD processors (PS)"
+ "gis.spatial_op_testingfunc_mix;5452;Known rounding error with latest AMD processors (PS)"
+ "gis.spatial_operators_intersection;5452;Known rounding error with latest AMD processors (PS)"
+ "gis.spatial_utility_function_distance_sphere;5452;Known rounding error with latest AMD processors (PS)"
+ "gis.spatial_utility_function_simplify;5452;Known rounding error with latest AMD processors (PS)"
+ "gis.st_symdifference;5452;Known rounding error with latest AMD processors (PS)"
+
+ "innodb.alter_kill;0;Known test failure -- no upstream bug yet"
+
+ "main.derived_limit;0;Known rounding error with latest AMD processors -- no upstream bug yet"
+ "main.explain_tree;0;Known rounding error with latest AMD processors -- no upstream bug yet"
+ "main.gis-precise;0;Known rounding error with latest AMD processors -- no upstream bug yet"
+ "main.mysql_load_data_local_dir;0;Known test failure -- no upstream bug yet"
+ "main.select_icp_mrr;0;Known rounding error with latest AMD processors -- no upstream bug yet"
+ "main.subquery_bugs;0;Known rounding error with latest AMD processors -- no upstream bug yet"
+ "main.subquery_sj_dupsweed;0;Known rounding error with latest AMD processors -- no upstream bug yet"
+ "main.subquery_sj_dupsweed_bka;0;Known rounding error with latest AMD processors -- no upstream bug yet"
+ "main.subquery_sj_dupsweed_bka_nobnl;0;Known rounding error with latest AMD processors -- no upstream bug yet"
+ "main.subquery_sj_firstmatch;0;Known rounding error with latest AMD processors -- no upstream bug yet"
+ "main.subquery_sj_firstmatch_bka;0;Known rounding error with latest AMD processors -- no upstream bug yet"
+ "main.subquery_sj_firstmatch_bka_nobnl;0;Known rounding error with latest AMD processors -- no upstream bug yet"
+ "main.subquery_sj_mat_bka_nobnl;0;Known rounding error with latest AMD processors -- no upstream bug yet"
+ "main.subquery_sj_all_bka_nobnl;0;Known rounding error with latest AMD processors -- no upstream bug yet"
+ "main.window_std_var;0;Known rounding error with latest AMD processors -- no upstream bug yet"
+ "main.window_std_var_optimized;0;Known rounding error with latest AMD processors -- no upstream bug yet"
+ "main.with_recursive;0;Known rounding error with latest AMD processors -- no upstream bug yet"
+ "perfschema.statement_digest_query_sample;0;Test will fail on slow hardware"
+
+ "rpl.rpl_innodb_info_tbl_slave_tmp_tbl_mismatch;0;Unstable test"
+ "rpl_gtid.rpl_multi_source_mtr_includes;97844;Unstable test"
+ "main.partition_datatype;0;Unstable test"
+
+ "sys_vars.myisam_data_pointer_size_func;87935;Test will fail on slow hardware"
+
+ "x.connection;0;Known failure - no upstream bug yet"
+ "main.slow_log;0;Known failure - no upstream bug yet"
+
+ "sys_vars.build_id_basic;0;Requires -DWITH_BUILD_ID=ON"
+ )
+
+ if ! hash zip 1>/dev/null 2>&1 ; then
+ # No need to force dep app-arch/zip for one test
+ disabled_tests+=(
+ "innodb.discarded_partition_create;0;Requires app-arch/zip"
+ "innodb.partition_upgrade_create;0;Requires app-arch/zip"
+ )
+ fi
+
+ if has_version ">=dev-libs/openssl-3.2" ; then
+ # https://bugs.mysql.com/bug.php?id=113258
+ # Fails still with 8.0.37
+ disabled_tests+=(
+ "rpl.rpl_tlsv13;0;CCM8 ciphers have a lower security level with OpenSSL 3.2"
+ "auth_sec.wl15800_ciphers_tlsv13;0;CCM8 ciphers have a lower security level with OpenSSL 3.2"
+ )
+ fi
+
+ if use debug; then
+ disabled_tests+=(
+ "innodb.dblwr_unencrypt;0;Known test failure -- no upstream bug yet"
+ )
+ fi
+
+ local test_infos_str test_infos_arr
+ for test_infos_str in "${disabled_tests[@]}" ; do
+ IFS=';' read -r -a test_infos_arr <<< "${test_infos_str}"
+
+ if [[ ${#test_infos_arr[@]} != 3 ]] ; then
+ die "Invalid test data set, not matching format: ${test_infos_str}"
+ fi
+
+ _disable_test "${test_infos_arr[0]}" "${test_infos_arr[1]}" "${test_infos_arr[2]}"
+ done
+ unset test_infos_str test_infos_arr
+
+ local -a CMAKE_SKIP_TESTS=(
+ # timing test, can be unreliable
+ "routertest_harness_net_ts_timer"
+
+ # Could not get local host address: Name or service not known(errno: -2)
+ "routertest_component_bootstrap"
+ "routertest_component_bootstrap_account"
+ "routertest_component_bootstrap_clusterset"
+ "routertest_component_config_overwrites"
+ "routertest_component_rest_api_enable"
+ "routertest_component_routing"
+ "routertest_component_sd_notify"
+ "routertest_component_state_file"
+ "routertest_integration_routing_direct"
+ "routertest_integration_routing_reuse"
+ "routertest_integration_routing_sharing"
+ "routertest_integration_routing_sharing_constrained_pools"
+ "routertest_integration_routing_sharing_restart"
+
+ # TODO: ???
+ "pfs_host-oom"
+ "pfs_user-oom"
+ "pfs"
+ )
+
+ if use debug; then
+ CMAKE_SKIP_TESTS+=(
+ # binary_log::transaction::compression::Payload_event_buffer_istream::~Payload_event_buffer_istream(): Assertion `!m_outstanding_error' failed.
+ "payload_event_buffer_istream"
+ )
+ fi
+
+ # Try to increase file limits to increase test coverage
+ if ! ulimit -n 16500 1>/dev/null 2>&1 ; then
+ # Upper limit comes from parts.partition_* tests
+ ewarn "For maximum test coverage, please raise open file limit to 16500 (ulimit -n 16500) before calling the package manager."
+
+ if ! ulimit -n 4162 1>/dev/null 2>&1 ; then
+ # Medium limit comes from '[Warning] Buffered warning: Could not increase number of max_open_files to more than 3000 (request: 4162)'
+ ewarn "For medium test coverage please raise open file limit to 4162 (ulimit -n 4162) before calling the package manager."
+
+ if ! ulimit -n 3000 1>/dev/null 2>&1 ; then
+ ewarn "For minimum test coverage, please raise open file limit to 3000 (ulimit -n 3000) before calling the package manager."
+ else
+ einfo "Will run test suite with open file limit set to 3000 (minimum test coverage)."
+ fi
+ else
+ einfo "Will run test suite with open file limit set to 4162 (medium test coverage)."
+ fi
+ else
+ einfo "Will run test suite with open file limit set to 16500 (best test coverage)."
+ fi
+
+ # run mysql-test tests
+ # Enable force restart to ensure success when tests don't cleanup sufficiently.
+ # Anything touching gtid_executed is negatively affected if you have unlucky ordering
+ nonfatal edo perl mysql-test-run.pl \
+ --force --force-restart \
+ --vardir="${T}/var-tests" --tmpdir="${T}/tmp-tests" \
+ --skip-test=tokudb --skip-test-list="${T}/disabled.def" \
+ --retry-failure=0 --max-test-fail=0
+ retstatus_tests=$?
+
+ popd &>/dev/null || die
+
+ # Cleanup is important for these testcases.
+ pkill -9 -f "${S}/ndb" 2>/dev/null
+ pkill -9 -f "${S}/sql" 2>/dev/null
+
+ local failures=""
+ [[ ${retstatus_tests} -eq 0 ]] || failures="${failures} tests"
+
+ cmake_src_test
+
+ [[ -z "${failures}" ]] || die "Test failures: ${failures}"
+ einfo "Tests successfully completed"
+}
+
+src_install() {
+ cmake_src_install
+
+ # Make sure the vars are correctly initialized
+ mysql_init_vars
+
+ # Convenience links
+ einfo "Making Convenience links for mysqlcheck multi-call binary"
+ dosym "mysqlcheck" "/usr/bin/mysqlanalyze"
+ dosym "mysqlcheck" "/usr/bin/mysqlrepair"
+ dosym "mysqlcheck" "/usr/bin/mysqloptimize"
+
+ # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir
+ if [[ -d "${ED}/usr/data" ]] ; then
+ rm -Rf "${ED}/usr/data" || die
+ fi
+
+ # Unless they explicitly specific USE=test, then do not install the
+ # testsuite. It DOES have a use to be installed, esp. when you want to do a
+ # validation of your database configuration after tuning it.
+ if ! use test ; then
+ rm -rf "${ED}/${MY_SHAREDSTATEDIR#${EPREFIX}}/mysql-test"
+ fi
+
+ # Configuration stuff
+ einfo "Building default configuration ..."
+ insinto "${MY_SYSCONFDIR#${EPREFIX}}"
+ [[ -f "${S}/scripts/mysqlaccess.conf" ]] && doins "${S}"/scripts/mysqlaccess.conf
+ cp "${FILESDIR}/my.cnf-5.7" "${TMPDIR}/my.cnf" || die
+ eprefixify "${TMPDIR}/my.cnf"
+ doins "${TMPDIR}/my.cnf"
+ insinto "${MY_SYSCONFDIR#${EPREFIX}}/mysql.d"
+ cp "${FILESDIR}/my.cnf-8.0.distro-client" "${TMPDIR}/50-distro-client.cnf" || die
+ eprefixify "${TMPDIR}/50-distro-client.cnf"
+ doins "${TMPDIR}/50-distro-client.cnf"
+
+ mycnf_src="my.cnf-8.0.distro-server"
+ sed -e "s!@DATADIR@!${MY_DATADIR}!g" \
+ "${FILESDIR}/${mycnf_src}" \
+ > "${TMPDIR}/my.cnf.ok" || die
+
+ if use prefix ; then
+ sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' \
+ "${TMPDIR}/my.cnf.ok" || die
+ fi
+
+ if use latin1 ; then
+ sed -i \
+ -e "/character-set/s|utf8mb4|latin1|g" \
+ "${TMPDIR}/my.cnf.ok" || die
+ fi
+
+ eprefixify "${TMPDIR}/my.cnf.ok"
+
+ newins "${TMPDIR}/my.cnf.ok" 50-distro-server.cnf
+
+ #Remove mytop if perl is not selected
+ [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl && rm -f "${ED}/usr/bin/mytop"
+
+ if use router ; then
+ rm -rf \
+ "${ED}/usr/LICENSE.router" \
+ "${ED}/usr/README.router" \
+ "${ED}/usr/run" \
+ "${ED}/usr/var" \
+ || die
+ fi
+
+ # Kill old libmysqclient_r symlinks if they exist. Time to fix what depends on them.
+ find "${D}" -name 'libmysqlclient_r.*' -type l -delete || die
+}
+
+pkg_postinst() {
+ # Make sure the vars are correctly initialized
+ mysql_init_vars
+
+ # Create log directory securely if it does not exist
+ # NOTE: $MY_LOGDIR contains $EPREFIX by default
+ [[ -d "${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${MY_LOGDIR}"
+
+ # Note about configuration change
+ einfo
+ elog "This version of ${PN} reorganizes the configuration from a single my.cnf"
+ elog "to several files in /etc/mysql/mysql.d."
+ elog "Please backup any changes you made to /etc/mysql/my.cnf"
+ elog "and add them as a new file under /etc/mysql/mysql.d with a .cnf extension."
+ elog "You may have as many files as needed and they are read alphabetically."
+ elog "Be sure the options have the appropriate section headers, i.e. [mysqld]."
+ einfo
+
+ if [[ -z "${REPLACING_VERSIONS}" ]] ; then
+ einfo
+ elog "You might want to run:"
+ elog " \"emerge --config =${CATEGORY}/${PF}\""
+ elog "if this is a new install."
+ einfo
+ else
+ einfo
+ elog "Upgrade process for ${PN}-8.x has changed. Please read"
+ elog "https://dev.mysql.com/doc/refman/8.0/en/upgrade-binary-package.html"
+ einfo
+ fi
+}
+
+pkg_config() {
+ _getoptval() {
+ local section="$1"
+ local flag="--${2}="
+ local extra_options="${3}"
+ local cmd=(
+ "${my_print_defaults_binary}"
+ "${extra_options}"
+ "${section}"
+ )
+ local results=( $(eval "${cmd[@]}" 2>/dev/null | sed -n "/^${flag}/s,${flag},,gp") )
+
+ if [[ ${#results[@]} -gt 0 ]] ; then
+ # When option is set multiple times only return last value
+ echo "${results[-1]}"
+ fi
+ }
+
+ _mktemp_dry() {
+ # emktemp has no --dry-run option
+ local template="${1}"
+
+ if [[ -z "${template}" ]] ; then
+ if [[ -z "${T}" ]] ; then
+ template="/tmp/XXXXXXX"
+ else
+ template="${T}/XXXXXXX"
+ fi
+ fi
+
+ local template_wo_X=${template//X/}
+ local n_X
+ let n_X=${#template}-${#template_wo_X}
+ if [[ ${n_X} -lt 3 ]] ; then
+ echo "${FUNCNAME[0]}: too few X's in template ‘${template}’" >&2
+ return
+ fi
+
+ local attempts=0
+ local character tmpfile
+ while [[ true ]] ; do
+ let attempts=attempts+1
+
+ new_file=
+ while read -n1 character ; do
+ if [[ "${character}" == "X" ]] ; then
+ tmpfile+="${RANDOM:0:1}"
+ else
+ tmpfile+="${character}"
+ fi
+ done < <(echo -n "${template}")
+
+ if [[ ! -f "${tmpfile}" ]]
+ then
+ echo "${tmpfile}"
+ return
+ fi
+
+ if [[ ${attempts} -ge 100 ]] ; then
+ echo "${FUNCNAME[0]}: Cannot create temporary file after 100 attempts." >&2
+ return
+ fi
+ done
+ }
+
+ local mysqld_binary="${EROOT}/usr/sbin/mysqld"
+ if [[ ! -x "${mysqld_binary}" ]] ; then
+ die "'${mysqld_binary}' not found! Please re-install ${CATEGORY}/${PN}!"
+ fi
+
+ local mysql_binary="${EROOT}/usr/bin/mysql"
+ if [[ ! -x "${mysql_binary}" ]] ; then
+ die "'${mysql_binary}' not found! Please re-install ${CATEGORY}/${PN}!"
+ fi
+
+ local my_print_defaults_binary="${EROOT}/usr/bin/my_print_defaults"
+ if [[ ! -x "${my_print_defaults_binary}" ]] ; then
+ die "'${my_print_defaults_binary}' not found! Please re-install dev-db/mysql-connector-c!"
+ fi
+
+ if [[ -z "${MYSQL_USER}" ]] ; then
+ MYSQL_USER=mysql
+ if use prefix ; then
+ MYSQL_USER=$(id -u -n 2>/dev/null)
+ if [[ -z "${MYSQL_USER}" ]] ; then
+ die "Failed to determine current username!"
+ fi
+ fi
+ fi
+
+ if [[ -z "${MYSQL_GROUP}" ]] ; then
+ MYSQL_GROUP=mysql
+ if use prefix ; then
+ MYSQL_GROUP=$(id -g -n 2>/dev/null)
+ if [[ -z "${MYSQL_GROUP}" ]] ; then
+ die "Failed to determine current user groupname!"
+ fi
+ fi
+ fi
+
+ # my_print_defaults needs to read stuff in $HOME/.my.cnf
+ local -x HOME="${EROOT}/root"
+
+ # Make sure the vars are correctly initialized
+ mysql_init_vars
+
+ # Read currently set data directory
+ MY_DATADIR="$(_getoptval mysqld datadir "--defaults-file='${MY_SYSCONFDIR}/my.cnf'")"
+
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named
+ # localhost. Also causes weird failures.
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
+
+ if [[ -z "${MY_DATADIR}" ]] ; then
+ die "Sorry, unable to find MY_DATADIR!"
+ elif [[ -d "${MY_DATADIR}/mysql" ]] ; then
+ ewarn "Looks like your data directory '${MY_DATADIR}' is already initialized!"
+ ewarn "Please rename or delete its content if you wish to initialize a new data directory."
+ die "${PN} data directory at '${MY_DATADIR}' looks already initialized!"
+ fi
+
+ MYSQL_TMPDIR="$(_getoptval mysqld tmpdir "--defaults-file='${MY_SYSCONFDIR}/my.cnf'")"
+ MYSQL_TMPDIR=${MYSQL_TMPDIR%/}
+ # These are dir+prefix
+ MYSQL_LOG_BIN="$(_getoptval mysqld log-bin "--defaults-file='${MY_SYSCONFDIR}/my.cnf'")"
+ MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*}
+ MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log "--defaults-file='${MY_SYSCONFDIR}/my.cnf'")"
+ MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*}
+
+ # Create missing directories.
+ # Always check if mysql user can write to directory even if we just
+ # created directory because a parent directory might be not
+ # accessible for that user.
+ PID_DIR="${EROOT}/run/mysqld"
+ if [[ ! -d "${PID_DIR}" ]] ; then
+ einfo "Creating ${PN} PID directory '${PID_DIR}' ..."
+ install -d -m 755 -o ${MYSQL_USER} -g ${MYSQL_GROUP} "${PID_DIR}" \
+ || die "Failed to create PID directory '${PID_DIR}'!"
+ fi
+
+ local _pid_dir_testfile="$(_mktemp_dry "${PID_DIR}/.pkg_config-access-test.XXXXXXXXX")"
+ [[ -z "${_pid_dir_testfile}" ]] \
+ && die "_mktemp_dry() for '${PID_DIR}/.pkg_config-access-test.XXXXXXXXX' failed!"
+
+ if use prefix ; then
+ touch "${_pid_dir_testfile}" &>/dev/null
+ else
+ su -s /bin/sh -c "touch ${_pid_dir_testfile}" ${MYSQL_USER} &>/dev/null
+ fi
+
+ if [[ $? -ne 0 ]] ; then
+ die "${MYSQL_USER} user cannot write into PID dir '${PID_DIR}'!"
+ else
+ rm "${_pid_dir_testfile}" || die
+ unset _pid_dir_testfile
+ fi
+
+ if [[ ! -d "${MY_DATADIR}" ]] ; then
+ einfo "Creating ${PN} data directory '${MY_DATADIR}' ..."
+ install -d -m 770 -o ${MYSQL_USER} -g ${MYSQL_GROUP} "${MY_DATADIR}" \
+ || die "Failed to create ${PN} data directory '${MY_DATADIR}'!"
+ fi
+
+ local _my_datadir_testfile="$(_mktemp_dry "${MY_DATADIR}/.pkg_config-access-test.XXXXXXXXX")"
+ [[ -z "${_my_datadir_testfile}" ]] \
+ && die "_mktemp_dry() for '${MY_DATADIR}/.pkg_config-access-test.XXXXXXXXX' failed!"
+
+ if use prefix ; then
+ touch "${_my_datadir_testfile}" &>/dev/null
+ else
+ su -s /bin/sh -c "touch ${_my_datadir_testfile}" ${MYSQL_USER} &>/dev/null
+ fi
+
+ if [[ $? -ne 0 ]] ; then
+ die "${MYSQL_USER} user cannot write into data directory '${MY_DATADIR}'!"
+ else
+ rm "${_my_datadir_testfile}" || die
+ unset _my_datadir_testfile
+ fi
+
+ if [[ -n "${MYSQL_TMPDIR}" && ! -d "${MYSQL_TMPDIR}" ]] ; then
+ einfo "Creating ${PN} tmpdir '${MYSQL_TMPDIR}' ..."
+ install -d -m 770 -o ${MYSQL_USER} -g ${MYSQL_GROUP} "${MYSQL_TMPDIR}" \
+ || die "Failed to create ${PN} tmpdir '${MYSQL_TMPDIR}'!"
+ fi
+
+ if [[ -z "${MYSQL_TMPDIR}" ]] ; then
+ MYSQL_TMPDIR="$(_mktemp_dry "${EROOT}/tmp/mysqld-tmp.XXXXXXXXX")"
+ [[ -z "${MYSQL_TMPDIR}" ]] \
+ && die "_mktemp_dry() for '${MYSQL_TMPDIR}' failed!"
+
+ mkdir "${MYSQL_TMPDIR}" || die
+ chown ${MYSQL_USER} "${MYSQL_TMPDIR}" || die
+ fi
+
+ # Now we need to test MYSQL_TMPDIR...
+ local _my_tmpdir_testfile="$(_mktemp_dry "${MYSQL_TMPDIR}/.pkg_config-access-test.XXXXXXXXX")"
+ [[ -z "${_my_tmpdir_testfile}" ]] \
+ && die "_mktemp_dry() for '${MYSQL_TMPDIR}/.pkg_config-access-test.XXXXXXXXX' failed!"
+
+ if use prefix ; then
+ touch "${_my_tmpdir_testfile}" &>/dev/null
+ else
+ su -s /bin/sh -c "touch ${_my_tmpdir_testfile}" ${MYSQL_USER} &>/dev/null
+ fi
+
+ if [[ $? -ne 0 ]] ; then
+ die "${MYSQL_USER} user cannot write into tmpdir '${MYSQL_TMPDIR}'!"
+ else
+ rm "${_my_tmpdir_testfile}" || die
+ unset _my_tmpdir_testfile
+ fi
+
+ if [[ -n "${MYSQL_LOG_BIN}" && ! -d "${MYSQL_LOG_BIN}" ]] ; then
+ einfo "Creating ${PN} log-bin directory '${MYSQL_LOG_BIN}' ..."
+ install -d -m 770 -o ${MYSQL_USER} -g ${MYSQL_GROUP} "${MYSQL_LOG_BIN}" \
+ || die "Failed to create ${PN} log-bin directory '${MYSQL_LOG_BIN}'"
+ fi
+
+ if [[ -n "${MYSQL_LOG_BIN}" ]] ; then
+ local _my_logbin_testfile="$(_mktemp_dry "${MYSQL_LOG_BIN}/.pkg_config-access-test.XXXXXXXXX")"
+ [[ -z "${_my_logbin_testfile}" ]] \
+ && die "_mktemp_dry() for '${MYSQL_LOG_BIN}/.pkg_config-access-test.XXXXXXXXX' failed!"
+
+ if use prefix ; then
+ touch "${_my_logbin_testfile}" &>/dev/null
+ else
+ su -s /bin/sh -c "touch ${_my_logbin_testfile}" ${MYSQL_USER} &>/dev/null
+ fi
+
+ if [[ $? -ne 0 ]] ; then
+ die "${MYSQL_USER} user cannot write into log-bin directory '${MYSQL_LOG_BIN}'!"
+ else
+ rm "${_my_logbin_testfile}" || die
+ unset _my_logbin_testfile
+ fi
+ fi
+
+ if [[ -n "${MYSQL_RELAY_LOG}" && ! -d "${MYSQL_RELAY_LOG}" ]] ; then
+ einfo "Creating ${PN} relay-log directory '${MYSQL_RELAY_LOG}' ..."
+ install -d -m 770 -o ${MYSQL_USER} -g ${MYSQL_GROUP} "${MYSQL_RELAY_LOG}" \
+ || die "Failed to create ${PN} relay-log directory '${MYSQL_RELAY_LOG}'!"
+ fi
+
+ if [[ -n "${MYSQL_RELAY_LOG}" ]] ; then
+ local _my_relaylog_testfile="$(_mktemp_dry "${MYSQL_RELAY_LOG}/.pkg_config-access-test.XXXXXXXXX")"
+ [[ -z "${_my_relaylog_testfile}" ]] \
+ && die "_mktemp_dry() for '${MYSQL_RELAY_LOG}/.pkg_config-access-test.XXXXXXXXX' failed!"
+
+ if use prefix ; then
+ touch "${_my_relaylog_testfile}" &>/dev/null
+ else
+ su -s /bin/sh -c "touch ${_my_relaylog_testfile}" ${MYSQL_USER} &>/dev/null
+ fi
+
+ if [[ $? -ne 0 ]] ; then
+ die "${MYSQL_USER} user cannot write into relay-log directory '${MYSQL_RELAY_LOG}'!"
+ else
+ rm "${_my_relaylog_testfile}" || die
+ unset _my_relaylog_testfile
+ fi
+ fi
+
+ local mysql_install_log="$(_mktemp_dry "${MYSQL_TMPDIR}/install_db.XXXXXXXXX.log")"
+ if [[ -z "${mysql_install_log}" ]] ; then
+ die "_mktemp_dry() for '${MYSQL_TMPDIR}/install_db.XXXXXXXXX.log' failed!"
+ else
+ # make sure file is writable for MYSQL_USER...
+ touch "${mysql_install_log}" || die
+ chown ${MYSQL_USER} "${mysql_install_log}" || die
+ fi
+
+ local mysqld_logfile="$(_mktemp_dry "${MYSQL_TMPDIR}/install_mysqld.XXXXXXXXX.log")"
+ if [[ -z "${mysqld_logfile}" ]] ; then
+ die "_mktemp_dry() for '${MYSQL_TMPDIR}/install_mysqld.XXXXXXXXX.log' failed!"
+ else
+ # make sure file is writable for MYSQL_USER...
+ touch "${mysqld_logfile}" || die
+ chown ${MYSQL_USER} "${mysqld_logfile}" || die
+ fi
+
+ echo ""
+ einfo "Detected settings:"
+ einfo "=================="
+ einfo "MySQL User:\t\t\t\t${MYSQL_USER}"
+ einfo "MySQL Group:\t\t\t\t${MYSQL_GROUP}"
+ einfo "MySQL DATA directory:\t\t${MY_DATADIR}"
+ einfo "MySQL TMP directory:\t\t\t${MYSQL_TMPDIR}"
+
+ if [[ -n "${MYSQL_LOG_BIN}" ]] ; then
+ einfo "MySQL Binary Log File location:\t${MYSQL_LOG_BIN}"
+ fi
+
+ if [[ -n "${MYSQL_RELAY_LOG}" ]] ; then
+ einfo "MySQL Relay Log File location:\t${MYSQL_RELAY_LOG}"
+ fi
+
+ einfo "PID DIR:\t\t\t\t${PID_DIR}"
+ einfo "Install db log:\t\t\t${mysql_install_log}"
+ einfo "Install server log:\t\t\t${mysqld_logfile}"
+
+ local -a config_files
+
+ local config_file="${EROOT}/etc/mysql/mysql.d/50-distro-client.cnf"
+ if [[ -f "${config_file}" ]] ; then
+ config_files+=( "${config_file}" )
+ else
+ ewarn "Client configuration '${config_file}' not found; Skipping configuration of default authentication plugin for client ..."
+ fi
+
+ config_file="${EROOT}/etc/mysql/mysql.d/50-distro-server.cnf"
+ if [[ -f "${config_file}" ]] ; then
+ config_files+=( "${config_file}" )
+ else
+ ewarn "Server configuration '${config_file}' not found; Skipping configuration of default authentication plugin for mysqld ..."
+ fi
+
+ if [[ ${#config_files[@]} -gt 0 ]] ; then
+ if [[ -z "${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}" ]] ; then
+ local user_answer
+
+ echo
+ einfo "Please select default authentication plugin (enter number or plugin name):"
+ einfo "1) caching_sha2_password [MySQL 8.0 default]"
+ einfo "2) mysql_native_password [MySQL 5.7 default]"
+ einfo
+ einfo "For details see:"
+ einfo "https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password"
+ read -p " >" user_answer
+ echo
+
+ case "${user_answer}" in
+ 1|caching_sha2_password)
+ MYSQL_DEFAULT_AUTHENTICATION_PLUGIN=caching_sha2_password
+ ;;
+ 2|mysql_native_password)
+ MYSQL_DEFAULT_AUTHENTICATION_PLUGIN=mysql_native_password
+ ;;
+ '')
+ die "No authentication plugin selected!"
+ ;;
+ *)
+ die "Authentication plugin '${user_answer}' is unknown/unsupported!"
+ ;;
+ esac
+
+ echo "Selected authentication plugin: ${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}" >> "${mysql_install_log}"
+
+ unset user_answer
+ fi
+
+ local cfg_option cfg_option_tabs cfg_section
+ for config_file in "${config_files[@]}" ; do
+ cfg_option="default-authentication-plugin"
+ cfg_section="mysqld"
+ cfg_option_tabs="\t\t"
+ if [[ "${config_file}" == *client.cnf ]] ; then
+ cfg_option="default-auth"
+ cfg_section="client"
+ cfg_option_tabs="\t\t\t\t"
+ fi
+
+ if grep -qE "^(loose-)?${cfg_option}\b.*=" "${config_file}" 2>/dev/null ; then
+ einfo "Ensuring that ${cfg_option} is set to '${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}' in '${config_file}' ..."
+ sed -i \
+ -e "s/^\(loose-\)\?${cfg_option}\b.*=.*/loose-${cfg_option}${cfg_option_tabs}= ${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}/" \
+ "${config_file}" || die "Failed to change ${cfg_option} in '${config_file}'!"
+ else
+ einfo "Setting ${cfg_option} to '${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}' in '${config_file}' ..."
+ sed -i \
+ -e "/^\[${cfg_section}\]$/a loose-${cfg_option}${cfg_option_tabs}= ${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}" \
+ "${config_file}" || die "Failed to add ${cfg_option} to '${config_file}'!"
+ fi
+ done
+ unset cfg_option cfg_option_tabs cfg_section
+ fi
+ unset config_files config_file
+
+ echo
+
+ if [[ -z "${MYSQL_ROOT_PASSWORD}" ]] ; then
+ local tmp_mysqld_password_source=
+
+ for tmp_mysqld_password_source in mysql client ; do
+ einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..."
+ MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)"
+ if [[ -n "${MYSQL_ROOT_PASSWORD}" ]] ; then
+ if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]] ; then
+ ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!"
+ MYSQL_ROOT_PASSWORD=
+ continue
+ fi
+
+ einfo "Found password in '${tmp_mysqld_password_source}' section!"
+ break
+ fi
+ done
+
+ # Sometimes --show is required to display passwords in some implementations of my_print_defaults
+ if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]] ; then
+ MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)"
+ fi
+
+ unset tmp_mysqld_password_source
+ fi
+
+ if [[ -z "${MYSQL_ROOT_PASSWORD}" ]] ; then
+ local pwd1="a"
+ local pwd2="b"
+
+ echo
+ einfo "No password for mysql 'root' user was specified via environment"
+ einfo "variable MYSQL_ROOT_PASSWORD and no password was found in config"
+ einfo "file like '${HOME}/.my.cnf'."
+ einfo "To continue please provide a password for the mysql 'root' user"
+ einfo "now on console:"
+ ewarn "NOTE: Please avoid [\"'\\_%] characters in the password!"
+ read -rsp " >" pwd1 ; echo
+
+ einfo "Retype the password"
+ read -rsp " >" pwd2 ; echo
+
+ if [[ "x$pwd1" != "x$pwd2" ]] ; then
+ die "Passwords are not the same!"
+ fi
+
+ MYSQL_ROOT_PASSWORD="${pwd1}"
+ unset pwd1 pwd2
+
+ echo
+ fi
+
+ local -a mysqld_options
+
+ # Fix bug 446200. Don't reference host my.cnf, needs to come first,
+ # see http://bugs.mysql.com/bug.php?id=31312
+ use prefix && mysqld_options+=( "--defaults-file='${MY_SYSCONFDIR}/my.cnf'" )
+
+ # Figure out which options we need to disable to do the setup
+ local helpfile="${TMPDIR}/mysqld-help"
+ "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null
+
+ local opt optexp optfull
+ for opt in host-cache name-resolve networking slave-start \
+ federated ssl log-bin relay-log slow-query-log external-locking \
+ log-slave-updates \
+ ; do
+ optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}"
+ grep -E -sq -- "${optexp}" "${helpfile}" && mysqld_options+=( "${optfull}" )
+ done
+
+ # Prepare timezones, see
+ # https://dev.mysql.com/doc/mysql/en/time-zone-support.html
+ local tz_sql="$(_mktemp_dry "${MYSQL_TMPDIR}/tz.XXXXXXXXX.sql")"
+ [[ -z "${tz_sql}" ]] \
+ && die "_mktemp_dry() for '${MYSQL_TMPDIR}/tz.XXXXXXXXX.sql' failed!"
+
+ echo "USE mysql;" >"${tz_sql}"
+ "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" >> "${tz_sql}" 2>/dev/null
+ if [[ $? -ne 0 ]] ; then
+ die "mysql_tzinfo_to_sql failed!"
+ fi
+
+ # --initialize-insecure will not set root password
+ # --initialize would set a random one in the log which we don't need as we set it ourselves
+ local cmd=(
+ "${mysqld_binary}"
+ "${mysqld_options[@]}"
+ "--initialize-insecure"
+ "--init-file='${tz_sql}'"
+ "--basedir='${EROOT}/usr'"
+ "--datadir='${MY_DATADIR}'"
+ "--tmpdir='${MYSQL_TMPDIR}'"
+ "--log-error='${mysql_install_log}'"
+ "--user=${MYSQL_USER}"
+ )
+
+ einfo "Initializing ${PN} data directory: ${cmd[@]}"
+ eval "${cmd[@]}" >>"${mysql_install_log}" 2>&1
+
+ if [[ $? -ne 0 || ! -f "${MY_DATADIR}/mysql.ibd" ]] ; then
+ grep -B5 -A999 -iE "(Aborting|ERROR|errno)" "${mysql_install_log}" 1>&2
+ die "Failed to initialize ${PN} data directory. Please review '${mysql_install_log}'!"
+ fi
+
+ rm "${tz_sql}" || die
+
+ local x=${RANDOM}
+ local socket="${EROOT}${PID_DIR}/mysqld${x}.sock"
+ local pidfile="${EROOT}${PID_DIR}/mysqld${x}.pid"
+ unset x
+
+ cmd=(
+ "${mysqld_binary}"
+ "${mysqld_options[@]}"
+ "--basedir='${EROOT}/usr'"
+ "--datadir='${MY_DATADIR}'"
+ "--tmpdir='${MYSQL_TMPDIR}'"
+ --max_allowed_packet=8M
+ --net_buffer_length=16K
+ "--socket='${socket}'"
+ "--pid-file='${pidfile}'"
+ "--log-error='${mysqld_logfile}'"
+ "--user=${MYSQL_USER}"
+ )
+
+ einfo "Starting mysqld to finalize initialization: ${cmd[@]}"
+ eval "${cmd[@]}" >>"${mysqld_logfile}" 2>&1 &
+
+ echo -n "Waiting for mysqld to accept connections "
+ local maxtry=15
+ while [[ ! -S "${socket}" && "${maxtry}" -gt 1 ]] ; do
+ maxtry=$((${maxtry}-1))
+ echo -n "."
+ sleep 1
+ done
+
+ if [[ -S "${socket}" ]] ; then
+ # Even with a socket we don't know if mysqld will abort
+ # start due to an error so just wait a little bit more...
+ maxtry=5
+ while [[ -S "${socket}" && "${maxtry}" -gt 1 ]] ; do
+ maxtry=$((${maxtry}-1))
+ echo -n "."
+ sleep 1
+ done
+ fi
+
+ echo
+
+ if [[ ! -S "${socket}" ]] ; then
+ grep -B5 -A999 -iE "(Aborting|ERROR|errno)" "${mysqld_logfile}" 1>&2
+ die "mysqld was unable to start from initialized data directory. Please review '${mysqld_logfile}'!"
+ fi
+
+ local mysql_logfile="${TMPDIR}/set_root_pw.log"
+ touch "${mysql_logfile}" || die
+
+ ebegin "Setting root password"
+ # Do this from memory, as we don't want clear text passwords in temp files
+ local sql="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'"
+ cmd=(
+ "${mysql_binary}"
+ --no-defaults
+ "--socket='${socket}'"
+ -hlocalhost
+ "-e \"${sql}\""
+ )
+ eval "${cmd[@]}" >"${mysql_logfile}" 2>&1
+ local rc=$?
+ eend ${rc}
+
+ if [[ ${rc} -ne 0 ]] ; then
+ # Poor man's solution which tries to avoid having password
+ # in log. NOTE: sed can fail if user didn't follow advice
+ # and included character which will require escaping...
+ sed -i -e "s/${MYSQL_ROOT_PASSWORD}/*****/" "${mysql_logfile}" 2>/dev/null
+
+ grep -B5 -A999 -iE "(Aborting|ERROR|errno)" "${mysql_logfile}"
+ die "Failed to set ${PN} root password. Please review '${mysql_logfile}'!"
+ fi
+
+ # Stop the server
+ if [[ -f "${pidfile}" ]] && pgrep -F "${pidfile}" &>/dev/null ; then
+ echo -n "Stopping the server "
+ pkill -F "${pidfile}" &>/dev/null
+
+ maxtry=10
+ while [[ -f "${pidfile}" ]] && pgrep -F "${pidfile}" &>/dev/null ; do
+ maxtry=$((${maxtry}-1))
+ echo -n "."
+ sleep 1
+ done
+
+ echo
+
+ if [[ -f "${pidfile}" ]] && pgrep -F "${pidfile}" &>/dev/null ; then
+ # We somehow failed to stop server.
+ # However, not a fatal error. Just warn the user.
+ ewarn "WARNING: mysqld[$(cat "${pidfile}")] is still running!"
+ fi
+ fi
+
+ einfo "${PN} data directory at '${MY_DATADIR}' successfully initialized!"
+}
diff --git a/dev-db/sqlcl-bin/Manifest b/dev-db/sqlcl-bin/Manifest
index dedf4055e6cc..97e9d2ee87b4 100644
--- a/dev-db/sqlcl-bin/Manifest
+++ b/dev-db/sqlcl-bin/Manifest
@@ -1,3 +1,3 @@
-DIST sqlcl-23.4.0.023.2321.zip 70205047 BLAKE2B 8b6a3680aeab30c5611f5c7718c488ba636e265e8d618d4698b26fc66d80b3bf167bee8801c1e909f71a9dc0875802bbda90146847c51f011310188c704e5e80 SHA512 2d5310f29c13f801392f3278dcb6241fc5fdc8da219077c5a63fb7ba461b904e3ecb2e813111a6159d1f6ca81aac1b3bfdc17434fc320423a10cc7303a345d77
-EBUILD sqlcl-bin-23.4.0.023.2321.ebuild 763 BLAKE2B 60a5df4ee71f66a47425ca7406a7fdce0735aa63d65a3bea3b1899b758bba2555130f524e1d9cb9496cc2b574eb1797909d364924a0df46ef27ca7bf4ca95348 SHA512 fd112d424588bd7c46df222b0d8f180ad85b6fc3b508abd54ecb2e4def4d55171d33a2dbda54031836e1acd10f9e38040f9fe5aca840abd244140f044bc00a86
+DIST sqlcl-24.1.0.087.0929.zip 67804071 BLAKE2B 628c33be33f327e3b77e5c406f53519aee4637dfee5a760f667e6d661016def6040f81bc8ae758a175d499e6efa9903fdeb6b14fb5454f7ec64d5e933910aa37 SHA512 354a07fa291c7a281608c67c5dbf969d3ed2598f8a8b044c6ebecc8f9c1784866109d97926f69608197b354c964abb8ede2892bfaf61065b6bd92f4be27177f6
+EBUILD sqlcl-bin-24.1.0.087.0929.ebuild 765 BLAKE2B 0cdd8955593eace85847e9e67620ee627f7fed7296d5f605e04471b72c4dc891abf9dc7fb9fb02b2865461434c82febedec88b2496754b5b8168a6fb63a6244e SHA512 9269ffef736d09f13889f2a2da98c3f3293b53644bfd2f1995430a202e9f4da7ba4484464636210e34eb9912376faeec2bf011a135753ae18a0cbd6f8608bea2
MISC metadata.xml 402 BLAKE2B ab9053ca959660812f1e1bc536950c0278d23c2906ff0a82483241f16960d2ae6ecd3eff091666df8fef38fdb073a6e3d0a5c8a7c7926426fead769365df49a5 SHA512 785e5acc8811d310b7cd5dc52fe3de6a22d7a92fa81a12db8a16b1df75a83f47ffea4e2fe21a712dabc5c1fff8da4d6f2e49ae0597373fd6e106aa13e81323d3
diff --git a/dev-db/sqlcl-bin/sqlcl-bin-23.4.0.023.2321.ebuild b/dev-db/sqlcl-bin/sqlcl-bin-24.1.0.087.0929.ebuild
index cfea6a71f095..6e9e1bdbeb5d 100644
--- a/dev-db/sqlcl-bin/sqlcl-bin-23.4.0.023.2321.ebuild
+++ b/dev-db/sqlcl-bin/sqlcl-bin-24.1.0.087.0929.ebuild
@@ -9,21 +9,21 @@ MY_P="${MY_PN}-${PV}"
inherit java-pkg-2
DESCRIPTION="Oracle SQLcl is the new SQL*Plus"
-HOMEPAGE="https://www.oracle.com/database/technologies/appdev/sqlcl.html"
+HOMEPAGE="https://www.oracle.com/database/sqldeveloper/technologies/sqlcl/"
SRC_URI="https://download.oracle.com/otn_software/java/sqldeveloper/${MY_P}.zip"
-RESTRICT="mirror"
+
+S="${WORKDIR}"
LICENSE="OTN"
SLOT="0"
KEYWORDS="~amd64 ~x86"
+RESTRICT="mirror"
BDEPEND="app-arch/unzip"
RDEPEND="dev-db/oracle-instantclient
dev-java/java-config:2
>=virtual/jre-11"
-S="${WORKDIR}"
-
src_install() {
java-pkg_dojar sqlcl/lib/*.jar sqlcl/lib/ext/*.jar