From c9147f2d35bc62ce773e05b5aa9b229998c654d2 Mon Sep 17 00:00:00 2001 From: Christian Faulhammer Date: Thu, 24 Sep 2009 07:19:41 +0000 Subject: Add support for ESCM_OFFLINE variable, so users without internet connection can make use of it; patch provided by Jonathan Callen in bug 280211 --- eclass/bzr.eclass | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'eclass') diff --git a/eclass/bzr.eclass b/eclass/bzr.eclass index 1b3e5287aa44..7631cd3247b0 100644 --- a/eclass/bzr.eclass +++ b/eclass/bzr.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/bzr.eclass,v 1.3 2009/08/04 20:18:23 fauli Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/bzr.eclass,v 1.4 2009/09/24 07:19:41 fauli Exp $ # # @ECLASS: bzr.eclass # @MAINTAINER: @@ -114,6 +114,12 @@ EBZR_REVISION="${EBZR_REVISION:-}" # default: ${PN} EBZR_CACHE_DIR="${EBZR_CACHE_DIR:-${PN}}" +# @ECLASS-VARIABLE: EBZR_OFFLINE +# @DESCRIPTION: +# Set this variable to a non-empty value to disable the automatic updating of +# a bzr source tree. This is intended to be set outside the ebuild by users. +EBZR_OFFLINE="${EBZR_OFFLINE:-${ESCM_OFFLINE}}" + # @FUNCTION: bzr_initial_fetch # @DESCRIPTION: # Retrieves the source code from a repository for the first time, via @@ -136,14 +142,19 @@ bzr_initial_fetch() { bzr_update() { local repository="${1}"; - # update branch - einfo "bzr update start -->" - einfo " repository: ${repository}" - - pushd "${EBZR_BRANCH_DIR}" > /dev/null - ${EBZR_UPDATE_CMD} ${EBZR_OPTIONS} \ - || die "${EBZR}: can't update from ${repository}." - popd > /dev/null + if [[ -n "${EBZR_OFFLINE"} ]]; then + einfo "skipping bzr update -->" + einfo " repository: ${repository}" + else + # update branch + einfo "bzr update start -->" + einfo " repository: ${repository}" + + pushd "${EBZR_BRANCH_DIR}" > /dev/null + ${EBZR_UPDATE_CMD} ${EBZR_OPTIONS} \ + || die "${EBZR}: can't update from ${repository}." + popd > /dev/null + fi } -- cgit v1.2.3-65-gdbad