mysql-4.0.22.ebuild incorrectly assumes that mysql database is /var/lib/mysql/mysql and ask to run mysql_install_db. If user has changed DATADIR= in my.conf before launching pkg_config, that winds up as beeing plain false. Later in pkg_config code, the ebuild correctly queries my_print_defaults to get the real DATADIR location, so the solution is as simple as moving DATADIR-find code at the beginning and change the first check accordingly. Reproducible: Always Steps to Reproduce: 1. emerge mysql 2. change DATADIR in my.conf to something different than /var/lib/mysql 3. ebuild `equery which mysql` config Actual Results: the script prompts user asking to create a new mysql databade Expected Results: the script says that mysql is already there
Created attachment 43318 [details, diff] a patch which fixes this bug (and does more: read my comment) This patch, against 4.0.22 ebuild, fixes the bug. I added also another feature which i think it's useful: config does ask if user wants to set up mysql root password and then helps him. I think this is good because that's the n
Created attachment 43318 [details, diff] a patch which fixes this bug (and does more: read my comment) This patch, against 4.0.22 ebuild, fixes the bug. I added also another feature which i think it's useful: config does ask if user wants to set up mysql root password and then helps him. I think this is good because that's the nĀ°1 security flaw easily missed by common users. Since this feature is questionable, the mantainer should give it a look and decide. If he wants to keep the bugfix only, he can cut the code which is under the comment #setup root password.
I've put in the part of your patch dealing with DATADIR. However I will not include the password setting part.