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

Diff of /eclass/bzr.eclass

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

Revision 1.11 Revision 1.15
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2011 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.11 2011/02/10 20:08:59 ulm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/bzr.eclass,v 1.15 2011/07/26 23:22:35 ulm Exp $
4# 4#
5# @ECLASS: bzr.eclass 5# @ECLASS: bzr.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org>, 7# Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org>,
8# Ulrich Müller <ulm@gentoo.org>, 8# Ulrich Müller <ulm@gentoo.org>,
48: ${EBZR_INIT_REPO_CMD:="bzr init-repository --no-trees"} 48: ${EBZR_INIT_REPO_CMD:="bzr init-repository --no-trees"}
49 49
50# @ECLASS-VARIABLE: EBZR_FETCH_CMD 50# @ECLASS-VARIABLE: EBZR_FETCH_CMD
51# @DESCRIPTION: 51# @DESCRIPTION:
52# The Bazaar command to fetch the sources. 52# The Bazaar command to fetch the sources.
53: ${EBZR_FETCH_CMD="bzr branch --no-tree"} 53: ${EBZR_FETCH_CMD:="bzr branch --no-tree"}
54 54
55# @ECLASS-VARIABLE: EBZR_UPDATE_CMD 55# @ECLASS-VARIABLE: EBZR_UPDATE_CMD
56# @DESCRIPTION: 56# @DESCRIPTION:
57# The Bazaar command to update the sources. 57# The Bazaar command to update the sources.
58: ${EBZR_UPDATE_CMD:="bzr pull"} 58: ${EBZR_UPDATE_CMD:="bzr pull"}
80# 80#
81# Note: If the ebuild uses an sftp:// URI, then in EAPI 0 or 1 it must 81# Note: If the ebuild uses an sftp:// URI, then in EAPI 0 or 1 it must
82# make sure that dev-vcs/bzr was built with USE="sftp". In EAPI 2 or 82# make sure that dev-vcs/bzr was built with USE="sftp". In EAPI 2 or
83# later, the eclass will depend on dev-vcs/bzr[sftp]. 83# later, the eclass will depend on dev-vcs/bzr[sftp].
84 84
85# @ECLASS-VARIABLE: EBZR_MIRROR_URI 85# @ECLASS-VARIABLE: EBZR_INITIAL_URI
86# @DEFAULT_UNSET 86# @DEFAULT_UNSET
87# @DESCRIPTION: 87# @DESCRIPTION:
88# The URI of a fast mirror of the source repository. If this variable 88# The URI used for initial branching of the source repository. If this
89# is set, the initial branch will be cloned from the mirror, followed 89# variable is set, the initial branch will be cloned from the location
90# by a pull from the original repository. This is intended for special 90# specified, followed by a pull from ${EBZR_REPO_URI}. This is intended
91# cases, where download from the original repository is slow, but a fast 91# for special cases, e.g. when download from the original repository is
92# mirror exists but may be out of date. 92# slow, but a fast mirror exists but may be out of date.
93# 93#
94# Normally, this variable needs not be set. 94# Normally, this variable needs not be set.
95 95
96# @ECLASS-VARIABLE: EBZR_BOOTSTRAP 96# @ECLASS-VARIABLE: EBZR_BOOTSTRAP
97# @DEFAULT_UNSET 97# @DEFAULT_UNSET
142# @ECLASS-VARIABLE: EBZR_OFFLINE 142# @ECLASS-VARIABLE: EBZR_OFFLINE
143# @DESCRIPTION: 143# @DESCRIPTION:
144# Set this variable to a non-empty value to disable automatic updating 144# Set this variable to a non-empty value to disable automatic updating
145# of a bzr source tree. This is intended to be set outside the ebuild 145# of a bzr source tree. This is intended to be set outside the ebuild
146# by users. 146# by users.
147: ${EBZR_OFFLINE:=${ESCM_OFFLINE}} 147: ${EBZR_OFFLINE=${EVCS_OFFLINE}}
148 148
149# @FUNCTION: bzr_initial_fetch 149# @FUNCTION: bzr_initial_fetch
150# @USAGE: <repository URI> <branch directory> 150# @USAGE: <repository URI> <branch directory>
151# @DESCRIPTION: 151# @DESCRIPTION:
152# Internal function, retrieves the source code from a repository for the 152# Internal function, retrieves the source code from a repository for the
234 einfo "creating shared bzr repository" 234 einfo "creating shared bzr repository"
235 ${EBZR_INIT_REPO_CMD} "${repo_dir}" \ 235 ${EBZR_INIT_REPO_CMD} "${repo_dir}" \
236 || die "${EBZR}: can't create shared repository" 236 || die "${EBZR}: can't create shared repository"
237 fi 237 fi
238 238
239 if [[ -z ${EBZR_MIRROR_URI} ]]; then 239 if [[ -z ${EBZR_INITIAL_URI} ]]; then
240 bzr_initial_fetch "${EBZR_REPO_URI}" "${branch_dir}" 240 bzr_initial_fetch "${EBZR_REPO_URI}" "${branch_dir}"
241 else 241 else
242 # Workaround for faster initial download. This clones the 242 # Workaround for faster initial download. This clones the
243 # branch from a fast mirror (which may be out of date), and 243 # branch from a fast server (which may be out of date), and
244 # subsequently pulls from the slow original repository. 244 # subsequently pulls from the slow original repository.
245 bzr_initial_fetch "${EBZR_MIRROR_URI}" "${branch_dir}" 245 bzr_initial_fetch "${EBZR_INITIAL_URI}" "${branch_dir}"
246 if [[ ${EBZR_REPO_URI} != "${EBZR_INITIAL_URI}" ]]; then
246 EBZR_UPDATE_CMD="${EBZR_UPDATE_CMD} --remember --overwrite" \ 247 EBZR_UPDATE_CMD="${EBZR_UPDATE_CMD} --remember --overwrite" \
248 EBZR_OFFLINE="" \
247 EBZR_OFFLINE="" bzr_update "${EBZR_REPO_URI}" "${branch_dir}" 249 bzr_update "${EBZR_REPO_URI}" "${branch_dir}"
250 fi
248 fi 251 fi
249 else 252 else
250 bzr_update "${EBZR_REPO_URI}" "${branch_dir}" 253 bzr_update "${EBZR_REPO_URI}" "${branch_dir}"
251 fi 254 fi
252 255
253 cd "${branch_dir}" || die "${EBZR}: can't chdir to ${branch_dir}" 256 cd "${branch_dir}" || die "${EBZR}: can't chdir to ${branch_dir}"
254 257
255 # Save some variables in environment. #311101 258 # Save revision number in environment. #311101
256 export EBZR_REVNO=$(${EBZR_REVNO_CMD}) 259 export EBZR_REVNO=$(${EBZR_REVNO_CMD})
257 export EBZR_WC_PATH=${branch_dir}
258 260
259 einfo "exporting ..." 261 einfo "exporting ..."
260 ${EBZR_EXPORT_CMD} ${EBZR_REVISION:+-r ${EBZR_REVISION}} \ 262 ${EBZR_EXPORT_CMD} ${EBZR_REVISION:+-r ${EBZR_REVISION}} \
261 "${WORKDIR}/${P}" . || die "${EBZR}: export failed" 263 "${WORKDIR}/${P}" . || die "${EBZR}: export failed"
262 einfo "revision ${EBZR_REVISION:-${EBZR_REVNO}} is now in ${WORKDIR}/${P}" 264 einfo "revision ${EBZR_REVISION:-${EBZR_REVNO}} is now in ${WORKDIR}/${P}"

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.15

  ViewVC Help
Powered by ViewVC 1.1.20