| 1 | # Copyright 1999-2009 Gentoo Foundation |
1 | # Copyright 1999-2009 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.9 2010/07/01 09:23:37 fauli 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 Mueller <ulm@gentoo.org>, |
8 | # Ulrich Mueller <ulm@gentoo.org>, |
| … | |
… | |
| 28 | esac |
28 | esac |
| 29 | |
29 | |
| 30 | HOMEPAGE="http://bazaar-vcs.org/" |
30 | HOMEPAGE="http://bazaar-vcs.org/" |
| 31 | DESCRIPTION="Based on the ${EBZR} eclass" |
31 | DESCRIPTION="Based on the ${EBZR} eclass" |
| 32 | |
32 | |
| 33 | DEPEND=">=dev-util/bzr-1.5" |
33 | DEPEND=">=dev-vcs/bzr-1.5" |
| 34 | |
34 | |
| 35 | # @ECLASS-VARIABLE: EBZR_STORE_DIR |
35 | # @ECLASS-VARIABLE: EBZR_STORE_DIR |
| 36 | # @DESCRIPTION: |
36 | # @DESCRIPTION: |
| 37 | # The directory to store all fetched Bazaar live sources. |
37 | # The directory to store all fetched Bazaar live sources. |
| 38 | : ${EBZR_STORE_DIR:=${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/bzr-src} |
38 | : ${EBZR_STORE_DIR:=${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/bzr-src} |
| … | |
… | |
| 174 | case ${EBZR_REPO_URI%%:*} in |
174 | case ${EBZR_REPO_URI%%:*} in |
| 175 | # lp: seems to be an alias to https://launchpad.net |
175 | # lp: seems to be an alias to https://launchpad.net |
| 176 | http|https|rsync|lp) |
176 | http|https|rsync|lp) |
| 177 | ;; |
177 | ;; |
| 178 | sftp) |
178 | sftp) |
| 179 | if ! built_with_use --missing true dev-util/bzr sftp; then |
179 | if ! built_with_use --missing true dev-vcs/bzr sftp; then |
| 180 | eerror "To fetch sources from ${EBZR_REPO_URI} you need SFTP" |
180 | eerror "To fetch sources from ${EBZR_REPO_URI} you need SFTP" |
| 181 | eerror "support in dev-util/bzr." |
181 | eerror "support in dev-vcs/bzr." |
| 182 | die "Please, rebuild dev-util/bzr with the sftp USE flag enabled." |
182 | die "Please, rebuild dev-vcs/bzr with the sftp USE flag enabled." |
| 183 | fi |
183 | fi |
| 184 | ;; |
184 | ;; |
| 185 | *) |
185 | *) |
| 186 | die "${EBZR}: fetch from ${EBZR_REPO_URI%:*} is not yet implemented." |
186 | die "${EBZR}: fetch from ${EBZR_REPO_URI%:*} is not yet implemented." |
| 187 | ;; |
187 | ;; |
| … | |
… | |
| 209 | |
209 | |
| 210 | # Run bzr_initial_fetch() only if the branch has not been pulled |
210 | # Run bzr_initial_fetch() only if the branch has not been pulled |
| 211 | # before or if the existing local copy is a full checkout (as did |
211 | # before or if the existing local copy is a full checkout (as did |
| 212 | # an older version of bzr.eclass) |
212 | # an older version of bzr.eclass) |
| 213 | if [[ ! -d ${EBZR_BRANCH_DIR} ]] ; then |
213 | if [[ ! -d ${EBZR_BRANCH_DIR} ]] ; then |
| 214 | bzr_initial_fetch "${EBZR_REPO_URI}" "${EBZR_BRANCH_DIR}" |
|
|
| 215 | elif [[ ${EBZR_FETCH_CMD} == *lightweight* \ |
|
|
| 216 | && -d ${EBZR_BRANCH_DIR}/.bzr/repository ]]; then |
|
|
| 217 | einfo "Re-fetching the branch to save space..." |
|
|
| 218 | rm -rf "${EBZR_BRANCH_DIR}" |
|
|
| 219 | bzr_initial_fetch "${EBZR_REPO_URI}" "${EBZR_BRANCH_DIR}" |
214 | bzr_initial_fetch "${EBZR_REPO_URI}" "${EBZR_BRANCH_DIR}" |
| 220 | else |
215 | else |
| 221 | bzr_update "${EBZR_REPO_URI}" "${EBZR_BRANCH_DIR}" |
216 | bzr_update "${EBZR_REPO_URI}" "${EBZR_BRANCH_DIR}" |
| 222 | fi |
217 | fi |
| 223 | |
218 | |