Summary: | DSPAM-3.1.1 does not create all the MySQL tables | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | steveb <steeeeeveee> |
Component: | New packages | Assignee: | Net-Mail Packages <net-mail+disabled> |
Status: | RESOLVED FIXED | ||
Severity: | major | ||
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
steveb
2004-08-24 14:31:18 UTC
again me. sorry. I would suggest to install both SQL files (speed and space optimized) and then let the user choose between them. This is what I would change in the ebuild: at the top of the ebuild: ------------------------------- delete the line with MYSQL_TABLE_TYPE ------------------------------- In the src_install () section ------------------------------- newins tools.mysql_drv/mysql_objects.sql.speed.optimized mysql_objects.sql.speed.optimized newins tools.mysql_drv/mysql_objects.sql.space.optimized mysql_objects.sql.space.optimized ------------------------------- Just after pkg_config () { ------------------------------- if use mysql ; then [[ -f ${CONFIGDIR}/mysql.data ]] && mv -f ${CONFIGDIR}/mysql.data ${HOMEDIR} DSPAM_MySQL_USER="$(cat ${HOMEDIR}/mysql.data|head -n 3|tail -n 1)" DSPAM_MySQL_PWD="$(cat ${HOMEDIR}/mysql.data|head -n 4|tail -n 1)" DSPAM_MySQL_DB="$(cat ${HOMEDIR}/mysql.data|head -n 5|tail -n 1)" ewarn "When prompted for a password, please enter your MySQL root password" ewarn "" einfo "Creating DSPAM MySQL database \"${DSPAM_MySQL_DB}\"" while true do /usr/bin/mysqladmin -u root -p create ${DSPAM_MySQL_DB} [ "$?" == "0" ] && break done echo einfo "Creating DSPAM MySQL tables for data objects" einfo " Please select what kind of object database you like to use." einfo " [1] Speed optimized database" einfo " [2] Space optimized database" einfo while true do read -n 1 -s -p " Press 1 or 2 on the keyboard to select database" DSPAM_MySQL_DB_Type [[ "${DSPAM_MySQL_DB_Type}" == "1" || "${DSPAM_MySQL_DB_Type}" == "2" ]] && break done echo if [ "${DSPAM_MySQL_DB_Type}" == "1" ] then while true do /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${CONFIGDIR}/mysql_objects.sql.speed.optimized [ "$?" == "0" ] && break done else while true do /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${CONFIGDIR}/mysql_objects.sql.space.optimized [ "$?" == "0" ] && break done fi echo einfo "Creating DSPAM MySQL database for virtual users" while true do /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${CONFIGDIR}/mysql_virtual_users.sql [ "$?" == "0" ] && break done echo einfo "Creating DSPAM MySQL user \"${DSPAM_MySQL_USER}\"" while true do /usr/bin/mysql -u root -p -e "GRANT SELECT,INSERT,UPDATE,DELETE ON ${DSPAM_MySQL_DB}.* TO ${DSPAM_MySQL_USER}@localhost IDENTIFIED BY '${DSPAM_MySQL_PWD}';FLUSH PRIVILEGES;" -D mysql [ "$?" == "0" ] && break done fi ------------------------------- cheers SteveB Fixed in CVS. Expect this in the rsync soon, but I did not bump the version. I find it strange that you embed the mysql calls in a while true loop. Is there any specific reason? I'm not expecting a reply, but if you can give me a reasonable answer, I'll try to roll it in. :) Regards Lim Swee Tat the reason for the loop is: if the user by accident enters the wrong password for root, then the return value is anything else then 0. and the loop will ask the user for the password until the return value is 0. with this, you can be sure that all the needed tables are in place, because the specified sql commands relay on each other and each of them has to be successfull executed before the next one get's executed. if the user want's to break the process, then he needs to press ctrl + c or break the process in another way. but as long he does not interupt the process, any typos for the password will be overlooked and the password is again asked. cheers steve |