From 03df35088276f459b96fddfea06753ea93b81989 Mon Sep 17 00:00:00 2001 From: Thomas Deutschmann Date: Tue, 2 Jun 2020 01:13:51 +0200 Subject: dev-db/mysql: fix pkg_config Closes: https://bugs.gentoo.org/722118 Package-Manager: Portage-2.3.100, Repoman-2.3.22 Signed-off-by: Thomas Deutschmann --- dev-db/mysql/mysql-5.6.45-r2.ebuild | 15 ++++++++++++--- dev-db/mysql/mysql-5.7.30.ebuild | 15 ++++++++++++--- 2 files changed, 24 insertions(+), 6 deletions(-) (limited to 'dev-db') diff --git a/dev-db/mysql/mysql-5.6.45-r2.ebuild b/dev-db/mysql/mysql-5.6.45-r2.ebuild index 18821fa038c7..87c3e81d6358 100644 --- a/dev-db/mysql/mysql-5.6.45-r2.ebuild +++ b/dev-db/mysql/mysql-5.6.45-r2.ebuild @@ -601,11 +601,20 @@ mysql_init_vars() { pkg_config() { _getoptval() { - local mypd="${EROOT%/}"/usr/bin/my_print_defaults local section="$1" local flag="--${2}=" local extra_options="${3}" - "${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp" + local cmd=( + "${EROOT%/}/usr/bin/my_print_defaults" + "${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 } local old_MY_DATADIR="${MY_DATADIR}" local old_HOME="${HOME}" @@ -724,7 +733,7 @@ pkg_config() { fi local options - local sqltmp="$(emktemp)" + local sqltmp="$(emktemp "${EROOT%/}/tmp")" # Fix bug 446200. Don't reference host my.cnf, needs to come first, # see http://bugs.mysql.com/bug.php?id=31312 diff --git a/dev-db/mysql/mysql-5.7.30.ebuild b/dev-db/mysql/mysql-5.7.30.ebuild index 4543221a9e40..71716b437ae5 100644 --- a/dev-db/mysql/mysql-5.7.30.ebuild +++ b/dev-db/mysql/mysql-5.7.30.ebuild @@ -747,11 +747,20 @@ multilib_src_install_all() { pkg_config() { _getoptval() { - local mypd="${EROOT%/}"/usr/bin/my_print_defaults local section="$1" local flag="--${2}=" local extra_options="${3}" - "${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp" + local cmd=( + "${EROOT%/}/usr/bin/my_print_defaults" + "${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 } local old_MY_DATADIR="${MY_DATADIR}" local old_HOME="${HOME}" @@ -872,7 +881,7 @@ pkg_config() { fi local options - local sqltmp="$(emktemp)" + local sqltmp="$(emktemp "${EROOT%/}/tmp")" # Fix bug 446200. Don't reference host my.cnf, needs to come first, # see http://bugs.mysql.com/bug.php?id=31312 -- cgit v1.2.3-65-gdbad