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

Diff of /eclass/git-2.eclass

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

Revision 1.30 Revision 1.31
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2013 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-2.eclass,v 1.30 2013/01/09 17:26:55 axs Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/git-2.eclass,v 1.31 2013/09/05 20:39:41 mgorny Exp $
4 4
5# @ECLASS: git-2.eclass 5# @ECLASS: git-2.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Michał Górny <mgorny@gentoo.org> 7# Michał Górny <mgorny@gentoo.org>
8# Donnie Berkholz <dberkholz@gentoo.org> 8# Donnie Berkholz <dberkholz@gentoo.org>
9# @BLURB: Eclass for fetching and unpacking git repositories. 9# @BLURB: Eclass for fetching and unpacking git repositories.
10# @DESCRIPTION: 10# @DESCRIPTION:
11# Eclass for easing maitenance of live ebuilds using git as remote repository. 11# Eclass for easing maitenance of live ebuilds using git as remote repository.
12# Eclass support working with git submodules and branching. 12# Eclass support working with git submodules and branching.
13
14# @ECLASS-VARIABLE: EGIT_USE_GIT_R3
15# @DEFAULT_UNSET
16# @DESCRIPTION:
17# Use git-r3 backend instead of classic git-2 behavior. This is intended
18# for early testing of git-r3 and is to be set in make.conf.
19
20if [[ ${EGIT_USE_GIT_R3} ]]; then
21 inherit git-r3
22fi
13 23
14# This eclass support all EAPIs 24# This eclass support all EAPIs
15EXPORT_FUNCTIONS src_unpack 25EXPORT_FUNCTIONS src_unpack
16 26
17DEPEND="dev-vcs/git" 27DEPEND="dev-vcs/git"
570 unset EGIT_UPDATE_CMD 580 unset EGIT_UPDATE_CMD
571 unset UPSTREAM_BRANCH 581 unset UPSTREAM_BRANCH
572 unset EGIT_LOCAL_NONBARE 582 unset EGIT_LOCAL_NONBARE
573} 583}
574 584
585git-2_r3_wrapper() {
586 ewarn "Using git-r3 backend in git-2. Not everything is supported."
587 ewarn "Expect random failures and have fun testing."
588
589 if [[ ${EGIT_SOURCEDIR} ]]; then
590 EGIT_CHECKOUT_DIR=${EGIT_SOURCEDIR}
591 unset EGIT_SOURCEDIR
592 fi
593
594 if [[ ${EGIT_MASTER} ]]; then
595 : ${EGIT_BRANCH:=${EGIT_MASTER}}
596 unset EGIT_MASTER
597 fi
598
599 if [[ ${EGIT_HAS_SUBMODULES} ]]; then
600 unset EGIT_HAS_SUBMODULES
601 fi
602
603 if [[ ${EGIT_PROJECT} ]]; then
604 unset EGIT_PROJECT
605 fi
606
607 local boots unp
608 if [[ ${EGIT_NOUNPACK} ]]; then
609 unp=1
610 unset EGIT_NOUNPACK
611 fi
612
613 if [[ ${EGIT_BOOTSTRAP} ]]; then
614 boots=1
615 unset EGIT_BOOTSTRAP
616 fi
617
618 git-r3_src_unpack
619
620 [[ ${boots} ]] && EGIT_BOOTSTRAP=${boots} git-2_bootstrap
621 [[ ${unp} ]] && EGIT_NOUNPACK=1
622}
623
575# @FUNCTION: git-2_src_unpack 624# @FUNCTION: git-2_src_unpack
576# @DESCRIPTION: 625# @DESCRIPTION:
577# Default git src_unpack function. 626# Default git src_unpack function.
578git-2_src_unpack() { 627git-2_src_unpack() {
579 debug-print-function ${FUNCNAME} "$@" 628 debug-print-function ${FUNCNAME} "$@"
580 629
630 if [[ ${EGIT_USE_GIT_R3} ]]; then
631 git-2_r3_wrapper
632 else
581 git-2_init_variables 633 git-2_init_variables
582 git-2_prepare_storedir 634 git-2_prepare_storedir
583 git-2_migrate_repository 635 git-2_migrate_repository
584 git-2_fetch "$@" 636 git-2_fetch "$@"
585 git-2_gc 637 git-2_gc
586 git-2_submodules 638 git-2_submodules
587 git-2_move_source 639 git-2_move_source
588 git-2_branch 640 git-2_branch
589 git-2_bootstrap 641 git-2_bootstrap
590 git-2_cleanup 642 git-2_cleanup
591 echo ">>> Unpacked to ${EGIT_SOURCEDIR}" 643 echo ">>> Unpacked to ${EGIT_SOURCEDIR}"
644 fi
592 645
593 # Users can specify some SRC_URI and we should 646 # Users can specify some SRC_URI and we should
594 # unpack the files too. 647 # unpack the files too.
595 if [[ ! ${EGIT_NOUNPACK} ]]; then 648 if [[ ! ${EGIT_NOUNPACK} ]]; then
596 if has ${EAPI:-0} 0 1; then 649 if has ${EAPI:-0} 0 1; then

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.31

  ViewVC Help
Powered by ViewVC 1.1.20