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

Diff of /eclass/git.eclass

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

Revision 1.12 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.12 2008/06/15 17:47:57 zlin 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>
9# you should currently poke with updates Tomas Chvatal <scarabeus@gentoo.org>
9# 10#
10# The git eclass is written to fetch the software sources from 11# The git eclass is written to fetch the software sources from
11# git repositories like the subversion eclass. 12# git repositories like the subversion eclass.
12# 13#
13# 14#
186 addwrite "${EGIT_STORE_DIR}" 187 addwrite "${EGIT_STORE_DIR}"
187 188
188 [[ -z ${EGIT_REPO_URI##*/} ]] && EGIT_REPO_URI="${EGIT_REPO_URI%/}" 189 [[ -z ${EGIT_REPO_URI##*/} ]] && EGIT_REPO_URI="${EGIT_REPO_URI%/}"
189 EGIT_CLONE_DIR="${EGIT_PROJECT}" 190 EGIT_CLONE_DIR="${EGIT_PROJECT}"
190 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
191 debug-print "${FUNCNAME}: EGIT_OPTIONS = \"${EGIT_OPTIONS}\"" 198 debug-print "${FUNCNAME}: EGIT_OPTIONS = \"${EGIT_OPTIONS}\""
192 199
193 export GIT_DIR="${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" 200 export GIT_DIR="${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}"
194 201
195 if [[ ! -d ${EGIT_CLONE_DIR} ]] ; then 202 if [[ ! -d ${EGIT_CLONE_DIR} ]] ; then
196 # first clone 203 # first clone
197 einfo "git clone start -->" 204 einfo "git clone start -->"
198 einfo " repository: ${EGIT_REPO_URI}" 205 einfo " repository: ${EGIT_REPO_URI}"
199 206
200 ${EGIT_FETCH_CMD} ${EGIT_OPTIONS} "${EGIT_REPO_URI}" ${EGIT_PROJECT} \ 207 ${EGIT_FETCH_CMD} ${EGIT_FETCH_OPTS} ${EGIT_OPTIONS} "${EGIT_REPO_URI}" ${EGIT_PROJECT} \
201 || die "${EGIT}: can't fetch from ${EGIT_REPO_URI}." 208 || die "${EGIT}: can't fetch from ${EGIT_REPO_URI}."
202 209
203 # 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.
204 git config remote.origin.url "${EGIT_REPO_URI}" 211 git config remote.origin.url "${EGIT_REPO_URI}"
205 elif [[ -n ${EGIT_OFFLINE} ]] ; then 212 elif [[ -n ${EGIT_OFFLINE} ]] ; then

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

  ViewVC Help
Powered by ViewVC 1.1.20