/[gentoo-x86]/eclass/git-r3.eclass
Gentoo

Diff of /eclass/git-r3.eclass

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

Revision 1.29 Revision 1.30
1# Copyright 1999-2014 Gentoo Foundation 1# Copyright 1999-2014 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/git-r3.eclass,v 1.29 2014/03/02 11:46:15 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/git-r3.eclass,v 1.30 2014/03/02 11:46:42 mgorny Exp $
4 4
5# @ECLASS: git-r3.eclass 5# @ECLASS: git-r3.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Michał Górny <mgorny@gentoo.org> 7# Michał Górny <mgorny@gentoo.org>
8# @BLURB: Eclass for fetching and unpacking git repositories. 8# @BLURB: Eclass for fetching and unpacking git repositories.
38# 38#
39# This is intended to be set by user in make.conf. Ebuilds must not set 39# This is intended to be set by user in make.conf. Ebuilds must not set
40# it. 40# it.
41# 41#
42# EGIT3_STORE_DIR=${DISTDIR}/git3-src 42# EGIT3_STORE_DIR=${DISTDIR}/git3-src
43
44# @ECLASS-VARIABLE: EGIT_MIRROR_URI
45# @DEFAULT_UNSET
46# @DESCRIPTION:
47# 'Top' URI to a local git mirror. If specified, the eclass will try
48# to fetch from the local mirror instead of using the remote repository.
49#
50# The mirror needs to follow EGIT3_STORE_DIR structure. The directory
51# created by eclass can be used for that purpose.
52#
53# Example:
54# @CODE
55# EGIT_MIRROR_URI="git://mirror.lan/"
56# @CODE
43 57
44# @ECLASS-VARIABLE: EGIT_REPO_URI 58# @ECLASS-VARIABLE: EGIT_REPO_URI
45# @REQUIRED 59# @REQUIRED
46# @DESCRIPTION: 60# @DESCRIPTION:
47# URIs to the repository, e.g. git://foo, https://foo. If multiple URIs 61# URIs to the repository, e.g. git://foo, https://foo. If multiple URIs
356 [[ ${repos[@]} ]] || die "No URI provided and EGIT_REPO_URI unset" 370 [[ ${repos[@]} ]] || die "No URI provided and EGIT_REPO_URI unset"
357 371
358 local -x GIT_DIR 372 local -x GIT_DIR
359 _git-r3_set_gitdir "${repos[0]}" 373 _git-r3_set_gitdir "${repos[0]}"
360 374
375 # prepend the local mirror if applicable
376 if [[ ${EGIT_MIRROR_URI} ]]; then
377 repos=(
378 "${EGIT_MIRROR_URI%/}/${GIT_DIR##*/}"
379 "${repos[@]}"
380 )
381 fi
382
361 # try to fetch from the remote 383 # try to fetch from the remote
362 local r success 384 local r success
363 for r in "${repos[@]}"; do 385 for r in "${repos[@]}"; do
364 einfo "Fetching ${r} ..." 386 einfo "Fetching ${r} ..."
365 387

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.30

  ViewVC Help
Powered by ViewVC 1.1.20