summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2010-03-24 03:45:56 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2010-03-24 03:45:56 +0000
commitc4a5036b6e950de001cd37765fad400e1793ce96 (patch)
tree9c8fb0738bb759a8011e900f59c14e358a8d1499 /eclass
parentMinor patchset bump for failed testcases that were noted in sec stabilization... (diff)
downloadgentoo-2-c4a5036b6e950de001cd37765fad400e1793ce96.tar.gz
gentoo-2-c4a5036b6e950de001cd37765fad400e1793ce96.tar.bz2
gentoo-2-c4a5036b6e950de001cd37765fad400e1793ce96.zip
Bug #278633: add in support for mysql root password from secure config file.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/mysql.eclass6
1 files changed, 5 insertions, 1 deletions
diff --git a/eclass/mysql.eclass b/eclass/mysql.eclass
index 71613663bd47..9ab804c28721 100644
--- a/eclass/mysql.eclass
+++ b/eclass/mysql.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.140 2010/03/24 03:09:08 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.141 2010/03/24 03:45:56 robbat2 Exp $
# @ECLASS: mysql.eclass
# @MAINTAINER:
@@ -1109,6 +1109,10 @@ mysql_pkg_config() {
local MYSQL_ROOT_PASSWORD=''
local maxtry=15
+ if [ -z "${MYSQL_ROOT_PASSWORD}" -a -f "${ROOT}/root/.my.cnf" ]; then
+ MYSQL_ROOT_PASSWORD="$(sed -n -e '/^password=/s,^password=,,gp' "${ROOT}/root/.my.cnf")"
+ fi
+
if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then
ewarn "You have already a MySQL database in place."
ewarn "(${ROOT}/${MY_DATADIR}/*)"