diff options
author | Francesco Riosa <vivo@gentoo.org> | 2005-12-12 10:15:57 +0000 |
---|---|---|
committer | Francesco Riosa <vivo@gentoo.org> | 2005-12-12 10:15:57 +0000 |
commit | f8965b2780a1ce57f14bd33dc9a99f87f1d05ae7 (patch) | |
tree | a226d01eef417bc45d5ff5af9091f077826bc431 /dev-db | |
parent | Removed old ebuilds to get rid of USE=pic cruft. 1.0.1-r4 stable on x86. (diff) | |
download | gentoo-2-f8965b2780a1ce57f14bd33dc9a99f87f1d05ae7.tar.gz gentoo-2-f8965b2780a1ce57f14bd33dc9a99f87f1d05ae7.tar.bz2 gentoo-2-f8965b2780a1ce57f14bd33dc9a99f87f1d05ae7.zip |
removed annoying sed error message; normalized pkg_config across ebuilds
(Portage version: 2.0.53)
Diffstat (limited to 'dev-db')
-rw-r--r-- | dev-db/mysql/ChangeLog | 8 | ||||
-rw-r--r-- | dev-db/mysql/mysql-4.1.15-r2.ebuild | 58 | ||||
-rw-r--r-- | dev-db/mysql/mysql-4.1.15-r30.ebuild | 188 | ||||
-rw-r--r-- | dev-db/mysql/mysql-5.0.16-r30.ebuild | 188 | ||||
-rw-r--r-- | dev-db/mysql/mysql-5.0.16-r4.ebuild | 58 | ||||
-rw-r--r-- | dev-db/mysql/mysql-5.1.3_alpha-r30.ebuild | 188 |
6 files changed, 342 insertions, 346 deletions
diff --git a/dev-db/mysql/ChangeLog b/dev-db/mysql/ChangeLog index a1a7fb152954..0f5a6dedbd8a 100644 --- a/dev-db/mysql/ChangeLog +++ b/dev-db/mysql/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for dev-db/mysql # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/ChangeLog,v 1.279 2005/12/11 18:22:23 vivo Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/ChangeLog,v 1.280 2005/12/12 10:15:56 vivo Exp $ + + 12 Dec 2005; Francesco Riosa <vivo@gentoo.org> mysql-4.1.15-r2.ebuild, + mysql-4.1.15-r30.ebuild, mysql-5.0.16-r4.ebuild, mysql-5.0.16-r30.ebuild, + mysql-5.1.3_alpha-r30.ebuild: + - fix Bug #115261, removed annoying sed error message + - normalized pkg_config across ebuilds (slotted and not) 11 Dec 2005; Francesco Riosa <vivo@gentoo.org> mysql-4.1.15-r2.ebuild, mysql-4.1.15-r30.ebuild, mysql-5.0.16-r4.ebuild, mysql-5.0.16-r30.ebuild, diff --git a/dev-db/mysql/mysql-4.1.15-r2.ebuild b/dev-db/mysql/mysql-4.1.15-r2.ebuild index 6642966d4f0a..18b1c4e7a7a6 100644 --- a/dev-db/mysql/mysql-4.1.15-r2.ebuild +++ b/dev-db/mysql/mysql-4.1.15-r2.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/mysql-4.1.15-r2.ebuild,v 1.2 2005/12/11 18:22:23 vivo Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/mysql-4.1.15-r2.ebuild,v 1.3 2005/12/12 10:15:56 vivo Exp $ # helper function, version (integer) may have section separated by dots # for readbility @@ -232,7 +232,8 @@ src_unpack() { rm -f scripts/mysqlbug # Multilib issue with zlib detection - sed -i -e "s:zlib_dir/lib:zlib_dir/$(get_libdir):g" \ + mysql_version_is_at_least "5.00.15.00" \ + && sed -i -e "s:zlib_dir/lib:zlib_dir/$(get_libdir):g" \ "${S}/config/ac-macros/zlib.m4" # Make charsets install in the right place @@ -719,7 +720,8 @@ pkg_config() { if [[ -d "${ROOT}/${DATADIR}/mysql" ]] ; then ewarn "You have already a MySQL database in place." - ewarn "Please rename it or delete it if you wish to replace it." + ewarn "(${ROOT}/${DATADIR}/*)" + ewarn "Please rename or delete it if you wish to replace it." die "MySQL database already exists!" fi @@ -737,40 +739,52 @@ pkg_config() { die "Passwords are not the same" fi - ${ROOT}/usr/bin/mysql_install_db${MY_SUFFIX} || die "MySQL databases not installed" - - # MySQL 5.0 don't need this - chown -R mysql:mysql ${ROOT}/${DATADIR} - chmod 0750 ${ROOT}/${DATADIR} - local options="" local sqltmp="$(emktemp)" - if mysql_version_is_at_least "4.01.03.00"; then + local help_tables="${ROOT}/usr/share/doc/mysql-${PVR}/scripts/fill_help_tables.sql.gz" + [[ -r "${help_tables}" ]] \ + && zcat "${help_tables}" > "${TMPDIR}/fill_help_tables.sql" \ + || touch "${TMPDIR}/fill_help_tables.sql" + help_tables="${TMPDIR}/fill_help_tables.sql" + + pushd "${TMPDIR}" + ${ROOT}/usr/bin/mysql_install_db${MY_SUFFIX} | grep -B5 -A999 -i "ERROR" + popd + [[ -f ${ROOT}/${DATADIR}/mysql/user.frm ]] || die "MySQL databases not installed" + chown -R mysql:mysql ${ROOT}/${DATADIR} 2> /dev/null + chmod 0750 ${ROOT}/${DATADIR} 2> /dev/null + + if mysql_version_is_at_least "4.01.03.00" ; then options="--skip-ndbcluster" # Filling timezones, see # http://dev.mysql.com/doc/mysql/en/time-zone-support.html - ${ROOT}/usr/bin/mysql_tzinfo_to_sql ${ROOT}/usr/share${MY_SUFFIX}/zoneinfo \ - > "${sqltmp}" + ${ROOT}/usr/bin/mysql_tzinfo_to_sql${MY_SUFFIX} ${ROOT}/usr/share/zoneinfo \ + > "${sqltmp}" 2>&1 | grep -v "Skipping it." + + if [[ -r "${help_tables}" ]] ; then + cat "${help_tables}" >> "${sqltmp}" + fi fi - local socket=${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}.sock + local socket=${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}${RANDOM}.sock + local pidfile=${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}${RANDOM}.sock local mysqld="${ROOT}/usr/sbin/mysqld${MY_SUFFIX} \ ${options} \ + --user=mysql \ --skip-grant-tables \ --basedir=${ROOT}/usr \ --datadir=${ROOT}/${DATADIR} \ --skip-innodb \ --skip-bdb \ + --skip-networking \ --max_allowed_packet=8M \ --net_buffer_length=16K \ --socket=${socket} \ - --pid-file=${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}.pid" - + --pid-file=${pidfile}" $mysqld & - while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] - do + while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do maxtry=$(($maxtry-1)) echo -n "." sleep 1 @@ -778,8 +792,8 @@ pkg_config() { # do this from memory we don't want clear text password in temp files local sql="UPDATE mysql.user SET Password = PASSWORD('${pwd1}') WHERE USER='root'" - ${ROOT}/usr/bin/mysql \ - --socket=${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}.sock \ + ${ROOT}/usr/bin/mysql${MY_SUFFIX} \ + --socket=${socket} \ -hlocalhost \ -e "${sql}" @@ -792,8 +806,10 @@ pkg_config() { -p"${pwd1}" \ mysql < "${sqltmp}" - kill $( cat ${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}.pid ) + # server stop and cleanup + kill $(< "${pidfile}" ) rm "${sqltmp}" + einfo "stopping the server," + wait %1 einfo "done" } - diff --git a/dev-db/mysql/mysql-4.1.15-r30.ebuild b/dev-db/mysql/mysql-4.1.15-r30.ebuild index 81cec6a0d1bd..6a50ebb986b9 100644 --- a/dev-db/mysql/mysql-4.1.15-r30.ebuild +++ b/dev-db/mysql/mysql-4.1.15-r30.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/mysql-4.1.15-r30.ebuild,v 1.9 2005/12/11 18:22:23 vivo Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/mysql-4.1.15-r30.ebuild,v 1.10 2005/12/12 10:15:56 vivo Exp $ # helper function, version (integer) may have section separated by dots # for readbility @@ -230,7 +230,8 @@ src_unpack() { rm -f scripts/mysqlbug # Multilib issue with zlib detection - sed -i -e "s:zlib_dir/lib:zlib_dir/$(get_libdir):g" \ + mysql_version_is_at_least "5.00.15.00" \ + && sed -i -e "s:zlib_dir/lib:zlib_dir/$(get_libdir):g" \ "${S}/config/ac-macros/zlib.m4" # Make charsets install in the right place @@ -707,117 +708,102 @@ pkg_config() { die "Minimal builds do NOT include the MySQL server" fi - local menusel - - cat <<-EOF - ======== - || - || 1) Create system database - || 2) [TODO] Copy needed file to chroot - || 3) [TODO] Make the default server (symlink) - - EOF - - read menusel - echo - [[ -z "${menusel}" ]] || [[ "${menusel}" == 0 ]] && return 0 - if [[ "${menusel}" == '1' ]] - then - local pwd1="a" - local pwd2="b" - local maxtry=5 - - if [[ -d "${ROOT}/${DATADIR}/mysql" ]] ; then - ewarn "You have already a MySQL database in place." - ewarn "(${ROOT}/${DATADIR}/*)" - ewarn "Please rename or delete it if you wish to replace it." - die "MySQL database already exists!" - fi + local pwd1="a" + local pwd2="b" + local maxtry=5 - einfo "Creating the mysql database and setting proper" - einfo "permissions on it..." + if [[ -d "${ROOT}/${DATADIR}/mysql" ]] ; then + ewarn "You have already a MySQL database in place." + ewarn "(${ROOT}/${DATADIR}/*)" + ewarn "Please rename or delete it if you wish to replace it." + die "MySQL database already exists!" + fi - einfo "Insert a password for the mysql 'root' user" - ewarn "Avoid [\"'\\_%] characters in the password" + einfo "Creating the mysql database and setting proper" + einfo "permissions on it..." - read -rsp " >" pwd1 ; echo - einfo "Check the password" - read -rsp " >" pwd2 ; echo + einfo "Insert a password for the mysql 'root' user" + ewarn "Avoid [\"'\\_%] characters in the password" - if [[ "x$pwd1" != "x$pwd2" ]] ; then - die "Passwords are not the same" - fi + read -rsp " >" pwd1 ; echo + einfo "Check the password" + read -rsp " >" pwd2 ; echo - chown -R mysql:mysql ${ROOT}/${DATADIR} - chmod 0750 ${ROOT}/${DATADIR} + if [[ "x$pwd1" != "x$pwd2" ]] ; then + die "Passwords are not the same" + fi - local options="" - local sqltmp="$(emktemp)" + local options="" + local sqltmp="$(emktemp)" - local help_tables="${ROOT}/usr/share/doc/mysql-${PVR}/scripts/fill_help_tables.sql.gz" - [[ -r "${help_tables}" ]] \ - && zcat "${help_tables}" > "${TMPDIR}/fill_help_tables.sql" \ - || touch "${TMPDIR}/fill_help_tables.sql" - help_tables="${TMPDIR}/fill_help_tables.sql" + local help_tables="${ROOT}/usr/share/doc/mysql-${PVR}/scripts/fill_help_tables.sql.gz" + [[ -r "${help_tables}" ]] \ + && zcat "${help_tables}" > "${TMPDIR}/fill_help_tables.sql" \ + || touch "${TMPDIR}/fill_help_tables.sql" + help_tables="${TMPDIR}/fill_help_tables.sql" - pushd "${TMPDIR}" - ${ROOT}/usr/bin/mysql_install_db${MY_SUFFIX} || die "MySQL databases not installed" - popd + pushd "${TMPDIR}" + ${ROOT}/usr/bin/mysql_install_db${MY_SUFFIX} | grep -B5 -A999 -i "ERROR" + popd + [[ -f ${ROOT}/${DATADIR}/mysql/user.frm ]] || die "MySQL databases not installed" + chown -R mysql:mysql ${ROOT}/${DATADIR} 2> /dev/null + chmod 0750 ${ROOT}/${DATADIR} 2> /dev/null - if mysql_version_is_at_least "4.01.03.00" ; then - options="--skip-ndbcluster" + if mysql_version_is_at_least "4.01.03.00" ; then + options="--skip-ndbcluster" - # Filling timezones, see - # http://dev.mysql.com/doc/mysql/en/time-zone-support.html - ${ROOT}/usr/bin/mysql_tzinfo_to_sql${MY_SUFFIX} ${ROOT}/usr/share/zoneinfo \ - > "${sqltmp}" + # Filling timezones, see + # http://dev.mysql.com/doc/mysql/en/time-zone-support.html + ${ROOT}/usr/bin/mysql_tzinfo_to_sql${MY_SUFFIX} ${ROOT}/usr/share/zoneinfo \ + > "${sqltmp}" 2>&1 | grep -v "Skipping it." - if [[ -r "${help_tables}" ]] ; then - cat "${help_tables}" >> "${sqltmp}" - fi + if [[ -r "${help_tables}" ]] ; then + cat "${help_tables}" >> "${sqltmp}" fi + fi - local socket=${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}${RANDOM}.sock - local pidfile=${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}${RANDOM}.sock - local mysqld="${ROOT}/usr/sbin/mysqld${MY_SUFFIX} \ - ${options} \ - --skip-grant-tables \ - --basedir=${ROOT}/usr \ - --datadir=${ROOT}/${DATADIR} \ - --skip-innodb \ - --skip-bdb \ - --max_allowed_packet=8M \ - --net_buffer_length=16K \ - --socket=${socket} \ - --pid-file=${pidfile}" - - $mysqld & - while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] - do - maxtry=$(($maxtry-1)) - echo -n "." - sleep 1 - done + local socket=${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}${RANDOM}.sock + local pidfile=${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}${RANDOM}.sock + local mysqld="${ROOT}/usr/sbin/mysqld${MY_SUFFIX} \ + ${options} \ + --user=mysql \ + --skip-grant-tables \ + --basedir=${ROOT}/usr \ + --datadir=${ROOT}/${DATADIR} \ + --skip-innodb \ + --skip-bdb \ + --skip-networking \ + --max_allowed_packet=8M \ + --net_buffer_length=16K \ + --socket=${socket} \ + --pid-file=${pidfile}" + $mysqld & + while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do + maxtry=$(($maxtry-1)) + echo -n "." + sleep 1 + done - # do this from memory we don't want clear text password in temp files - local sql="UPDATE mysql.user SET Password = PASSWORD('${pwd1}') WHERE USER='root'" - ${ROOT}/usr/bin/mysql${MY_SUFFIX} \ - --socket=${socket} \ - -hlocalhost \ - -e "${sql}" - - einfo "Loading \"zoneinfo\" this step may require few seconds" - - ${ROOT}/usr/bin/mysql${MY_SUFFIX} \ - --socket=${socket} \ - -hlocalhost \ - -uroot \ - -p"${pwd1}" \ - mysql < "${sqltmp}" - - kill $(< "${pidfile}" ) - rm "${sqltmp}" - einfo "done" - fi # menusel + # do this from memory we don't want clear text password in temp files + local sql="UPDATE mysql.user SET Password = PASSWORD('${pwd1}') WHERE USER='root'" + ${ROOT}/usr/bin/mysql${MY_SUFFIX} \ + --socket=${socket} \ + -hlocalhost \ + -e "${sql}" + + einfo "Loading \"zoneinfo\" this step may require few seconds" + + ${ROOT}/usr/bin/mysql${MY_SUFFIX} \ + --socket=${socket} \ + -hlocalhost \ + -uroot \ + -p"${pwd1}" \ + mysql < "${sqltmp}" + + # server stop and cleanup + kill $(< "${pidfile}" ) + rm "${sqltmp}" + einfo "stopping the server," + wait %1 + einfo "done" } - diff --git a/dev-db/mysql/mysql-5.0.16-r30.ebuild b/dev-db/mysql/mysql-5.0.16-r30.ebuild index 3083afb764dd..008fa1873ee7 100644 --- a/dev-db/mysql/mysql-5.0.16-r30.ebuild +++ b/dev-db/mysql/mysql-5.0.16-r30.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/mysql-5.0.16-r30.ebuild,v 1.9 2005/12/11 18:22:23 vivo Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/mysql-5.0.16-r30.ebuild,v 1.10 2005/12/12 10:15:56 vivo Exp $ # helper function, version (integer) may have section separated by dots # for readbility @@ -230,7 +230,8 @@ src_unpack() { rm -f scripts/mysqlbug # Multilib issue with zlib detection - sed -i -e "s:zlib_dir/lib:zlib_dir/$(get_libdir):g" \ + mysql_version_is_at_least "5.00.15.00" \ + && sed -i -e "s:zlib_dir/lib:zlib_dir/$(get_libdir):g" \ "${S}/config/ac-macros/zlib.m4" # Make charsets install in the right place @@ -707,117 +708,102 @@ pkg_config() { die "Minimal builds do NOT include the MySQL server" fi - local menusel - - cat <<-EOF - ======== - || - || 1) Create system database - || 2) [TODO] Copy needed file to chroot - || 3) [TODO] Make the default server (symlink) - - EOF - - read menusel - echo - [[ -z "${menusel}" ]] || [[ "${menusel}" == 0 ]] && return 0 - if [[ "${menusel}" == '1' ]] - then - local pwd1="a" - local pwd2="b" - local maxtry=5 - - if [[ -d "${ROOT}/${DATADIR}/mysql" ]] ; then - ewarn "You have already a MySQL database in place." - ewarn "(${ROOT}/${DATADIR}/*)" - ewarn "Please rename or delete it if you wish to replace it." - die "MySQL database already exists!" - fi + local pwd1="a" + local pwd2="b" + local maxtry=5 - einfo "Creating the mysql database and setting proper" - einfo "permissions on it..." + if [[ -d "${ROOT}/${DATADIR}/mysql" ]] ; then + ewarn "You have already a MySQL database in place." + ewarn "(${ROOT}/${DATADIR}/*)" + ewarn "Please rename or delete it if you wish to replace it." + die "MySQL database already exists!" + fi - einfo "Insert a password for the mysql 'root' user" - ewarn "Avoid [\"'\\_%] characters in the password" + einfo "Creating the mysql database and setting proper" + einfo "permissions on it..." - read -rsp " >" pwd1 ; echo - einfo "Check the password" - read -rsp " >" pwd2 ; echo + einfo "Insert a password for the mysql 'root' user" + ewarn "Avoid [\"'\\_%] characters in the password" - if [[ "x$pwd1" != "x$pwd2" ]] ; then - die "Passwords are not the same" - fi + read -rsp " >" pwd1 ; echo + einfo "Check the password" + read -rsp " >" pwd2 ; echo - chown -R mysql:mysql ${ROOT}/${DATADIR} - chmod 0750 ${ROOT}/${DATADIR} + if [[ "x$pwd1" != "x$pwd2" ]] ; then + die "Passwords are not the same" + fi - local options="" - local sqltmp="$(emktemp)" + local options="" + local sqltmp="$(emktemp)" - local help_tables="${ROOT}/usr/share/doc/mysql-${PVR}/scripts/fill_help_tables.sql.gz" - [[ -r "${help_tables}" ]] \ - && zcat "${help_tables}" > "${TMPDIR}/fill_help_tables.sql" \ - || touch "${TMPDIR}/fill_help_tables.sql" - help_tables="${TMPDIR}/fill_help_tables.sql" + local help_tables="${ROOT}/usr/share/doc/mysql-${PVR}/scripts/fill_help_tables.sql.gz" + [[ -r "${help_tables}" ]] \ + && zcat "${help_tables}" > "${TMPDIR}/fill_help_tables.sql" \ + || touch "${TMPDIR}/fill_help_tables.sql" + help_tables="${TMPDIR}/fill_help_tables.sql" - pushd "${TMPDIR}" - ${ROOT}/usr/bin/mysql_install_db${MY_SUFFIX} || die "MySQL databases not installed" - popd + pushd "${TMPDIR}" + ${ROOT}/usr/bin/mysql_install_db${MY_SUFFIX} | grep -B5 -A999 -i "ERROR" + popd + [[ -f ${ROOT}/${DATADIR}/mysql/user.frm ]] || die "MySQL databases not installed" + chown -R mysql:mysql ${ROOT}/${DATADIR} 2> /dev/null + chmod 0750 ${ROOT}/${DATADIR} 2> /dev/null - if mysql_version_is_at_least "4.01.03.00" ; then - options="--skip-ndbcluster" + if mysql_version_is_at_least "4.01.03.00" ; then + options="--skip-ndbcluster" - # Filling timezones, see - # http://dev.mysql.com/doc/mysql/en/time-zone-support.html - ${ROOT}/usr/bin/mysql_tzinfo_to_sql${MY_SUFFIX} ${ROOT}/usr/share/zoneinfo \ - > "${sqltmp}" + # Filling timezones, see + # http://dev.mysql.com/doc/mysql/en/time-zone-support.html + ${ROOT}/usr/bin/mysql_tzinfo_to_sql${MY_SUFFIX} ${ROOT}/usr/share/zoneinfo \ + > "${sqltmp}" 2>&1 | grep -v "Skipping it." - if [[ -r "${help_tables}" ]] ; then - cat "${help_tables}" >> "${sqltmp}" - fi + if [[ -r "${help_tables}" ]] ; then + cat "${help_tables}" >> "${sqltmp}" fi + fi - local socket=${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}${RANDOM}.sock - local pidfile=${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}${RANDOM}.sock - local mysqld="${ROOT}/usr/sbin/mysqld${MY_SUFFIX} \ - ${options} \ - --skip-grant-tables \ - --basedir=${ROOT}/usr \ - --datadir=${ROOT}/${DATADIR} \ - --skip-innodb \ - --skip-bdb \ - --max_allowed_packet=8M \ - --net_buffer_length=16K \ - --socket=${socket} \ - --pid-file=${pidfile}" - - $mysqld & - while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] - do - maxtry=$(($maxtry-1)) - echo -n "." - sleep 1 - done + local socket=${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}${RANDOM}.sock + local pidfile=${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}${RANDOM}.sock + local mysqld="${ROOT}/usr/sbin/mysqld${MY_SUFFIX} \ + ${options} \ + --user=mysql \ + --skip-grant-tables \ + --basedir=${ROOT}/usr \ + --datadir=${ROOT}/${DATADIR} \ + --skip-innodb \ + --skip-bdb \ + --skip-networking \ + --max_allowed_packet=8M \ + --net_buffer_length=16K \ + --socket=${socket} \ + --pid-file=${pidfile}" + $mysqld & + while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do + maxtry=$(($maxtry-1)) + echo -n "." + sleep 1 + done - # do this from memory we don't want clear text password in temp files - local sql="UPDATE mysql.user SET Password = PASSWORD('${pwd1}') WHERE USER='root'" - ${ROOT}/usr/bin/mysql${MY_SUFFIX} \ - --socket=${socket} \ - -hlocalhost \ - -e "${sql}" - - einfo "Loading \"zoneinfo\" this step may require few seconds" - - ${ROOT}/usr/bin/mysql${MY_SUFFIX} \ - --socket=${socket} \ - -hlocalhost \ - -uroot \ - -p"${pwd1}" \ - mysql < "${sqltmp}" - - kill $(< "${pidfile}" ) - rm "${sqltmp}" - einfo "done" - fi # menusel + # do this from memory we don't want clear text password in temp files + local sql="UPDATE mysql.user SET Password = PASSWORD('${pwd1}') WHERE USER='root'" + ${ROOT}/usr/bin/mysql${MY_SUFFIX} \ + --socket=${socket} \ + -hlocalhost \ + -e "${sql}" + + einfo "Loading \"zoneinfo\" this step may require few seconds" + + ${ROOT}/usr/bin/mysql${MY_SUFFIX} \ + --socket=${socket} \ + -hlocalhost \ + -uroot \ + -p"${pwd1}" \ + mysql < "${sqltmp}" + + # server stop and cleanup + kill $(< "${pidfile}" ) + rm "${sqltmp}" + einfo "stopping the server," + wait %1 + einfo "done" } - diff --git a/dev-db/mysql/mysql-5.0.16-r4.ebuild b/dev-db/mysql/mysql-5.0.16-r4.ebuild index f847d84dd142..24127fe89fd3 100644 --- a/dev-db/mysql/mysql-5.0.16-r4.ebuild +++ b/dev-db/mysql/mysql-5.0.16-r4.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/mysql-5.0.16-r4.ebuild,v 1.2 2005/12/11 18:22:23 vivo Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/mysql-5.0.16-r4.ebuild,v 1.3 2005/12/12 10:15:56 vivo Exp $ # helper function, version (integer) may have section separated by dots # for readbility @@ -232,7 +232,8 @@ src_unpack() { rm -f scripts/mysqlbug # Multilib issue with zlib detection - sed -i -e "s:zlib_dir/lib:zlib_dir/$(get_libdir):g" \ + mysql_version_is_at_least "5.00.15.00" \ + && sed -i -e "s:zlib_dir/lib:zlib_dir/$(get_libdir):g" \ "${S}/config/ac-macros/zlib.m4" # Make charsets install in the right place @@ -719,7 +720,8 @@ pkg_config() { if [[ -d "${ROOT}/${DATADIR}/mysql" ]] ; then ewarn "You have already a MySQL database in place." - ewarn "Please rename it or delete it if you wish to replace it." + ewarn "(${ROOT}/${DATADIR}/*)" + ewarn "Please rename or delete it if you wish to replace it." die "MySQL database already exists!" fi @@ -737,40 +739,52 @@ pkg_config() { die "Passwords are not the same" fi - ${ROOT}/usr/bin/mysql_install_db${MY_SUFFIX} || die "MySQL databases not installed" - - # MySQL 5.0 don't need this - chown -R mysql:mysql ${ROOT}/${DATADIR} - chmod 0750 ${ROOT}/${DATADIR} - local options="" local sqltmp="$(emktemp)" - if mysql_version_is_at_least "4.01.03.00"; then + local help_tables="${ROOT}/usr/share/doc/mysql-${PVR}/scripts/fill_help_tables.sql.gz" + [[ -r "${help_tables}" ]] \ + && zcat "${help_tables}" > "${TMPDIR}/fill_help_tables.sql" \ + || touch "${TMPDIR}/fill_help_tables.sql" + help_tables="${TMPDIR}/fill_help_tables.sql" + + pushd "${TMPDIR}" + ${ROOT}/usr/bin/mysql_install_db${MY_SUFFIX} | grep -B5 -A999 -i "ERROR" + popd + [[ -f ${ROOT}/${DATADIR}/mysql/user.frm ]] || die "MySQL databases not installed" + chown -R mysql:mysql ${ROOT}/${DATADIR} 2> /dev/null + chmod 0750 ${ROOT}/${DATADIR} 2> /dev/null + + if mysql_version_is_at_least "4.01.03.00" ; then options="--skip-ndbcluster" # Filling timezones, see # http://dev.mysql.com/doc/mysql/en/time-zone-support.html - ${ROOT}/usr/bin/mysql_tzinfo_to_sql ${ROOT}/usr/share${MY_SUFFIX}/zoneinfo \ - > "${sqltmp}" + ${ROOT}/usr/bin/mysql_tzinfo_to_sql${MY_SUFFIX} ${ROOT}/usr/share/zoneinfo \ + > "${sqltmp}" 2>&1 | grep -v "Skipping it." + + if [[ -r "${help_tables}" ]] ; then + cat "${help_tables}" >> "${sqltmp}" + fi fi - local socket=${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}.sock + local socket=${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}${RANDOM}.sock + local pidfile=${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}${RANDOM}.sock local mysqld="${ROOT}/usr/sbin/mysqld${MY_SUFFIX} \ ${options} \ + --user=mysql \ --skip-grant-tables \ --basedir=${ROOT}/usr \ --datadir=${ROOT}/${DATADIR} \ --skip-innodb \ --skip-bdb \ + --skip-networking \ --max_allowed_packet=8M \ --net_buffer_length=16K \ --socket=${socket} \ - --pid-file=${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}.pid" - + --pid-file=${pidfile}" $mysqld & - while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] - do + while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do maxtry=$(($maxtry-1)) echo -n "." sleep 1 @@ -778,8 +792,8 @@ pkg_config() { # do this from memory we don't want clear text password in temp files local sql="UPDATE mysql.user SET Password = PASSWORD('${pwd1}') WHERE USER='root'" - ${ROOT}/usr/bin/mysql \ - --socket=${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}.sock \ + ${ROOT}/usr/bin/mysql${MY_SUFFIX} \ + --socket=${socket} \ -hlocalhost \ -e "${sql}" @@ -792,8 +806,10 @@ pkg_config() { -p"${pwd1}" \ mysql < "${sqltmp}" - kill $( cat ${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}.pid ) + # server stop and cleanup + kill $(< "${pidfile}" ) rm "${sqltmp}" + einfo "stopping the server," + wait %1 einfo "done" } - diff --git a/dev-db/mysql/mysql-5.1.3_alpha-r30.ebuild b/dev-db/mysql/mysql-5.1.3_alpha-r30.ebuild index 6d0c5bc3df72..cdd9cf184670 100644 --- a/dev-db/mysql/mysql-5.1.3_alpha-r30.ebuild +++ b/dev-db/mysql/mysql-5.1.3_alpha-r30.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/mysql-5.1.3_alpha-r30.ebuild,v 1.3 2005/12/11 18:22:23 vivo Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/mysql-5.1.3_alpha-r30.ebuild,v 1.4 2005/12/12 10:15:57 vivo Exp $ # helper function, version (integer) may have section separated by dots # for readbility @@ -230,7 +230,8 @@ src_unpack() { rm -f scripts/mysqlbug # Multilib issue with zlib detection - sed -i -e "s:zlib_dir/lib:zlib_dir/$(get_libdir):g" \ + mysql_version_is_at_least "5.00.15.00" \ + && sed -i -e "s:zlib_dir/lib:zlib_dir/$(get_libdir):g" \ "${S}/config/ac-macros/zlib.m4" # Make charsets install in the right place @@ -707,117 +708,102 @@ pkg_config() { die "Minimal builds do NOT include the MySQL server" fi - local menusel - - cat <<-EOF - ======== - || - || 1) Create system database - || 2) [TODO] Copy needed file to chroot - || 3) [TODO] Make the default server (symlink) - - EOF - - read menusel - echo - [[ -z "${menusel}" ]] || [[ "${menusel}" == 0 ]] && return 0 - if [[ "${menusel}" == '1' ]] - then - local pwd1="a" - local pwd2="b" - local maxtry=5 - - if [[ -d "${ROOT}/${DATADIR}/mysql" ]] ; then - ewarn "You have already a MySQL database in place." - ewarn "(${ROOT}/${DATADIR}/*)" - ewarn "Please rename or delete it if you wish to replace it." - die "MySQL database already exists!" - fi + local pwd1="a" + local pwd2="b" + local maxtry=5 - einfo "Creating the mysql database and setting proper" - einfo "permissions on it..." + if [[ -d "${ROOT}/${DATADIR}/mysql" ]] ; then + ewarn "You have already a MySQL database in place." + ewarn "(${ROOT}/${DATADIR}/*)" + ewarn "Please rename or delete it if you wish to replace it." + die "MySQL database already exists!" + fi - einfo "Insert a password for the mysql 'root' user" - ewarn "Avoid [\"'\\_%] characters in the password" + einfo "Creating the mysql database and setting proper" + einfo "permissions on it..." - read -rsp " >" pwd1 ; echo - einfo "Check the password" - read -rsp " >" pwd2 ; echo + einfo "Insert a password for the mysql 'root' user" + ewarn "Avoid [\"'\\_%] characters in the password" - if [[ "x$pwd1" != "x$pwd2" ]] ; then - die "Passwords are not the same" - fi + read -rsp " >" pwd1 ; echo + einfo "Check the password" + read -rsp " >" pwd2 ; echo - chown -R mysql:mysql ${ROOT}/${DATADIR} - chmod 0750 ${ROOT}/${DATADIR} + if [[ "x$pwd1" != "x$pwd2" ]] ; then + die "Passwords are not the same" + fi - local options="" - local sqltmp="$(emktemp)" + local options="" + local sqltmp="$(emktemp)" - local help_tables="${ROOT}/usr/share/doc/mysql-${PVR}/scripts/fill_help_tables.sql.gz" - [[ -r "${help_tables}" ]] \ - && zcat "${help_tables}" > "${TMPDIR}/fill_help_tables.sql" \ - || touch "${TMPDIR}/fill_help_tables.sql" - help_tables="${TMPDIR}/fill_help_tables.sql" + local help_tables="${ROOT}/usr/share/doc/mysql-${PVR}/scripts/fill_help_tables.sql.gz" + [[ -r "${help_tables}" ]] \ + && zcat "${help_tables}" > "${TMPDIR}/fill_help_tables.sql" \ + || touch "${TMPDIR}/fill_help_tables.sql" + help_tables="${TMPDIR}/fill_help_tables.sql" - pushd "${TMPDIR}" - ${ROOT}/usr/bin/mysql_install_db${MY_SUFFIX} || die "MySQL databases not installed" - popd + pushd "${TMPDIR}" + ${ROOT}/usr/bin/mysql_install_db${MY_SUFFIX} | grep -B5 -A999 -i "ERROR" + popd + [[ -f ${ROOT}/${DATADIR}/mysql/user.frm ]] || die "MySQL databases not installed" + chown -R mysql:mysql ${ROOT}/${DATADIR} 2> /dev/null + chmod 0750 ${ROOT}/${DATADIR} 2> /dev/null - if mysql_version_is_at_least "4.01.03.00" ; then - options="--skip-ndbcluster" + if mysql_version_is_at_least "4.01.03.00" ; then + options="--skip-ndbcluster" - # Filling timezones, see - # http://dev.mysql.com/doc/mysql/en/time-zone-support.html - ${ROOT}/usr/bin/mysql_tzinfo_to_sql${MY_SUFFIX} ${ROOT}/usr/share/zoneinfo \ - > "${sqltmp}" + # Filling timezones, see + # http://dev.mysql.com/doc/mysql/en/time-zone-support.html + ${ROOT}/usr/bin/mysql_tzinfo_to_sql${MY_SUFFIX} ${ROOT}/usr/share/zoneinfo \ + > "${sqltmp}" 2>&1 | grep -v "Skipping it." - if [[ -r "${help_tables}" ]] ; then - cat "${help_tables}" >> "${sqltmp}" - fi + if [[ -r "${help_tables}" ]] ; then + cat "${help_tables}" >> "${sqltmp}" fi + fi - local socket=${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}${RANDOM}.sock - local pidfile=${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}${RANDOM}.sock - local mysqld="${ROOT}/usr/sbin/mysqld${MY_SUFFIX} \ - ${options} \ - --skip-grant-tables \ - --basedir=${ROOT}/usr \ - --datadir=${ROOT}/${DATADIR} \ - --skip-innodb \ - --skip-bdb \ - --max_allowed_packet=8M \ - --net_buffer_length=16K \ - --socket=${socket} \ - --pid-file=${pidfile}" - - $mysqld & - while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] - do - maxtry=$(($maxtry-1)) - echo -n "." - sleep 1 - done + local socket=${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}${RANDOM}.sock + local pidfile=${ROOT}/var/run/mysqld/mysqld${MY_SUFFIX}${RANDOM}.sock + local mysqld="${ROOT}/usr/sbin/mysqld${MY_SUFFIX} \ + ${options} \ + --user=mysql \ + --skip-grant-tables \ + --basedir=${ROOT}/usr \ + --datadir=${ROOT}/${DATADIR} \ + --skip-innodb \ + --skip-bdb \ + --skip-networking \ + --max_allowed_packet=8M \ + --net_buffer_length=16K \ + --socket=${socket} \ + --pid-file=${pidfile}" + $mysqld & + while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do + maxtry=$(($maxtry-1)) + echo -n "." + sleep 1 + done - # do this from memory we don't want clear text password in temp files - local sql="UPDATE mysql.user SET Password = PASSWORD('${pwd1}') WHERE USER='root'" - ${ROOT}/usr/bin/mysql${MY_SUFFIX} \ - --socket=${socket} \ - -hlocalhost \ - -e "${sql}" - - einfo "Loading \"zoneinfo\" this step may require few seconds" - - ${ROOT}/usr/bin/mysql${MY_SUFFIX} \ - --socket=${socket} \ - -hlocalhost \ - -uroot \ - -p"${pwd1}" \ - mysql < "${sqltmp}" - - kill $(< "${pidfile}" ) - rm "${sqltmp}" - einfo "done" - fi # menusel + # do this from memory we don't want clear text password in temp files + local sql="UPDATE mysql.user SET Password = PASSWORD('${pwd1}') WHERE USER='root'" + ${ROOT}/usr/bin/mysql${MY_SUFFIX} \ + --socket=${socket} \ + -hlocalhost \ + -e "${sql}" + + einfo "Loading \"zoneinfo\" this step may require few seconds" + + ${ROOT}/usr/bin/mysql${MY_SUFFIX} \ + --socket=${socket} \ + -hlocalhost \ + -uroot \ + -p"${pwd1}" \ + mysql < "${sqltmp}" + + # server stop and cleanup + kill $(< "${pidfile}" ) + rm "${sqltmp}" + einfo "stopping the server," + wait %1 + einfo "done" } - |