/[gentoo-x86]/eclass/mysql.eclass
Gentoo

Diff of /eclass/mysql.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.105 Revision 1.114
1# Copyright 1999-2007 Gentoo Foundation 1# Copyright 1999-2007 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/mysql.eclass,v 1.105 2009/02/11 11:28:16 robbat2 Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/mysql.eclass,v 1.114 2009/07/06 19:06:03 robbat2 Exp $
4 4
5# Author: Francesco Riosa (Retired) <vivo@gentoo.org> 5# Author: Francesco Riosa (Retired) <vivo@gentoo.org>
6# Maintainer: MySQL Team <mysql-bugs@gentoo.org> 6# Maintainer: MySQL Team <mysql-bugs@gentoo.org>
7# - Luca Longinotti <chtekk@gentoo.org> 7# - Luca Longinotti <chtekk@gentoo.org>
8# - Robin H. Johnson <robbat2@gentoo.org> 8# - Robin H. Johnson <robbat2@gentoo.org>
10WANT_AUTOCONF="latest" 10WANT_AUTOCONF="latest"
11WANT_AUTOMAKE="latest" 11WANT_AUTOMAKE="latest"
12 12
13inherit eutils flag-o-matic gnuconfig autotools mysql_fx versionator 13inherit eutils flag-o-matic gnuconfig autotools mysql_fx versionator
14 14
15case "${EAPI:-0}" in
16 2)
17 EXPORT_FUNCTIONS pkg_setup \
18 src_unpack src_prepare \
19 src_configure src_compile \
20 src_install \
21 pkg_preinst pkg_postinst \
22 pkg_config pkg_postrm
23 IUSE_DEFAULT_ON='+'
24 ;;
25 *)
26 EXPORT_FUNCTIONS pkg_setup \
27 src_unpack \
28 src_compile \
29 src_install \
30 pkg_preinst pkg_postinst \
31 pkg_config pkg_postrm
32 ;;
33esac
34
15# Shorten the path because the socket path length must be shorter than 107 chars 35# Shorten the path because the socket path length must be shorter than 107 chars
16# and we will run a mysql server during test phase 36# and we will run a mysql server during test phase
17S="${WORKDIR}/mysql" 37S="${WORKDIR}/mysql"
18 38
19[[ "${MY_EXTRAS_VER}" == "latest" ]] && MY_EXTRAS_VER="20070108" 39[[ "${MY_EXTRAS_VER}" == "latest" ]] && MY_EXTRAS_VER="20090228-0714Z"
20if [[ "${MY_EXTRAS_VER}" == "live" ]]; then 40if [[ "${MY_EXTRAS_VER}" == "live" ]]; then
21 EGIT_PROJECT=mysql-extras 41 EGIT_PROJECT=mysql-extras
22 EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/mysql-extras.git" 42 EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/mysql-extras.git"
23 inherit git 43 inherit git
24fi
25
26if [[ ${PR#r} -lt 60 ]] ; then
27 IS_BITKEEPER=0
28elif [[ ${PR#r} -lt 90 ]] ; then
29 IS_BITKEEPER=60
30else
31 IS_BITKEEPER=90
32fi 44fi
33 45
34# MYSQL_VERSION_ID will be: 46# MYSQL_VERSION_ID will be:
35# major * 10e6 + minor * 10e4 + micro * 10e2 + gentoo revision number, all [0..99] 47# major * 10e6 + minor * 10e4 + micro * 10e2 + gentoo revision number, all [0..99]
36# This is an important part, because many of the choices the MySQL ebuild will do 48# This is an important part, because many of the choices the MySQL ebuild will do
47 MYSQL_VERSION_ID="${MYSQL_VERSION_ID}${tpv[${vatom}]:0-2}" 59 MYSQL_VERSION_ID="${MYSQL_VERSION_ID}${tpv[${vatom}]:0-2}"
48done 60done
49# strip leading "0" (otherwise it's considered an octal number by BASH) 61# strip leading "0" (otherwise it's considered an octal number by BASH)
50MYSQL_VERSION_ID=${MYSQL_VERSION_ID##"0"} 62MYSQL_VERSION_ID=${MYSQL_VERSION_ID##"0"}
51 63
64# Community features are available in mysql-community
65# AND in the re-merged mysql-5.0.82 and newer
66if [ "${PN}" == "mysql-community" ]; then
67 MYSQL_COMMUNITY_FEATURES=1
68elif [ "${PV#5.0}" != "${PV}" ] && mysql_version_is_at_least "5.0.82"; then
69 MYSQL_COMMUNITY_FEATURES=1
70else
71 MYSQL_COMMUNITY_FEATURES=0
72fi
73
52# Be warned, *DEPEND are version-dependant 74# Be warned, *DEPEND are version-dependant
53# These are used for both runtime and compiletime 75# These are used for both runtime and compiletime
54DEPEND="ssl? ( >=dev-libs/openssl-0.9.6d ) 76DEPEND="ssl? ( >=dev-libs/openssl-0.9.6d )
55 userland_GNU? ( sys-process/procps ) 77 userland_GNU? ( sys-process/procps )
56 >=sys-apps/sed-4 78 >=sys-apps/sed-4
72mysql_version_is_at_least "5.1" \ 94mysql_version_is_at_least "5.1" \
73|| DEPEND="${DEPEND} berkdb? ( sys-apps/ed )" 95|| DEPEND="${DEPEND} berkdb? ( sys-apps/ed )"
74 96
75# compile-time-only 97# compile-time-only
76mysql_version_is_at_least "5.1.12" \ 98mysql_version_is_at_least "5.1.12" \
77&& DEPEND="${DEPEND} innodb? ( >=dev-util/cmake-2.4.3 )" 99&& DEPEND="${DEPEND} >=dev-util/cmake-2.4.3"
78
79# BitKeeper dependency, compile-time only
80[[ ${IS_BITKEEPER} -eq 90 ]] && DEPEND="${DEPEND} dev-util/bk_client"
81
82 100
83# dev-perl/DBD-mysql is needed by some scripts installed by MySQL 101# dev-perl/DBD-mysql is needed by some scripts installed by MySQL
84PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )" 102PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )"
85 103
86# For other stuff to bring us in 104# For other stuff to bring us in
87PDEPEND="${PDEPEND} =virtual/mysql-$(get_version_component_range 1-2 ${PV})" 105PDEPEND="${PDEPEND} =virtual/mysql-$(get_version_component_range 1-2 ${PV})"
88 106
89# Work out the default SERVER_URI correctly 107# Work out the default SERVER_URI correctly
90if [ -z "${SERVER_URI}" ]; then 108if [ -z "${SERVER_URI}" ]; then
91 # The community build is on the mirrors 109 # The community build is on the mirrors
92 if [ "${PN}" == "mysql-community" ]; then 110 if [ "${MYSQL_COMMUNITY_FEATURES}" == "1" ]; then
93 SERVER_URI="mirror://mysql/Downloads/MySQL-${PV%.*}/mysql-${PV//_/-}.tar.gz" 111 SERVER_URI="mirror://mysql/Downloads/MySQL-${PV%.*}/mysql-${PV//_/-}.tar.gz"
94 # The enterprise source is on the primary site only 112 # The (old) enterprise source is on the primary site only
95 elif [ "${PN}" == "mysql" ]; then 113 elif [ "${PN}" == "mysql" ]; then
96 SERVER_URI="ftp://ftp.mysql.com/pub/mysql/src/mysql-${PV//_/-}.tar.gz" 114 SERVER_URI="ftp://ftp.mysql.com/pub/mysql/src/mysql-${PV//_/-}.tar.gz"
97 fi 115 fi
98fi 116fi
99 117
109 127
110DESCRIPTION="A fast, multi-threaded, multi-user SQL database server." 128DESCRIPTION="A fast, multi-threaded, multi-user SQL database server."
111HOMEPAGE="http://www.mysql.com/" 129HOMEPAGE="http://www.mysql.com/"
112LICENSE="GPL-2" 130LICENSE="GPL-2"
113SLOT="0" 131SLOT="0"
114IUSE="big-tables debug embedded minimal perl selinux ssl static" 132IUSE="big-tables debug embedded minimal ${IUSE_DEFAULT_ON}perl selinux ssl static"
115 133
116mysql_version_is_at_least "4.1" \ 134mysql_version_is_at_least "4.1" \
117&& IUSE="${IUSE} latin1" 135&& IUSE="${IUSE} latin1"
118 136
119mysql_version_is_at_least "4.1.3" \ 137mysql_version_is_at_least "4.1.3" \
124 142
125mysql_version_is_at_least "5.0.18" \ 143mysql_version_is_at_least "5.0.18" \
126&& IUSE="${IUSE} max-idx-128" 144&& IUSE="${IUSE} max-idx-128"
127 145
128mysql_version_is_at_least "5.1" \ 146mysql_version_is_at_least "5.1" \
129&& IUSE="${IUSE} innodb"
130
131mysql_version_is_at_least "5.1" \
132|| IUSE="${IUSE} berkdb" 147|| IUSE="${IUSE} berkdb"
133 148
134mysql_version_is_at_least "5.1.12" \ 149mysql_version_is_at_least "5.1.12" \
135&& IUSE="${IUSE} pbxt" 150&& IUSE="${IUSE} pbxt"
136 151
137EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_preinst \ 152[ "${MYSQL_COMMUNITY_FEATURES}" == "1" ] \
138 pkg_postinst pkg_config pkg_postrm 153&& IUSE="${IUSE} ${IUSE_DEFAULT_ON}community profiling"
139 154
140# 155#
141# HELPER FUNCTIONS: 156# HELPER FUNCTIONS:
142# 157#
143
144bitkeeper_fetch() {
145 local reposuf
146 if [[ -z "${1}" ]] ; then
147 local tpv
148 tpv=( ${PV//[-._]/ } )
149 reposuf="mysql-${tpv[0]}.${tpv[1]}"
150 else
151 reposuf="${1}"
152 fi
153 einfo "Using '${reposuf}' repository."
154 local repo_uri="bk://mysql.bkbits.net/${reposuf}"
155 ## -- ebk_store_dir: bitkeeper sources store directory
156 local ebk_store_dir="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/bk-src"
157 ## -- ebk_fetch_cmd: bitkeeper fetch command
158 # always fetch the latest revision, use -r<revision> if a specified revision is wanted
159 # hint: does not work
160 local ebk_fetch_cmd="sfioball"
161 ## -- ebk_update_cmd: bitkeeper update command
162 local ebk_update_cmd="update"
163
164 # addread "/etc/bitkeeper"
165 addwrite "${ebk_store_dir}"
166
167 if [[ ! -d "${ebk_store_dir}" ]] ; then
168 debug-print "${FUNCNAME}: initial checkout, creating bitkeeper directory ..."
169 mkdir -p "${ebk_store_dir}" || die "BK: couldn't mkdir ${ebk_store_dir}"
170 fi
171
172 pushd "${ebk_store_dir}" || die "BK: couldn't chdir to ${ebk_store_dir}"
173
174 local wc_path=${reposuf}
175
176 if [[ ! -d "${wc_path}" ]] ; then
177 local options="-r+"
178
179 # first checkout
180 einfo "bitkeeper checkout start -->"
181 einfo " repository: ${repo_uri}"
182
183 ${ebk_fetch_cmd} ${options} "${repo_uri}" "${wc_path}" \
184 || die "BK: couldn't fetch from ${repo_uri}"
185 else
186 if [[ ! -d "${wc_path}/BK" ]] ; then
187 popd
188 die "Looks like ${wc_path} is not a bitkeeper path"
189 fi
190
191 # update working copy
192 einfo "bitkeeper update start -->"
193 einfo " repository: ${repo_uri}"
194
195 ${ebk_update_cmd} "${repo_uri}" "${wc_path}" \
196 || die "BK: couldn't update from ${repo_uri} to ${wc_path}"
197 fi
198
199 einfo " working copy: ${wc_path}"
200 cd "${wc_path}"
201 rsync -rlpgo --exclude="BK/" . "${S}" || die "BK: couldn't export to ${S}"
202
203 echo
204 popd
205}
206 158
207mysql_disable_test() { 159mysql_disable_test() {
208 local testname="${1}" ; shift 160 local testname="${1}" ; shift
209 local reason="${@}" 161 local reason="${@}"
210 local mysql_disable_file="${S}/mysql-test/t/disabled.def" 162 local mysql_disable_file="${S}/mysql-test/t/disabled.def"
251 PREVIOUS_DATADIR="yes" 203 PREVIOUS_DATADIR="yes"
252 else 204 else
253 PREVIOUS_DATADIR="no" 205 PREVIOUS_DATADIR="no"
254 fi 206 fi
255 export PREVIOUS_DATADIR 207 export PREVIOUS_DATADIR
208 fi
209 else
210 if [[ ${EBUILD_PHASE} == "config" ]]; then
211 local new_MY_DATADIR
212 new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \
213 | sed -ne '/datadir/s|^--datadir=||p' \
214 | tail -n1`
215
216 if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then
217 ewarn "MySQL MY_DATADIR has changed"
218 ewarn "from ${MY_DATADIR}"
219 ewarn "to ${new_MY_DATADIR}"
220 MY_DATADIR="${new_MY_DATADIR}"
221 fi
256 fi 222 fi
257 fi 223 fi
258 224
259 MY_SOURCEDIR=${SERVER_URI##*/} 225 MY_SOURCEDIR=${SERVER_URI##*/}
260 MY_SOURCEDIR=${MY_SOURCEDIR%.tar*} 226 MY_SOURCEDIR=${MY_SOURCEDIR%.tar*}
406 elog "http://dev.mysql.com/doc/mysql/en/federated-limitations.html" 372 elog "http://dev.mysql.com/doc/mysql/en/federated-limitations.html"
407 myconf="${myconf} --with-federated-storage-engine" 373 myconf="${myconf} --with-federated-storage-engine"
408 fi 374 fi
409 fi 375 fi
410 376
411 if [ "${PN}" == "mysql-community" ]; then 377 if [ "${MYSQL_COMMUNITY_FEATURES}" == "1" ]; then
412 myconf="${myconf} --enable-community-features" 378 myconf="${myconf} `use_enable community community-features`"
379 if use community; then
380 myconf="${myconf} `use_enable profiling`"
381 else
382 myconf="${myconf} --disable-profiling"
383 fi
413 fi 384 fi
414 385
415 mysql_version_is_at_least "5.0.18" \ 386 mysql_version_is_at_least "5.0.18" \
416 && use max-idx-128 \ 387 && use max-idx-128 \
417 && myconf="${myconf} --with-max-indexes=128" 388 && myconf="${myconf} --with-max-indexes=128"
439 410
440 elog "Before using the Federated storage engine, please be sure to read" 411 elog "Before using the Federated storage engine, please be sure to read"
441 elog "http://dev.mysql.com/doc/refman/5.1/en/federated-limitations.html" 412 elog "http://dev.mysql.com/doc/refman/5.1/en/federated-limitations.html"
442 fi 413 fi
443 414
444 if use innodb ; then 415 # Upstream specifically requests that InnoDB always be built.
445 plugins="${plugins},innobase" 416 plugins="${plugins},innobase"
446 fi
447 417
448 # like configuration=max-no-ndb 418 # like configuration=max-no-ndb
449 if use cluster ; then 419 if use cluster ; then
450 plugins="${plugins},ndbcluster" 420 plugins="${plugins},ndbcluster"
451 myconf="${myconf} --with-ndb-binlog" 421 myconf="${myconf} --with-ndb-binlog"
456 fi 426 fi
457 427
458 myconf="${myconf} --with-plugins=${plugins}" 428 myconf="${myconf} --with-plugins=${plugins}"
459} 429}
460 430
461pbxt_src_compile() { 431pbxt_src_configure() {
462 mysql_init_vars 432 mysql_init_vars
463 433
464 pushd "${WORKDIR}/pbxt-${PBXT_VERSION}" &>/dev/null 434 pushd "${WORKDIR}/pbxt-${PBXT_VERSION}" &>/dev/null
465 435
466 einfo "Reconfiguring dir '${PWD}'" 436 einfo "Reconfiguring dir '${PWD}'"
469 local myconf="" 439 local myconf=""
470 myconf="${myconf} --with-mysql=${S} --libdir=${D}/${MY_LIBDIR}" 440 myconf="${myconf} --with-mysql=${S} --libdir=${D}/${MY_LIBDIR}"
471 use debug && myconf="${myconf} --with-debug=full" 441 use debug && myconf="${myconf} --with-debug=full"
472 # TODO: is it safe/needed to use econf here ? 442 # TODO: is it safe/needed to use econf here ?
473 ./configure ${myconf} || die "Problem configuring PBXT storage engine" 443 ./configure ${myconf} || die "Problem configuring PBXT storage engine"
444}
445
446pbxt_src_compile() {
447 # Be backwards compatible for now
448 if [[ $EAPI != 2 ]]; then
449 pbxt_src_configure
450 fi
474 # TODO: is it safe/needed to use emake here ? 451 # TODO: is it safe/needed to use emake here ?
475 make || die "Problem making PBXT storage engine (${myconf})" 452 make || die "Problem making PBXT storage engine (${myconf})"
476 453
477 popd 454 popd
478 # TODO: modify test suite for PBXT 455 # TODO: modify test suite for PBXT
531 mysql_init_vars 508 mysql_init_vars
532 509
533 unpack ${A} 510 unpack ${A}
534 # Grab the patches 511 # Grab the patches
535 [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR}/mysql-extras" git_src_unpack 512 [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR}/mysql-extras" git_src_unpack
536 # Bitkeeper checkout support 513
537 if [[ ${IS_BITKEEPER} -eq 90 ]] ; then
538 if mysql_check_version_range "5.1 to 5.1.99" ; then
539 bitkeeper_fetch "mysql-5.1-ndb"
540 elif mysql_check_version_range "5.2 to 5.2.99" ; then
541 bitkeeper_fetch "mysql-5.2-falcon"
542 else
543 bitkeeper_fetch
544 fi
545 cd "${S}"
546 einfo "Running upstream autorun over BK sources ..."
547 BUILD/autorun.sh
548 else
549 mv -f "${WORKDIR}/${MY_SOURCEDIR}" "${S}" 514 mv -f "${WORKDIR}/${MY_SOURCEDIR}" "${S}"
515
516 # Be backwards compatible for now
517 if [[ $EAPI != 2 ]]; then
518 mysql_src_prepare
519 fi
520}
521
522mysql_src_prepare() {
550 cd "${S}" 523 cd "${S}"
551 fi
552 524
553 # Apply the patches for this MySQL version 525 # Apply the patches for this MySQL version
554 EPATCH_SUFFIX="patch" 526 EPATCH_SUFFIX="patch"
555 mkdir -p "${EPATCH_SOURCE}" || die "Unable to create epatch directory" 527 mkdir -p "${EPATCH_SOURCE}" || die "Unable to create epatch directory"
556 # Clean out old items 528 # Clean out old items
582 local rebuilddirlist d 554 local rebuilddirlist d
583 555
584 if mysql_version_is_at_least "5.1.12" ; then 556 if mysql_version_is_at_least "5.1.12" ; then
585 rebuilddirlist="." 557 rebuilddirlist="."
586 # TODO: check this with a cmake expert 558 # TODO: check this with a cmake expert
587 use innodb \
588 && cmake \ 559 cmake \
589 -DCMAKE_C_COMPILER=$(type -P $(tc-getCC)) \ 560 -DCMAKE_C_COMPILER=$(type -P $(tc-getCC)) \
590 -DCMAKE_CXX_COMPILER=$(type -P $(tc-getCXX)) \ 561 -DCMAKE_CXX_COMPILER=$(type -P $(tc-getCXX)) \
591 "storage/innobase" 562 "storage/innobase"
592 else 563 else
593 rebuilddirlist=". innobase" 564 rebuilddirlist=". innobase"
617 || die "Failed bdb reconfigure" 588 || die "Failed bdb reconfigure"
618 popd &>/dev/null 589 popd &>/dev/null
619 fi 590 fi
620} 591}
621 592
622mysql_src_compile() { 593mysql_src_configure() {
623 # Make sure the vars are correctly initialized 594 # Make sure the vars are correctly initialized
624 mysql_init_vars 595 mysql_init_vars
625 596
626 # $myconf is modified by the configure_* functions 597 # $myconf is modified by the configure_* functions
627 local myconf="" 598 local myconf=""
672 # TODO: Move this before autoreconf !!! 643 # TODO: Move this before autoreconf !!!
673 find . -type f -name Makefile -print0 \ 644 find . -type f -name Makefile -print0 \
674 | xargs -0 -n100 sed -i \ 645 | xargs -0 -n100 sed -i \
675 -e 's|^pkglibdir *= *$(libdir)/mysql|pkglibdir = $(libdir)|;s|^pkgincludedir *= *$(includedir)/mysql|pkgincludedir = $(includedir)|' 646 -e 's|^pkglibdir *= *$(libdir)/mysql|pkglibdir = $(libdir)|;s|^pkgincludedir *= *$(includedir)/mysql|pkgincludedir = $(includedir)|'
676 647
648 if [[ $EAPI == 2 ]]; then
649 mysql_version_is_at_least "5.1.12" && use pbxt && pbxt_src_configure
650 fi
651}
652
653mysql_src_compile() {
654 # Be backwards compatible for now
655 if [[ $EAPI != 2 ]]; then
656 mysql_src_configure
657 fi
658
677 emake || die "emake failed" 659 emake || die "emake failed"
678 660
679 mysql_version_is_at_least "5.1.12" && use pbxt && pbxt_src_compile 661 mysql_version_is_at_least "5.1.12" && use pbxt && pbxt_src_compile
680} 662}
681 663
684 mysql_init_vars 666 mysql_init_vars
685 667
686 emake install DESTDIR="${D}" benchdir_root="${MY_SHAREDSTATEDIR}" || die "emake install failed" 668 emake install DESTDIR="${D}" benchdir_root="${MY_SHAREDSTATEDIR}" || die "emake install failed"
687 669
688 mysql_version_is_at_least "5.1.12" && use pbxt && pbxt_src_install 670 mysql_version_is_at_least "5.1.12" && use pbxt && pbxt_src_install
689
690 insinto "${MY_INCLUDEDIR}"
691 doins "${MY_INCLUDEDIR}"/my_{config,dir}.h
692 671
693 # Convenience links 672 # Convenience links
694 einfo "Making Convenience links for mysqlcheck multi-call binary" 673 einfo "Making Convenience links for mysqlcheck multi-call binary"
695 dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlanalyze" 674 dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlanalyze"
696 dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlrepair" 675 dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlrepair"
836 && use berkdb \ 815 && use berkdb \
837 && elog "Berkeley DB support is deprecated and will be removed in future versions!" 816 && elog "Berkeley DB support is deprecated and will be removed in future versions!"
838} 817}
839 818
840mysql_pkg_config() { 819mysql_pkg_config() {
820 local old_MY_DATADIR="${MY_DATADIR}"
821
841 # Make sure the vars are correctly initialized 822 # Make sure the vars are correctly initialized
842 mysql_init_vars 823 mysql_init_vars
843 824
844 [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR" 825 [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR"
845 826
846 if built_with_use ${CATEGORY}/${PN} minimal ; then 827 if built_with_use ${CATEGORY}/${PN} minimal ; then
847 die "Minimal builds do NOT include the MySQL server" 828 die "Minimal builds do NOT include the MySQL server"
829 fi
830
831 if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then
832 local MY_DATADIR_s="$(strip_duplicate_slashes ${ROOT}/${MY_DATADIR})"
833 local old_MY_DATADIR_s="$(strip_duplicate_slashes ${ROOT}/${old_MY_DATADIR})"
834
835 if [[ -d "${old_MY_DATADIR_s}" ]]; then
836 if [[ -d "${MY_DATADIR_s}" ]]; then
837 ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist"
838 ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}"
839 else
840 elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}"
841 mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \
842 || die "Moving MY_DATADIR failed"
843 fi
844 else
845 ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist"
846 if [[ -d "${MY_DATADIR_s}" ]]; then
847 ewarn "Attempting to use ${MY_DATADIR_s}"
848 else
849 eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist"
850 die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}"
851 fi
852 fi
848 fi 853 fi
849 854
850 local pwd1="a" 855 local pwd1="a"
851 local pwd2="b" 856 local pwd2="b"
852 local maxtry=5 857 local maxtry=5

Legend:
Removed from v.1.105  
changed lines
  Added in v.1.114

  ViewVC Help
Powered by ViewVC 1.1.20