Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 388125 | Differences between
and this patch

Collapse All | Expand All

(-)old/mysql_fx.eclass (-6 / +10 lines)
Lines 234-245 Link Here
234
234
235
	if [[ -z "${MY_DATADIR}" ]] ; then
235
	if [[ -z "${MY_DATADIR}" ]] ; then
236
		MY_DATADIR=""
236
		MY_DATADIR=""
237
		if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then
237
		if [[ -f "${EPREFIX}${MY_SYSCONFDIR}/my.cnf" ]] ; then
238
			MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \
238
			MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \
239
				| sed -ne '/datadir/s|^--datadir=||p' \
239
				| sed -ne '/datadir/s|^--datadir=||p' \
240
				| tail -n1`
240
				| tail -n1`
241
			if [[ -z "${MY_DATADIR}" ]] ; then
241
			if [[ -z "${MY_DATADIR}" ]] ; then
242
				MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \
242
				MY_DATADIR=`grep ^datadir "${EPREFIX}${MY_SYSCONFDIR}/my.cnf" \
243
				| sed -e 's/.*=\s*//' \
243
				| sed -e 's/.*=\s*//' \
244
				| tail -n1`
244
				| tail -n1`
245
			fi
245
			fi
Lines 247-259 Link Here
247
		if [[ -z "${MY_DATADIR}" ]] ; then
247
		if [[ -z "${MY_DATADIR}" ]] ; then
248
			MY_DATADIR="${MY_LOCALSTATEDIR}"
248
			MY_DATADIR="${MY_LOCALSTATEDIR}"
249
			einfo "Using default MY_DATADIR"
249
			einfo "Using default MY_DATADIR"
250
		else
251
			# strip leading EPREFIX returned by already installed mysql
252
			MY_DATADIR="${MY_DATADIR#${EPREFIX}}"
250
		fi
253
		fi
251
		elog "MySQL MY_DATADIR is ${MY_DATADIR}"
254
		elog "MySQL MY_DATADIR is ${EPREFIX}${MY_DATADIR}"
252
255
253
		if [[ -z "${PREVIOUS_DATADIR}" ]] ; then
256
		if [[ -z "${PREVIOUS_DATADIR}" ]] ; then
254
			if [[ -e "${MY_DATADIR}" ]] ; then
257
			if [[ -e "${EPREFIX}${MY_DATADIR}" ]] ; then
255
				# If you get this and you're wondering about it, see bug #207636
258
				# If you get this and you're wondering about it, see bug #207636
256
				elog "MySQL datadir found in ${MY_DATADIR}"
259
				elog "MySQL datadir found in ${EPREFIX}${MY_DATADIR}"
257
				elog "A new one will not be created."
260
				elog "A new one will not be created."
258
				PREVIOUS_DATADIR="yes"
261
				PREVIOUS_DATADIR="yes"
259
			else
262
			else
Lines 272-278 Link Here
272
				ewarn "MySQL MY_DATADIR has changed"
275
				ewarn "MySQL MY_DATADIR has changed"
273
				ewarn "from ${MY_DATADIR}"
276
				ewarn "from ${MY_DATADIR}"
274
				ewarn "to ${new_MY_DATADIR}"
277
				ewarn "to ${new_MY_DATADIR}"
275
				MY_DATADIR="${new_MY_DATADIR}"
278
				# strip leading EPREFIX returned by already installed mysql
279
				MY_DATADIR="${new_MY_DATADIR#${EPREFIX}}"
276
			fi
280
			fi
277
		fi
281
		fi
278
	fi
282
	fi

Return to bug 388125