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

Diff of /eclass/git.eclass

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

Revision 1.20 Revision 1.21
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/Attic/git.eclass,v 1.20 2009/04/07 14:39:32 scarabeus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/git.eclass,v 1.21 2009/04/07 15:03:32 scarabeus Exp $
4 4
5# @ECLASS: git.eclass 5# @ECLASS: git.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Tomas Chvatal <scarabeus@gentoo.org> 7# Tomas Chvatal <scarabeus@gentoo.org>
8# Donnie Berkholz <dberkholz@gentoo.org> 8# Donnie Berkholz <dberkholz@gentoo.org>
44EGIT_STORE_DIR="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/git-src" 44EGIT_STORE_DIR="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/git-src"
45 45
46# @ECLASS-VARIABLE: EGIT_FETCH_CMD 46# @ECLASS-VARIABLE: EGIT_FETCH_CMD
47# @DESCRIPTION: 47# @DESCRIPTION:
48# Command for cloning the repository. 48# Command for cloning the repository.
49EGIT_FETCH_CMD="git clone --bare" 49: ${EGIT_FETCH_CMD:="git clone --bare"}
50 50
51# @ECLASS-VARIABLE: EGIT_UPDATE_CMD 51# @ECLASS-VARIABLE: EGIT_UPDATE_CMD
52# @DESCRIPTION: 52# @DESCRIPTION:
53# Git fetch command. 53# Git fetch command.
54EGIT_UPDATE_CMD="git fetch -f -u" 54EGIT_UPDATE_CMD="git fetch -f -u"
142 elogcmd="elog" 142 elogcmd="elog"
143 fi 143 fi
144 144
145 # If we have same branch and the tree we can do --depth 1 clone 145 # If we have same branch and the tree we can do --depth 1 clone
146 # which outputs into really smaller data transfers. 146 # which outputs into really smaller data transfers.
147 # Sadly we can do shallow copy for now because quite few packages need .git 147 # Sadly we can do shallow copy for now because quite a few packages need .git
148 # folder. 148 # folder.
149 #[[ ${EGIT_TREE} = ${EGIT_BRANCH} ]] && \ 149 #[[ ${EGIT_TREE} = ${EGIT_BRANCH} ]] && \
150 # EGIT_FETCH_CMD="${EGIT_FETCH_CMD} --depth 1" 150 # EGIT_FETCH_CMD="${EGIT_FETCH_CMD} --depth 1"
151 151
152 # EGIT_REPO_URI is empty. 152 # EGIT_REPO_URI is empty.
180 EGIT_CLONE_DIR="${EGIT_PROJECT}" 180 EGIT_CLONE_DIR="${EGIT_PROJECT}"
181 181
182 debug-print "${FUNCNAME}: EGIT_OPTIONS = \"${EGIT_OPTIONS}\"" 182 debug-print "${FUNCNAME}: EGIT_OPTIONS = \"${EGIT_OPTIONS}\""
183 183
184 export GIT_DIR="${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" 184 export GIT_DIR="${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}"
185
186 # we also have to remove all shallow copied repositories
187 # and fetch them again
188 if [[ -e "${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}/shallow" ]]; then
189 rm -rf "${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}"
190 einfo "The ${EGIT_CLONE_DIR} was shallow copy. Refetching."
191 fi
185 192
186 if [[ ! -d ${EGIT_CLONE_DIR} ]] ; then 193 if [[ ! -d ${EGIT_CLONE_DIR} ]] ; then
187 # first clone 194 # first clone
188 ${elogcmd} "GIT NEW clone -->" 195 ${elogcmd} "GIT NEW clone -->"
189 ${elogcmd} " repository: ${EGIT_REPO_URI}" 196 ${elogcmd} " repository: ${EGIT_REPO_URI}"
221 ${elogcmd} " updating from commit: ${oldsha1}" 228 ${elogcmd} " updating from commit: ${oldsha1}"
222 ${elogcmd} " to commit: ${cursha1}" 229 ${elogcmd} " to commit: ${cursha1}"
223 else 230 else
224 ${elogcmd} " at the commit: ${cursha1}" 231 ${elogcmd} " at the commit: ${cursha1}"
225 fi 232 fi
226 # piping through cat is needed to avoid a stupid Git feature
227 ${EGIT_DIFFSTAT_CMD} ${oldsha1}..${EGIT_BRANCH} 233 ${EGIT_DIFFSTAT_CMD} ${oldsha1}..${EGIT_BRANCH}
228 fi 234 fi
229 235
230 if ${EGIT_REPACK} || ${EGIT_PRUNE} ; then 236 if ${EGIT_REPACK} || ${EGIT_PRUNE} ; then
231 ebegin "Garbage collecting the repository" 237 ebegin "Garbage collecting the repository"

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

  ViewVC Help
Powered by ViewVC 1.1.20