/[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.33 Revision 1.34
1# Copyright 1999-2013 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-2.eclass,v 1.33 2013/10/08 11:19:48 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/git-2.eclass,v 1.34 2014/11/20 15:25:52 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
20# (since we override src_unpack this doesn't hurt)
21_INHERITED_BY_GIT_2=1 \
22inherit git-r3
23 13
24# This eclass support all EAPIs 14# This eclass support all EAPIs
25EXPORT_FUNCTIONS src_unpack 15EXPORT_FUNCTIONS src_unpack
26 16
27DEPEND="dev-vcs/git" 17DEPEND="dev-vcs/git"
580 unset EGIT_UPDATE_CMD 570 unset EGIT_UPDATE_CMD
581 unset UPSTREAM_BRANCH 571 unset UPSTREAM_BRANCH
582 unset EGIT_LOCAL_NONBARE 572 unset EGIT_LOCAL_NONBARE
583} 573}
584 574
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
624# @FUNCTION: git-2_src_unpack 575# @FUNCTION: git-2_src_unpack
625# @DESCRIPTION: 576# @DESCRIPTION:
626# Default git src_unpack function. 577# Default git src_unpack function.
627git-2_src_unpack() { 578git-2_src_unpack() {
628 debug-print-function ${FUNCNAME} "$@" 579 debug-print-function ${FUNCNAME} "$@"
629 580
630 if [[ ${EGIT_USE_GIT_R3} ]]; then
631 git-2_r3_wrapper
632 else
633 git-2_init_variables 581 git-2_init_variables
634 git-2_prepare_storedir 582 git-2_prepare_storedir
635 git-2_migrate_repository 583 git-2_migrate_repository
636 git-2_fetch "$@" 584 git-2_fetch "$@"
637 git-2_gc 585 git-2_gc
638 git-2_submodules 586 git-2_submodules
639 git-2_move_source 587 git-2_move_source
640 git-2_branch 588 git-2_branch
641 git-2_bootstrap 589 git-2_bootstrap
642 git-2_cleanup 590 git-2_cleanup
643 echo ">>> Unpacked to ${EGIT_SOURCEDIR}" 591 echo ">>> Unpacked to ${EGIT_SOURCEDIR}"
644 fi
645 592
646 # Users can specify some SRC_URI and we should 593 # Users can specify some SRC_URI and we should
647 # unpack the files too. 594 # unpack the files too.
648 if [[ ! ${EGIT_NOUNPACK} ]]; then 595 if [[ ! ${EGIT_NOUNPACK} ]]; then
649 if has ${EAPI:-0} 0 1; then 596 if has ${EAPI:-0} 0 1; then

Legend:
Removed from v.1.33  
changed lines
  Added in v.1.34

  ViewVC Help
Powered by ViewVC 1.1.20