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

Diff of /eclass/git.eclass

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

Revision 1.15 Revision 1.16
1# Copyright 1999-2006 Gentoo Foundation 1# Copyright 1999-2006 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/Attic/git.eclass,v 1.15 2009/02/19 17:07:28 scarabeus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/git.eclass,v 1.16 2009/03/19 11:51:13 scarabeus Exp $
4 4
5## --------------------------------------------------------------------------- # 5## --------------------------------------------------------------------------- #
6# subversion.eclass author: Akinori Hattori <hattya@gentoo.org> 6# subversion.eclass author: Akinori Hattori <hattya@gentoo.org>
7# modified for git by Donnie Berkholz <spyderous@gentoo.org> 7# modified for git by Donnie Berkholz <spyderous@gentoo.org>
8# improved by Fernando J. Pereda <ferdy@gentoo.org> 8# improved by Fernando J. Pereda <ferdy@gentoo.org>
38EGIT_STORE_DIR="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/git-src" 38EGIT_STORE_DIR="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/git-src"
39 39
40 40
41## -- EGIT_FETCH_CMD: git clone command 41## -- EGIT_FETCH_CMD: git clone command
42# 42#
43EGIT_FETCH_CMD="git clone --bare --depth 1" 43EGIT_FETCH_CMD="git clone --bare"
44 44
45## -- EGIT_UPDATE_CMD: git fetch command 45## -- EGIT_UPDATE_CMD: git fetch command
46# 46#
47EGIT_UPDATE_CMD="git fetch -f -u" 47EGIT_UPDATE_CMD="git fetch -f -u"
48 48
187 addwrite "${EGIT_STORE_DIR}" 187 addwrite "${EGIT_STORE_DIR}"
188 188
189 [[ -z ${EGIT_REPO_URI##*/} ]] && EGIT_REPO_URI="${EGIT_REPO_URI%/}" 189 [[ -z ${EGIT_REPO_URI##*/} ]] && EGIT_REPO_URI="${EGIT_REPO_URI%/}"
190 EGIT_CLONE_DIR="${EGIT_PROJECT}" 190 EGIT_CLONE_DIR="${EGIT_PROJECT}"
191 191
192 # determine whether to perform shallow clone
193 local EGIT_FETCH_OPTS
194 if [[ ${EGIT_BRANCH} = ${EGIT_TREE} ]] && [[ ${EGIT_BRANCH} = master ]] ; then
195 EGIT_FETCH_OPTS="--depth 1"
196 fi
197
192 debug-print "${FUNCNAME}: EGIT_OPTIONS = \"${EGIT_OPTIONS}\"" 198 debug-print "${FUNCNAME}: EGIT_OPTIONS = \"${EGIT_OPTIONS}\""
193 199
194 export GIT_DIR="${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" 200 export GIT_DIR="${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}"
195 201
196 if [[ ! -d ${EGIT_CLONE_DIR} ]] ; then 202 if [[ ! -d ${EGIT_CLONE_DIR} ]] ; then
197 # first clone 203 # first clone
198 einfo "git clone start -->" 204 einfo "git clone start -->"
199 einfo " repository: ${EGIT_REPO_URI}" 205 einfo " repository: ${EGIT_REPO_URI}"
200 206
201 ${EGIT_FETCH_CMD} ${EGIT_OPTIONS} "${EGIT_REPO_URI}" ${EGIT_PROJECT} \ 207 ${EGIT_FETCH_CMD} ${EGIT_FETCH_OPTS} ${EGIT_OPTIONS} "${EGIT_REPO_URI}" ${EGIT_PROJECT} \
202 || die "${EGIT}: can't fetch from ${EGIT_REPO_URI}." 208 || die "${EGIT}: can't fetch from ${EGIT_REPO_URI}."
203 209
204 # We use --bare cloning, so git doesn't do this for us. 210 # We use --bare cloning, so git doesn't do this for us.
205 git config remote.origin.url "${EGIT_REPO_URI}" 211 git config remote.origin.url "${EGIT_REPO_URI}"
206 elif [[ -n ${EGIT_OFFLINE} ]] ; then 212 elif [[ -n ${EGIT_OFFLINE} ]] ; then

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

  ViewVC Help
Powered by ViewVC 1.1.20