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

Diff of /eclass/bzr.eclass

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

Revision 1.7 Revision 1.20
1# Copyright 1999-2009 Gentoo Foundation 1# Copyright 1999-2013 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/bzr.eclass,v 1.7 2009/12/18 07:08:19 ulm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/bzr.eclass,v 1.20 2013/07/11 18:38:59 ulm Exp $
4# 4#
5# @ECLASS: bzr.eclass 5# @ECLASS: bzr.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Emacs team <emacs@gentoo.org>
8# Bazaar team <bazaar@gentoo.org>
9# @AUTHOR:
7# Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org>, 10# Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org>
8# Ulrich Mueller <ulm@gentoo.org>,
9# Christian Faulhammer <fauli@gentoo.org>,
10# Mark Lee <bzr-gentoo-overlay@lazymalevolence.com>, 11# Mark Lee <bzr-gentoo-overlay@lazymalevolence.com>
11# and anyone who wants to help 12# Ulrich Müller <ulm@gentoo.org>
12# @BLURB: This eclass provides support to use the Bazaar VCS 13# Christian Faulhammer <fauli@gentoo.org>
14# @BLURB: generic fetching functions for the Bazaar VCS
13# @DESCRIPTION: 15# @DESCRIPTION:
14# The bzr.eclass provides support for apps using the Bazaar VCS 16# The bzr.eclass provides functions to fetch, unpack, patch, and
15# (distributed version control system). 17# bootstrap sources from repositories of the Bazaar distributed version
16# The eclass was originally derived from the git eclass. 18# control system. The eclass was originally derived from git.eclass.
17# 19#
18# Note: Just set EBZR_REPO_URI to the URI of the branch and the src_unpack() 20# Note: Just set EBZR_REPO_URI to the URI of the branch and src_unpack()
19# of this eclass will put an export of the branch in ${WORKDIR}/${PN}. 21# of this eclass will export the branch to ${WORKDIR}/${P}.
20 22
21inherit eutils 23inherit eutils
22 24
23EBZR="bzr.eclass" 25EBZR="bzr.eclass"
24 26
25case "${EAPI:-0}" in 27case "${EAPI:-0}" in
26 0|1) EXPORT_FUNCTIONS src_unpack ;; 28 0|1) EXPORT_FUNCTIONS src_unpack ;;
27 *) EXPORT_FUNCTIONS src_unpack src_prepare ;; 29 *) EXPORT_FUNCTIONS src_unpack src_prepare ;;
28esac 30esac
29 31
30HOMEPAGE="http://bazaar-vcs.org/"
31DESCRIPTION="Based on the ${EBZR} eclass"
32
33DEPEND=">=dev-util/bzr-1.5" 32DEPEND=">=dev-vcs/bzr-2.0.1"
33case "${EAPI:-0}" in
34 0|1) ;;
35 *) [[ ${EBZR_REPO_URI%%:*} = sftp ]] \
36 && DEPEND=">=dev-vcs/bzr-2.0.1[sftp]" ;;
37esac
34 38
35# @ECLASS-VARIABLE: EBZR_STORE_DIR 39# @ECLASS-VARIABLE: EBZR_STORE_DIR
36# @DESCRIPTION: 40# @DESCRIPTION:
37# The directory to store all fetched Bazaar live sources. 41# The directory to store all fetched Bazaar live sources.
38: ${EBZR_STORE_DIR:=${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/bzr-src} 42: ${EBZR_STORE_DIR:=${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}/bzr-src}
43
44# @ECLASS-VARIABLE: EBZR_UNPACK_DIR
45# @DESCRIPTION:
46# The working directory where the sources are copied to.
47: ${EBZR_UNPACK_DIR:=${WORKDIR}/${P}}
48
49# @ECLASS-VARIABLE: EBZR_INIT_REPO_CMD
50# @DESCRIPTION:
51# The Bazaar command to initialise a shared repository.
52: ${EBZR_INIT_REPO_CMD:="bzr init-repository --no-trees"}
39 53
40# @ECLASS-VARIABLE: EBZR_FETCH_CMD 54# @ECLASS-VARIABLE: EBZR_FETCH_CMD
41# @DESCRIPTION: 55# @DESCRIPTION:
42# The Bazaar command to fetch the sources. 56# The Bazaar command to fetch the sources.
43EBZR_FETCH_CMD="bzr checkout --lightweight" 57: ${EBZR_FETCH_CMD:="bzr branch --no-tree"}
44 58
45# @ECLASS-VARIABLE: EBZR_UPDATE_CMD 59# @ECLASS-VARIABLE: EBZR_UPDATE_CMD
46# @DESCRIPTION: 60# @DESCRIPTION:
47# The Bazaar command to update the sources. 61# The Bazaar command to update the sources.
48EBZR_UPDATE_CMD="bzr update" 62: ${EBZR_UPDATE_CMD:="bzr pull"}
49
50# @ECLASS-VARIABLE: EBZR_DIFF_CMD
51# @DESCRIPTION:
52# The Bazaar command to get the diff output.
53EBZR_DIFF_CMD="bzr diff"
54 63
55# @ECLASS-VARIABLE: EBZR_EXPORT_CMD 64# @ECLASS-VARIABLE: EBZR_EXPORT_CMD
56# @DESCRIPTION: 65# @DESCRIPTION:
57# The Bazaar command to export a branch. 66# The Bazaar command to export a branch.
58EBZR_EXPORT_CMD="bzr export" 67: ${EBZR_EXPORT_CMD:="bzr export"}
68
69# @ECLASS-VARIABLE: EBZR_CHECKOUT_CMD
70# @DESCRIPTION:
71# The Bazaar command to checkout a branch.
72: ${EBZR_CHECKOUT_CMD:="bzr checkout --lightweight -q"}
59 73
60# @ECLASS-VARIABLE: EBZR_REVNO_CMD 74# @ECLASS-VARIABLE: EBZR_REVNO_CMD
61# @DESCRIPTION: 75# @DESCRIPTION:
62# The Bazaar command to list a revision number of the branch. 76# The Bazaar command to list a revision number of the branch.
63EBZR_REVNO_CMD="bzr revno" 77: ${EBZR_REVNO_CMD:="bzr revno"}
64 78
65# @ECLASS-VARIABLE: EBZR_OPTIONS 79# @ECLASS-VARIABLE: EBZR_OPTIONS
80# @DEFAULT_UNSET
66# @DESCRIPTION: 81# @DESCRIPTION:
67# The options passed to the fetch and update commands. 82# The options passed to the fetch and update commands.
68EBZR_OPTIONS="${EBZR_OPTIONS:-}"
69 83
70# @ECLASS-VARIABLE: EBZR_REPO_URI 84# @ECLASS-VARIABLE: EBZR_REPO_URI
85# @DEFAULT_UNSET
86# @REQUIRED
71# @DESCRIPTION: 87# @DESCRIPTION:
72# The repository URI for the source package. 88# The repository URI for the source package.
73# 89#
74# @CODE 90# Note: If the ebuild uses an sftp:// URI, then in EAPI 0 or 1 it must
75# Supported protocols: 91# make sure that dev-vcs/bzr was built with USE="sftp". In EAPI 2 or
76# - http:// 92# later, the eclass will depend on dev-vcs/bzr[sftp].
77# - https:// 93
78# - sftp:// 94# @ECLASS-VARIABLE: EBZR_INITIAL_URI
79# - rsync:// 95# @DEFAULT_UNSET
80# - lp: 96# @DESCRIPTION:
81# @CODE 97# The URI used for initial branching of the source repository. If this
98# variable is set, the initial branch will be cloned from the location
99# specified, followed by a pull from ${EBZR_REPO_URI}. This is intended
100# for special cases, e.g. when download from the original repository is
101# slow, but a fast mirror exists but may be out of date.
82# 102#
83# Note: lp: seems to be an alias for https://launchpad.net 103# Normally, this variable needs not be set.
84EBZR_REPO_URI="${EBZR_REPO_URI:-}"
85 104
86# @ECLASS-VARIABLE: EBZR_BOOTSTRAP 105# @ECLASS-VARIABLE: EBZR_BOOTSTRAP
106# @DEFAULT_UNSET
87# @DESCRIPTION: 107# @DESCRIPTION:
88# Bootstrap script or command like autogen.sh or etc. 108# Bootstrap script or command like autogen.sh or etc.
89EBZR_BOOTSTRAP="${EBZR_BOOTSTRAP:-}"
90 109
91# @ECLASS-VARIABLE: EBZR_PATCHES 110# @ECLASS-VARIABLE: EBZR_PATCHES
111# @DEFAULT_UNSET
92# @DESCRIPTION: 112# @DESCRIPTION:
93# bzr eclass can apply patches in bzr_bootstrap(). 113# bzr.eclass can apply patches in bzr_bootstrap(). You can use regular
94# You can use regular expressions in this variable like *.diff or 114# expressions in this variable like *.diff or *.patch and the like.
95# *.patch and the like.
96# NOTE: These patches will bei applied before EBZR_BOOTSTRAP is processed. 115# Note: These patches will be applied before EBZR_BOOTSTRAP is processed.
97# 116#
98# Patches are searched both in ${PWD} and ${FILESDIR}, if not found in either 117# Patches are searched both in ${PWD} and ${FILESDIR}. If not found in
99# location, the installation dies. 118# either location, the installation dies.
100EBZR_PATCHES="${EBZR_PATCHES:-}" 119
120# @ECLASS-VARIABLE: EBZR_PROJECT
121# @DESCRIPTION:
122# The project name of your ebuild. Normally, the branch will be stored
123# in the ${EBZR_STORE_DIR}/${EBZR_PROJECT} directory.
124#
125# If EBZR_BRANCH is set (see below), then a shared repository will be
126# created in that directory, and the branch will be located in
127# ${EBZR_STORE_DIR}/${EBZR_PROJECT}/${EBZR_BRANCH}.
128: ${EBZR_PROJECT:=${PN}}
129
130# @ECLASS-VARIABLE: EBZR_BRANCH
131# @DEFAULT_UNSET
132# @DESCRIPTION:
133# The directory where to store the branch within a shared repository,
134# relative to ${EBZR_STORE_DIR}/${EBZR_PROJECT}.
135#
136# This variable should be set if there are several live ebuilds for
137# different branches of the same upstream project. The branches can
138# then share the same repository in EBZR_PROJECT, which will save both
139# data traffic volume and disk space.
140#
141# If there is only a live ebuild for one single branch, EBZR_BRANCH
142# needs not be set. In this case, the branch will be stored in a
143# stand-alone repository directly in EBZR_PROJECT.
101 144
102# @ECLASS-VARIABLE: EBZR_REVISION 145# @ECLASS-VARIABLE: EBZR_REVISION
146# @DEFAULT_UNSET
103# @DESCRIPTION: 147# @DESCRIPTION:
104# Revision to fetch, defaults to the latest 148# Revision to fetch, defaults to the latest
105# (see http://bazaar-vcs.org/BzrRevisionSpec or bzr help revisionspec). 149# (see http://bazaar-vcs.org/BzrRevisionSpec or bzr help revisionspec).
106# If you set this to a non-empty value, then it is recommended not to
107# use a lightweight checkout (see also EBZR_FETCH_CMD).
108EBZR_REVISION="${EBZR_REVISION:-}"
109
110# @ECLASS-VARIABLE: EBZR_CACHE_DIR
111# @DESCRIPTION:
112# The directory to store the source for the package, relative to
113# EBZR_STORE_DIR.
114#
115# default: ${PN}
116EBZR_CACHE_DIR="${EBZR_CACHE_DIR:-${PN}}"
117 150
118# @ECLASS-VARIABLE: EBZR_OFFLINE 151# @ECLASS-VARIABLE: EBZR_OFFLINE
119# @DESCRIPTION: 152# @DESCRIPTION:
120# Set this variable to a non-empty value to disable the automatic updating of 153# Set this variable to a non-empty value to disable automatic updating
121# a bzr source tree. This is intended to be set outside the ebuild by users. 154# of a bzr source tree. This is intended to be set outside the ebuild
122EBZR_OFFLINE="${EBZR_OFFLINE:-${ESCM_OFFLINE}}" 155# by users.
156: ${EBZR_OFFLINE=${EVCS_OFFLINE}}
157
158# @ECLASS-VARIABLE: EBZR_WORKDIR_CHECKOUT
159# @DEFAULT_UNSET
160# @DESCRIPTION:
161# If this variable is set to a non-empty value, EBZR_CHECKOUT_CMD will
162# be used instead of EBZR_EXPORT_CMD to copy the sources to WORKDIR.
123 163
124# @FUNCTION: bzr_initial_fetch 164# @FUNCTION: bzr_initial_fetch
165# @USAGE: <repository URI> <branch directory>
125# @DESCRIPTION: 166# @DESCRIPTION:
126# Retrieves the source code from a repository for the first time, via 167# Internal function, retrieves the source code from a repository for the
127# ${EBZR_FETCH_CMD}. 168# first time, using ${EBZR_FETCH_CMD}.
128bzr_initial_fetch() { 169bzr_initial_fetch() {
129 local repository="${1}"; 170 local repo_uri=$1 branch_dir=$2
130 local branch_dir="${2}"; 171
172 if [[ -n "${EBZR_OFFLINE}" ]]; then
173 ewarn "EBZR_OFFLINE cannot be used when there is no local branch yet."
174 fi
131 175
132 # fetch branch 176 # fetch branch
133 einfo "bzr fetch start -->" 177 einfo "bzr branch start -->"
134 einfo " repository: ${repository} => ${branch_dir}" 178 einfo " repository: ${repo_uri} => ${branch_dir}"
135 179
136 ${EBZR_FETCH_CMD} ${EBZR_OPTIONS} "${repository}" "${branch_dir}" \ 180 ${EBZR_FETCH_CMD} ${EBZR_OPTIONS} "${repo_uri}" "${branch_dir}" \
137 || die "${EBZR}: can't branch from ${repository}." 181 || die "${EBZR}: can't branch from ${repo_uri}"
138} 182}
139 183
140# @FUNCTION: bzr_update 184# @FUNCTION: bzr_update
185# @USAGE: <repository URI> <branch directory>
141# @DESCRIPTION: 186# @DESCRIPTION:
142# Updates the source code from a repository, via ${EBZR_UPDATE_CMD}. 187# Internal function, updates the source code from a repository, using
188# ${EBZR_UPDATE_CMD}.
143bzr_update() { 189bzr_update() {
144 local repository="${1}"; 190 local repo_uri=$1 branch_dir=$2
145 191
146 if [[ -n "${EBZR_OFFLINE}" ]]; then 192 if [[ -n "${EBZR_OFFLINE}" ]]; then
147 einfo "skipping bzr update -->" 193 einfo "skipping bzr pull -->"
148 einfo " repository: ${repository}" 194 einfo " repository: ${repo_uri}"
149 else 195 else
150 # update branch 196 # update branch
151 einfo "bzr update start -->" 197 einfo "bzr pull start -->"
152 einfo " repository: ${repository}" 198 einfo " repository: ${repo_uri}"
153 199
154 pushd "${EBZR_BRANCH_DIR}" > /dev/null 200 pushd "${branch_dir}" > /dev/null \
201 || die "${EBZR}: can't chdir to ${branch_dir}"
155 ${EBZR_UPDATE_CMD} ${EBZR_OPTIONS} \ 202 ${EBZR_UPDATE_CMD} ${EBZR_OPTIONS} "${repo_uri}" \
156 || die "${EBZR}: can't update from ${repository}." 203 || die "${EBZR}: can't pull from ${repo_uri}"
157 popd > /dev/null 204 popd > /dev/null
158 fi 205 fi
159} 206}
160 207
161# @FUNCTION: bzr_fetch 208# @FUNCTION: bzr_fetch
162# @DESCRIPTION: 209# @DESCRIPTION:
163# Wrapper function to fetch sources from a Bazaar repository via bzr 210# Wrapper function to fetch sources from a Bazaar repository with
164# fetch or bzr update, depending on whether there is an existing 211# bzr branch or bzr pull, depending on whether there is an existing
165# working copy in ${EBZR_BRANCH_DIR}. 212# working copy.
166bzr_fetch() { 213bzr_fetch() {
167 local EBZR_BRANCH_DIR 214 local repo_dir branch_dir
215 local save_sandbox_write=${SANDBOX_WRITE}
168 216
169 # EBZR_REPO_URI is empty.
170 [[ ${EBZR_REPO_URI} ]] || die "${EBZR}: EBZR_REPO_URI is empty." 217 [[ -n ${EBZR_REPO_URI} ]] || die "${EBZR}: EBZR_REPO_URI is empty"
171
172 # check for the protocol or pull from a local repo.
173 if [[ -z ${EBZR_REPO_URI%%:*} ]] ; then
174 case ${EBZR_REPO_URI%%:*} in
175 # lp: seems to be an alias to https://launchpad.net
176 http|https|rsync|lp)
177 ;;
178 sftp)
179 if ! built_with_use --missing true dev-util/bzr sftp; then
180 eerror "To fetch sources from ${EBZR_REPO_URI} you need SFTP"
181 eerror "support in dev-util/bzr."
182 die "Please, rebuild dev-util/bzr with the sftp USE flag enabled."
183 fi
184 ;;
185 *)
186 die "${EBZR}: fetch from ${EBZR_REPO_URI%:*} is not yet implemented."
187 ;;
188 esac
189 fi
190 218
191 if [[ ! -d ${EBZR_STORE_DIR} ]] ; then 219 if [[ ! -d ${EBZR_STORE_DIR} ]] ; then
192 debug-print "${FUNCNAME}: initial branch. Creating bzr directory"
193 local save_sandbox_write=${SANDBOX_WRITE}
194 addwrite / 220 addwrite /
195 mkdir -p "${EBZR_STORE_DIR}" \ 221 mkdir -p "${EBZR_STORE_DIR}" \
196 || die "${EBZR}: can't mkdir ${EBZR_STORE_DIR}." 222 || die "${EBZR}: can't mkdir ${EBZR_STORE_DIR}"
197 SANDBOX_WRITE=${save_sandbox_write} 223 SANDBOX_WRITE=${save_sandbox_write}
198 fi 224 fi
199 225
200 pushd "${EBZR_STORE_DIR}" > /dev/null \ 226 pushd "${EBZR_STORE_DIR}" > /dev/null \
201 || die "${EBZR}: can't chdir to ${EBZR_STORE_DIR}" 227 || die "${EBZR}: can't chdir to ${EBZR_STORE_DIR}"
202 228
203 EBZR_BRANCH_DIR="${EBZR_STORE_DIR}/${EBZR_CACHE_DIR}" 229 repo_dir=${EBZR_STORE_DIR}/${EBZR_PROJECT}
230 branch_dir=${repo_dir}${EBZR_BRANCH:+/${EBZR_BRANCH}}
204 231
205 addwrite "${EBZR_STORE_DIR}" 232 addwrite "${EBZR_STORE_DIR}"
206 addwrite "${EBZR_BRANCH_DIR}"
207 233
208 debug-print "${FUNCNAME}: EBZR_OPTIONS = ${EBZR_OPTIONS}" 234 if [[ ! -d ${branch_dir}/.bzr ]]; then
235 if [[ ${repo_dir} != "${branch_dir}" && ! -d ${repo_dir}/.bzr ]]; then
236 einfo "creating shared bzr repository: ${repo_dir}"
237 ${EBZR_INIT_REPO_CMD} "${repo_dir}" \
238 || die "${EBZR}: can't create shared repository"
239 fi
209 240
210 # Run bzr_initial_fetch() only if the branch has not been pulled 241 if [[ -z ${EBZR_INITIAL_URI} ]]; then
211 # before or if the existing local copy is a full checkout (as did
212 # an older version of bzr.eclass)
213 if [[ ! -d ${EBZR_BRANCH_DIR} ]] ; then
214 bzr_initial_fetch "${EBZR_REPO_URI}" "${EBZR_BRANCH_DIR}" 242 bzr_initial_fetch "${EBZR_REPO_URI}" "${branch_dir}"
215 elif [[ ${EBZR_FETCH_CMD} == *lightweight* \ 243 else
216 && -d ${EBZR_BRANCH_DIR}/.bzr/repository ]]; then 244 # Workaround for faster initial download. This clones the
217 einfo "Re-fetching the branch to save space..." 245 # branch from a fast server (which may be out of date), and
218 rm -rf "${EBZR_BRANCH_DIR}" 246 # subsequently pulls from the slow original repository.
219 bzr_initial_fetch "${EBZR_REPO_URI}" "${EBZR_BRANCH_DIR}" 247 bzr_initial_fetch "${EBZR_INITIAL_URI}" "${branch_dir}"
248 if [[ ${EBZR_REPO_URI} != "${EBZR_INITIAL_URI}" ]]; then
249 EBZR_UPDATE_CMD="${EBZR_UPDATE_CMD} --remember --overwrite" \
250 EBZR_OFFLINE="" \
251 bzr_update "${EBZR_REPO_URI}" "${branch_dir}"
252 fi
253 fi
220 else 254 else
221 bzr_update "${EBZR_REPO_URI}" "${EBZR_BRANCH_DIR}" 255 bzr_update "${EBZR_REPO_URI}" "${branch_dir}"
222 fi 256 fi
223 257
224 cd "${EBZR_BRANCH_DIR}" 258 # Restore sandbox environment
259 SANDBOX_WRITE=${save_sandbox_write}
225 260
226 einfo "exporting ..." 261 cd "${branch_dir}" || die "${EBZR}: can't chdir to ${branch_dir}"
227 262
228 if [[ -z ${EBZR_REVISION} ]]; then 263 # Save revision number in environment. #311101
229 rsync -rlpgo --exclude=".bzr/" . "${WORKDIR}/${P}" \ 264 export EBZR_REVNO=$(${EBZR_REVNO_CMD})
230 || die "${EBZR}: export failed" 265
266 if [[ -n ${EBZR_WORKDIR_CHECKOUT} ]]; then
267 einfo "checking out ..."
268 ${EBZR_CHECKOUT_CMD} ${EBZR_REVISION:+-r ${EBZR_REVISION}} \
269 . "${EBZR_UNPACK_DIR}" || die "${EBZR}: checkout failed"
231 else 270 else
232 # revisions of a lightweight checkout are only available when online 271 einfo "exporting ..."
233 [[ -z ${EBZR_OFFLINE} || -d ${EBZR_BRANCH_DIR}/.bzr/repository ]] \ 272 ${EBZR_EXPORT_CMD} ${EBZR_REVISION:+-r ${EBZR_REVISION}} \
234 || die "${EBZR}: No support for revisions when off-line" 273 "${EBZR_UNPACK_DIR}" . || die "${EBZR}: export failed"
235 ${EBZR_EXPORT_CMD} -r "${EBZR_REVISION}" "${WORKDIR}/${P}" \
236 || die "${EBZR}: export failed"
237 fi 274 fi
275 einfo \
276 "revision ${EBZR_REVISION:-${EBZR_REVNO}} is now in ${EBZR_UNPACK_DIR}"
238 277
239 popd > /dev/null 278 popd > /dev/null
240} 279}
241 280
242# @FUNCTION: bzr_bootstrap 281# @FUNCTION: bzr_bootstrap
243# @DESCRIPTION: 282# @DESCRIPTION:
244# Apply patches in ${EBZR_PATCHES} and run ${EBZR_BOOTSTRAP} if specified. 283# Apply patches in ${EBZR_PATCHES} and run ${EBZR_BOOTSTRAP} if specified.
245bzr_bootstrap() { 284bzr_bootstrap() {
246 local patch lpatch 285 local patch lpatch
247 286
248 pushd "${S}" > /dev/null 287 pushd "${S}" > /dev/null || die "${EBZR}: can't chdir to ${S}"
249 288
250 if [[ -n ${EBZR_PATCHES} ]] ; then 289 if [[ -n ${EBZR_PATCHES} ]] ; then
251 einfo "apply patches -->" 290 einfo "apply patches -->"
252 291
253 for patch in ${EBZR_PATCHES} ; do 292 for patch in ${EBZR_PATCHES} ; do
271 einfo "begin bootstrap -->" 310 einfo "begin bootstrap -->"
272 311
273 if [[ -f ${EBZR_BOOTSTRAP} ]] && [[ -x ${EBZR_BOOTSTRAP} ]] ; then 312 if [[ -f ${EBZR_BOOTSTRAP} ]] && [[ -x ${EBZR_BOOTSTRAP} ]] ; then
274 einfo " bootstrap with a file: ${EBZR_BOOTSTRAP}" 313 einfo " bootstrap with a file: ${EBZR_BOOTSTRAP}"
275 "./${EBZR_BOOTSTRAP}" \ 314 "./${EBZR_BOOTSTRAP}" \
276 || die "${EBZR}: can't execute EBZR_BOOTSTRAP." 315 || die "${EBZR}: can't execute EBZR_BOOTSTRAP"
277 else 316 else
278 einfo " bootstrap with commands: ${EBZR_BOOTSTRAP}" 317 einfo " bootstrap with commands: ${EBZR_BOOTSTRAP}"
279 "${EBZR_BOOTSTRAP}" \ 318 "${EBZR_BOOTSTRAP}" \
280 || die "${EBZR}: can't eval EBZR_BOOTSTRAP." 319 || die "${EBZR}: can't eval EBZR_BOOTSTRAP"
281 fi 320 fi
282 fi 321 fi
283 322
284 popd > /dev/null 323 popd > /dev/null
285} 324}
286 325
287# @FUNCTION: bzr_src_unpack 326# @FUNCTION: bzr_src_unpack
288# @DESCRIPTION: 327# @DESCRIPTION:
289# Default src_unpack(). Includes bzr_fetch() and bootstrap(). 328# Default src_unpack(), calls bzr_fetch. For EAPIs 0 and 1, also calls
329# bzr_src_prepare.
290bzr_src_unpack() { 330bzr_src_unpack() {
291 if ! [ -z ${EBZR_BRANCH} ]; then 331 bzr_fetch
292 # This test will go away on 01 Jul 2010
293 eerror "This ebuild uses EBZR_BRANCH which is not supported anymore"
294 eerror "by the bzr.eclass. Please report this to the ebuild's maintainer."
295 die "EBZR_BRANCH still defined"
296 fi
297 bzr_fetch || die "${EBZR}: unknown problem in bzr_fetch()."
298 case "${EAPI:-0}" in 332 case "${EAPI:-0}" in
299 0|1) bzr_src_prepare ;; 333 0|1) bzr_src_prepare ;;
300 esac 334 esac
301} 335}
302 336
303# @FUNCTION: bzr_src_prepare 337# @FUNCTION: bzr_src_prepare
304# @DESCRIPTION: 338# @DESCRIPTION:
305# Default src_prepare(). Executes bzr_bootstrap() for patch 339# Default src_prepare(), calls bzr_bootstrap.
306# application and Make file generation (if needed).
307bzr_src_prepare() { 340bzr_src_prepare() {
308 bzr_bootstrap || die "${EBZR}: unknown problem in bzr_bootstrap()." 341 bzr_bootstrap
309} 342}

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.20

  ViewVC Help
Powered by ViewVC 1.1.20