diff options
author | Thomas Deutschmann <whissi@gentoo.org> | 2020-06-02 01:13:51 +0200 |
---|---|---|
committer | Thomas Deutschmann <whissi@gentoo.org> | 2020-06-02 01:16:30 +0200 |
commit | 03df35088276f459b96fddfea06753ea93b81989 (patch) | |
tree | 7988d5f49b4a9c3b644e4aa4ffcce1dcc5556f7f /dev-db | |
parent | x11-terms/alacritty: respect CC (diff) | |
download | gentoo-03df35088276f459b96fddfea06753ea93b81989.tar.gz gentoo-03df35088276f459b96fddfea06753ea93b81989.tar.bz2 gentoo-03df35088276f459b96fddfea06753ea93b81989.zip |
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 <whissi@gentoo.org>
Diffstat (limited to 'dev-db')
-rw-r--r-- | dev-db/mysql/mysql-5.6.45-r2.ebuild | 15 | ||||
-rw-r--r-- | dev-db/mysql/mysql-5.7.30.ebuild | 15 |
2 files changed, 24 insertions, 6 deletions
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 |