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

Diff of /eclass/git.eclass

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

Revision 1.5 Revision 1.7
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.5 2007/04/10 11:42:29 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/git.eclass,v 1.7 2007/11/14 20:43:43 ferdy 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>
27DESCRIPTION="Based on the ${ECLASS} eclass" 27DESCRIPTION="Based on the ${ECLASS} eclass"
28 28
29 29
30## -- add git in DEPEND 30## -- add git in DEPEND
31# 31#
32DEPEND=">=dev-util/git-1.4.0" 32DEPEND=">=dev-util/git-1.5"
33 33
34 34
35## -- EGIT_STORE_DIR: git sources store directory 35## -- EGIT_STORE_DIR: git sources store directory
36# 36#
37EGIT_STORE_DIR="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/git-src" 37EGIT_STORE_DIR="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/git-src"
193 193
194 ${EGIT_FETCH_CMD} ${EGIT_OPTIONS} "${EGIT_REPO_URI}" ${EGIT_PROJECT} \ 194 ${EGIT_FETCH_CMD} ${EGIT_OPTIONS} "${EGIT_REPO_URI}" ${EGIT_PROJECT} \
195 || die "${EGIT}: can't fetch from ${EGIT_REPO_URI}." 195 || die "${EGIT}: can't fetch from ${EGIT_REPO_URI}."
196 196
197 # We use --bare cloning, so git doesn't do this for us. 197 # We use --bare cloning, so git doesn't do this for us.
198 git repo-config remote.origin.url "${EGIT_REPO_URI}" 198 git config remote.origin.url "${EGIT_REPO_URI}"
199 else 199 else
200 # Git urls might change, so unconditionally set it here
201 git config remote.origin.url "${EGIT_REPO_URI}"
202
200 # fetch updates 203 # fetch updates
201 einfo "git update start -->" 204 einfo "git update start -->"
202 einfo " repository: ${EGIT_REPO_URI}" 205 einfo " repository: ${EGIT_REPO_URI}"
203 206
204 local oldsha1=$(git rev-parse ${EGIT_BRANCH}) 207 local oldsha1=$(git rev-parse ${EGIT_BRANCH})
210 ${EGIT_DIFFSTAT_CMD} ${oldsha1}..${EGIT_BRANCH} | cat 213 ${EGIT_DIFFSTAT_CMD} ${oldsha1}..${EGIT_BRANCH} | cat
211 fi 214 fi
212 215
213 einfo " local clone: ${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" 216 einfo " local clone: ${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}"
214 217
215 if ${EGIT_REPACK} ; then 218 if ${EGIT_REPACK} || ${EGIT_PRUNE} ; then
216 ebegin "Repacking objects" 219 ebegin "Garbage collecting the repository"
217 # Strangely enough mv asks confirmation 220 git gc $(${EGIT_PRUNE} && echo '--prune')
218 yes y | git repack -a -d -f -q > /dev/null
219 eend $?
220 fi
221
222 if ${EGIT_PRUNE} ; then
223 ebegin "Removing unreachable objects"
224 git prune
225 eend $? 221 eend $?
226 fi 222 fi
227 223
228 einfo " committish: ${EGIT_TREE}" 224 einfo " committish: ${EGIT_TREE}"
229 225
230 # export to the ${WORKDIR} 226 # export to the ${WORKDIR}
231 mkdir -p "${S}" 227 mkdir -p "${S}"
232 git tar-tree ${EGIT_TREE} | ( cd "${S}" ; tar xf - ) 228 git archive --format=tar ${EGIT_TREE} | ( cd "${S}" ; tar xf - )
233 229
234 echo ">>> Unpacked to ${S}" 230 echo ">>> Unpacked to ${S}"
235 231
236} 232}
237 233

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.20