| Summary: | mysql-v2.eclass does not keepdir the DATADIR | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Eray Aslan <eras> |
| Component: | [OLD] Server | Assignee: | Gentoo Linux MySQL bugs team <mysql-bugs> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | jmbsvicetto, robbat2 |
| Priority: | Normal | ||
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Attachments: | mysql-autotools.patch | ||
|
Description
Eray Aslan
2012-02-09 07:18:47 UTC
The logic is exactly the same, it's just not in mysql-v2.eclass.
old logic:
if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then
dodir "${MY_DATADIR#${EPREFIX}}"
keepdir "${MY_DATADIR#${EPREFIX}}"
chown -R mysql:mysql "${D}/${MY_DATADIR}"
fi
new logic (mysql-cmake.eclass / mysql-autotools.eclass):
if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then
dodir "${MY_DATADIR#${EPREFIX}}"
keepdir "${MY_DATADIR#${EPREFIX}}"
chown -R mysql:mysql "${D}/${MY_DATADIR}"
fi
I don't know why it cares about PREVIOUS_DATADIR however, I think it should always be doing keepdir.
Does the old mysql.eclass based ebuilds also not keepdir?
Hem, at the time of writing that check I've simply put all together, the idea is that if the datadir was present it's totally user responsibility.
The logic can be wrong, what happen if:
a) portage 1st install mysql
b) portage update mysql
b1) mysql is built but datadir is already present
b2) portage merge the file in the filesystem w/o the keepdir
b3) portage remove superfluous files, included keepdir
so yes, the keepdir should always be done, or at least check that the previous datadir is != /var/lib/mysql
Created attachment 301379 [details, diff]
mysql-autotools.patch
Just confirming that moving keepdir out of the if...then preserves the datadir directory on upgrade. Ditto for mysql-cmake.eclass probably.
(In reply to comment #1) > The logic is exactly the same, it's just not in mysql-v2.eclass. > > old logic: > if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then > dodir "${MY_DATADIR#${EPREFIX}}" > keepdir "${MY_DATADIR#${EPREFIX}}" > chown -R mysql:mysql "${D}/${MY_DATADIR}" > fi > > new logic (mysql-cmake.eclass / mysql-autotools.eclass): > if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then > dodir "${MY_DATADIR#${EPREFIX}}" > keepdir "${MY_DATADIR#${EPREFIX}}" > chown -R mysql:mysql "${D}/${MY_DATADIR}" > fi > > > I don't know why it cares about PREVIOUS_DATADIR however, I think it should > always be doing keepdir. > > Does the old mysql.eclass based ebuilds also not keepdir? Robin, I can't check the eclasses now, but I suspect it might be tied to the PREFIX support added to the eclasses. InCVS |