commit:     994ecaf07a4d3dcc19c7b9ab11b620432886e18a
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 23 16:51:40 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Mar  8 07:35:30 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=994ecaf0

mysql-multilib-r1.eclass: Replace unnecessary eval with bash array

 eclass/mysql-multilib-r1.eclass | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/eclass/mysql-multilib-r1.eclass b/eclass/mysql-multilib-r1.eclass
index f82cc101af0..c22ff72f087 100644
--- a/eclass/mysql-multilib-r1.eclass
+++ b/eclass/mysql-multilib-r1.eclass
@@ -941,19 +941,19 @@ mysql-multilib-r1_pkg_config() {
         if [[ ${PN} == "mysql" || ${PN} == "percona-server" ]] && 
version_is_at_least "5.7.6" ; then
                # --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
-               cmd="${EROOT}usr/sbin/mysqld"
+               cmd=( "${EROOT}usr/sbin/mysqld" )
                initialize_options="--initialize-insecure  
'--init-file=${sqltmp}'"
                sqltmp="" # the initialize will take care of it
        else
-               cmd="${EROOT}usr/share/mysql/scripts/mysql_install_db"
-               [[ -f "${cmd}" ]] || cmd="${EROOT}usr/bin/mysql_install_db"
+               cmd=( "${EROOT}usr/share/mysql/scripts/mysql_install_db" )
+               [[ -f "${cmd}" ]] || cmd=( "${EROOT}usr/bin/mysql_install_db" )
                if [[ -r "${help_tables}" ]] ; then
                        cat "${help_tables}" >> "${sqltmp}"
                fi
        fi
-       cmd="'$cmd' '--basedir=${EPREFIX}/usr' ${options} 
'--datadir=${ROOT}/${MY_DATADIR}' '--tmpdir=${ROOT}/${MYSQL_TMPDIR}' 
${initialize_options}"
-       einfo "Command: $cmd"
-       eval $cmd \
+       cmd+=( "--basedir=${EPREFIX}/usr" ${options} 
"--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" 
${initialize_options} )
+       einfo "Command: ${cmd[*]}"
+       "${cmd[@]}" \
                >"${TMPDIR}"/mysql_install_db.log 2>&1
        if [ $? -ne 0 ]; then
                grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2

Reply via email to