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

Diff of /eclass/git.eclass

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

Revision 1.22 Revision 1.23
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.22 2009/04/08 16:46:34 scarabeus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/git.eclass,v 1.23 2009/04/10 19:33:03 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>
110# git eclass can fetch any branch in git_fetch(). 110# git eclass can fetch any branch in git_fetch().
111: ${EGIT_BRANCH:=master} 111: ${EGIT_BRANCH:=master}
112 112
113# @ECLASS-VARIABLE: EGIT_TREE 113# @ECLASS-VARIABLE: EGIT_TREE
114# @DESCRIPTION: 114# @DESCRIPTION:
115# git eclass can checkout any tree. 115# git eclass can checkout any tree (commit).
116: ${EGIT_TREE:=${EGIT_BRANCH}} 116: ${EGIT_TREE:=${EGIT_BRANCH}}
117 117
118# @ECLASS-VARIABLE: EGIT_REPACK 118# @ECLASS-VARIABLE: EGIT_REPACK
119# @DESCRIPTION: 119# @DESCRIPTION:
120# git eclass will repack objects to save disk space. However this can take a 120# git eclass will repack objects to save disk space. However this can take a
241 241
242 [[ ${EGIT_TREE} != ${EGIT_BRANCH} ]] && elog " tree: ${EGIT_TREE}" 242 [[ ${EGIT_TREE} != ${EGIT_BRANCH} ]] && elog " tree: ${EGIT_TREE}"
243 ${elogcmd} " branch: ${EGIT_BRANCH}" 243 ${elogcmd} " branch: ${EGIT_BRANCH}"
244 ${elogcmd} " storage directory: \"${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}\"" 244 ${elogcmd} " storage directory: \"${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}\""
245 245
246 # export to the ${WORKDIR} 246 # unpack to the ${S}
247 mkdir -p "${S}" 247 unset GIT_DIR
248 248 debug-print "git clone -l -s -n \"${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}\" \"${S}\""
249 # git data are used in some packages for various variables definition. So we 249 git clone -l -s -n "${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" "${S}"
250 # copy also .git folder. 250
251 # set correct branch and the tree ebuild specified
251 pushd "${S}" > /dev/null 252 pushd "${S}" > /dev/null
252 git clone --bare ${EGIT_STORE_DIR}/${EGIT_CLONE_DIR} .git 253 local branchname=branch-${EGIT_BRANCH} src=origin/${EGIT_BRANCH}
254 if [[ ${EGIT_TREE} != ${EGIT_BRANCH} ]]; then
255 branchname=tree-${EGIT_TREE}
256 src=${EGIT_TREE}
257 fi
258 debug-print "git checkout -b ${branchname} ${src}"
259 git checkout -b ${branchname} ${src} 2>&1 > /dev/null
253 popd > /dev/null 260 popd > /dev/null
254 261
255 git archive --format=tar ${EGIT_TREE} | ( cd "${S}" ; tar xf - ) 262 unset branchname src
256 263
257 echo ">>> Unpacked to ${S}" 264 echo ">>> Unpacked to ${S}"
258} 265}
259 266
260# @FUNCTION: git_bootstrap 267# @FUNCTION: git_bootstrap

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

  ViewVC Help
Powered by ViewVC 1.1.20