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

Diff of /eclass/git-r3.eclass

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

Revision 1.25 Revision 1.27
1# Copyright 1999-2014 Gentoo Foundation 1# Copyright 1999-2014 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/git-r3.eclass,v 1.25 2014/02/24 08:43:34 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/git-r3.eclass,v 1.27 2014/03/02 11:44:19 mgorny Exp $
4 4
5# @ECLASS: git-r3.eclass 5# @ECLASS: git-r3.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Michał Górny <mgorny@gentoo.org> 7# Michał Górny <mgorny@gentoo.org>
8# @BLURB: Eclass for fetching and unpacking git repositories. 8# @BLURB: Eclass for fetching and unpacking git repositories.
33fi 33fi
34 34
35# @ECLASS-VARIABLE: EGIT3_STORE_DIR 35# @ECLASS-VARIABLE: EGIT3_STORE_DIR
36# @DESCRIPTION: 36# @DESCRIPTION:
37# Storage directory for git sources. 37# Storage directory for git sources.
38#
39# This is intended to be set by user in make.conf. Ebuilds must not set
40# it.
38# 41#
39# EGIT3_STORE_DIR=${DISTDIR}/git3-src 42# EGIT3_STORE_DIR=${DISTDIR}/git3-src
40 43
41# @ECLASS-VARIABLE: EGIT_REPO_URI 44# @ECLASS-VARIABLE: EGIT_REPO_URI
42# @REQUIRED 45# @REQUIRED
442 ) 445 )
443 local new_commit_id=$( 446 local new_commit_id=$(
444 git rev-parse --verify refs/git-r3/"${local_id}"/__main__ 447 git rev-parse --verify refs/git-r3/"${local_id}"/__main__
445 ) 448 )
446 449
447 set -- git clone --quiet --shared --no-checkout "${GIT_DIR}" "${out_dir}"/
448 echo "${@}" >&2
449 "${@}" || die "git clone (for checkout) failed"
450
451 git-r3_sub_checkout() { 450 git-r3_sub_checkout() {
452 local orig_repo=${GIT_DIR} 451 local orig_repo=${GIT_DIR}
453 local -x GIT_DIR=${out_dir}/.git 452 local -x GIT_DIR=${out_dir}/.git
454 local -x GIT_WORK_TREE=${out_dir} 453 local -x GIT_WORK_TREE=${out_dir}
455 454
456 # pull notes 455 mkdir -p "${out_dir}" || die
457 git fetch "${orig_repo}" "refs/notes/*:refs/notes/*" || die 456
457 # use git init+fetch instead of clone since the latter doesn't like
458 # non-empty directories.
459
460 git init --quiet || die
461 set -- git fetch --update-head-ok "${orig_repo}" \
462 "refs/heads/*:refs/heads/*" \
463 "refs/tags/*:refs/tags/*" \
464 "refs/notes/*:refs/notes/*"
465
466 echo "${@}" >&2
467 "${@}" || die "git fetch into checkout dir failed"
458 468
459 set -- git checkout --quiet 469 set -- git checkout --quiet
460 if [[ ${remote_ref} ]]; then 470 if [[ ${remote_ref} ]]; then
461 set -- "${@}" "${remote_ref#refs/heads/}" 471 set -- "${@}" "${remote_ref#refs/heads/}"
462 else 472 else

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.27

  ViewVC Help
Powered by ViewVC 1.1.20