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

Diff of /eclass/mysql.eclass

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

Revision 1.55 Revision 1.56
1# Copyright 1999-2006 Gentoo Foundation 1# Copyright 1999-2006 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/mysql.eclass,v 1.55 2007/01/03 15:27:13 vivo Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.56 2007/01/04 10:32:38 vivo Exp $
4# kate: encoding utf-8; eol unix; 4# kate: encoding utf-8; eol unix;
5# kate: indent-width 4; mixedindent off; remove-trailing-space on; space-indent off; 5# kate: indent-width 4; mixedindent off; remove-trailing-space on; space-indent off;
6# kate: word-wrap-column 80; word-wrap off; 6# kate: word-wrap-column 80; word-wrap off;
7 7
8# Author: Francesco Riosa (Retired) <vivo@gentoo.org> 8# Author: Francesco Riosa (Retired) <vivo@gentoo.org>
13ECLASS="mysql" 13ECLASS="mysql"
14INHERITED="$INHERITED $ECLASS" 14INHERITED="$INHERITED $ECLASS"
15inherit eutils flag-o-matic gnuconfig autotools mysql_fx 15inherit eutils flag-o-matic gnuconfig autotools mysql_fx
16 16
17# avoid running userspace code 8 times per ebuild :( 17# avoid running userspace code 8 times per ebuild :(
18if [[ "${_MYPVR}" != "${PVR}" ]] || [[ -z "${MYSQL_VERSION_ID}" ]] 18if [[ "${_MYPVR}" != "${PVR}" ]] && [[ -n "${PVR}" ]]
19then 19then
20 _MYPVR=${PVR} 20 _MYPVR=${PVR}
21 21
22 [[ -z ${MY_EXTRAS_VER} ]] && MY_EXTRAS_VER="20070103" 22 [[ -z ${MY_EXTRAS_VER} ]] && MY_EXTRAS_VER="20070103"
23 23
138# HELPER FUNCTIONS: 138# HELPER FUNCTIONS:
139# 139#
140 140
141bitkeeper_fetch() { 141bitkeeper_fetch() {
142 142
143 local reposuf
144 if [[ -z "${1}" ]] ; then
145 local tpv
143 local tpv=( ${PV//[-._]/ } ) 146 tpv=( ${PV//[-._]/ } )
144 local reposuf="${tpv[0]}.${tpv[1]}" 147 reposuf="mysql-${tpv[0]}.${tpv[1]}"
145 useq "cluster" && reposuf="${reposuf}-ndb" 148 else
149 reposuf="${1}"
150 fi
151 einfo "using \"${reposuf}\" repository."
146 local repo_uri="bk://mysql.bkbits.net/mysql-${reposuf}" 152 local repo_uri="bk://mysql.bkbits.net/${reposuf}"
147 ## -- ebk_store_dir: bitkeeper sources store directory 153 ## -- ebk_store_dir: bitkeeper sources store directory
148 local ebk_store_dir="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/bk-src" 154 local ebk_store_dir="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/bk-src"
149 ## -- ebk_fetch_cmd: bitkeeper fetch command 155 ## -- ebk_fetch_cmd: bitkeeper fetch command
150 # always fetch the latest revision, use -r<revision> if a specified revision is wanted 156 # always fetch the latest revision, use -r<revision> if a specified revision is wanted
151 # hint: does not work 157 # hint: does not work
161 mkdir -p "${ebk_store_dir}" || die "${EBK}: can't mkdir ${ebk_store_dir}." 167 mkdir -p "${ebk_store_dir}" || die "${EBK}: can't mkdir ${ebk_store_dir}."
162 fi 168 fi
163 169
164 pushd "${ebk_store_dir}" || die "${EBK}: can't chdir to ${ebk_store_dir}" 170 pushd "${ebk_store_dir}" || die "${EBK}: can't chdir to ${ebk_store_dir}"
165 171
166 local wc_path=mysql-${reposuf} 172 local wc_path=${reposuf}
167 173
168 if [[ ! -d "${wc_path}" ]]; then 174 if [[ ! -d "${wc_path}" ]]; then
169 local options="-r+" 175 local options="-r+"
170 # first check out 176 # first check out
171 einfo "bitkeeper check out start -->" 177 einfo "bitkeeper check out start -->"
182 einfo "bitkeeper update start -->" 188 einfo "bitkeeper update start -->"
183 einfo " repository: ${repo_uri}" 189 einfo " repository: ${repo_uri}"
184 190
185 ${ebk_update_cmd} "${repo_uri}" "${wc_path}" \ 191 ${ebk_update_cmd} "${repo_uri}" "${wc_path}" \
186 || die "BK: can't update from ${repo_uri} to ${wc_path}." 192 || die "BK: can't update from ${repo_uri} to ${wc_path}."
187
188 fi 193 fi
189 194
190 einfo " working copy: ${wc_path}" 195 einfo " working copy: ${wc_path}"
191 cd "${wc_path}" 196 cd "${wc_path}"
192 rsync -rlpgo --exclude="BK/" . "${S}" || die "BK: can't export to ${S}." 197 rsync -rlpgo --exclude="BK/" . "${S}" || die "BK: can't export to ${S}."
500 # Initialize the proper variables first 505 # Initialize the proper variables first
501 mysql_init_vars 506 mysql_init_vars
502 507
503 unpack ${A} 508 unpack ${A}
504 if [[ ${IS_BITKEEPER} -eq 90 ]] ; then 509 if [[ ${IS_BITKEEPER} -eq 90 ]] ; then
510 if mysql_check_version_range "5.1 to 5.1.99" ; then
511 bitkeeper_fetch "mysql-5.1-ndb"
512 elif mysql_check_version_range "5.2 to 5.2.99" ; then
513 bitkeeper_fetch "mysql-5.2-falcon"
514 else
505 bitkeeper_fetch 515 bitkeeper_fetch
516 fi
506 cd "${S}" 517 cd "${S}"
507 einfo "running upstream autorun on bk sources" 518 einfo "running upstream autorun on bk sources"
508 BUILD/autorun.sh 519 BUILD/autorun.sh
509 else 520 else
510 mv -f "${WORKDIR}/${MY_SOURCEDIR}" "${S}" 521 mv -f "${WORKDIR}/${MY_SOURCEDIR}" "${S}"

Legend:
Removed from v.1.55  
changed lines
  Added in v.1.56

  ViewVC Help
Powered by ViewVC 1.1.20