public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] mysql-multilib-r1.eclass: Replace unnecessary eval with bash array
@ 2017-02-23 16:59 Michał Górny
  0 siblings, 0 replies; only message in thread
From: Michał Górny @ 2017-02-23 16:59 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

---
 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 38fcc7c0ecf8..a92fac0a1cfc 100644
--- a/eclass/mysql-multilib-r1.eclass
+++ b/eclass/mysql-multilib-r1.eclass
@@ -942,19 +942,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
-- 
2.11.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-02-23 16:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-23 16:59 [gentoo-dev] [PATCH] mysql-multilib-r1.eclass: Replace unnecessary eval with bash array Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox