diff options
author | 2013-09-05 20:39:41 +0000 | |
---|---|---|
committer | 2013-09-05 20:39:41 +0000 | |
commit | 2ee6a1c5f4755821981e99f09e7c6ad131cb8f6c (patch) | |
tree | 040809688ff2ad6c2be36ca8c4b5bb9348d3b334 | |
parent | Revbump to fix systemd support (thanks Dmitry, bug 483780).Revbump to fix sys... (diff) | |
download | gentoo-2-2ee6a1c5f4755821981e99f09e7c6ad131cb8f6c.tar.gz gentoo-2-2ee6a1c5f4755821981e99f09e7c6ad131cb8f6c.tar.bz2 gentoo-2-2ee6a1c5f4755821981e99f09e7c6ad131cb8f6c.zip |
Support using git-r3 backend in git-2.
-rw-r--r-- | eclass/ChangeLog | 5 | ||||
-rw-r--r-- | eclass/git-2.eclass | 77 |
2 files changed, 69 insertions, 13 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog index e2f5a93b5d68..d9428ef33707 100644 --- a/eclass/ChangeLog +++ b/eclass/ChangeLog @@ -1,6 +1,9 @@ # ChangeLog for eclass directory # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.947 2013/09/05 20:24:10 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.948 2013/09/05 20:39:41 mgorny Exp $ + + 05 Sep 2013; Michał Górny <mgorny@gentoo.org> git-2.eclass: + Support using git-r3 backend in git-2. 05 Sep 2013; Michał Górny <mgorny@gentoo.org> +git-r3.eclass: Introduce the new git eclass. diff --git a/eclass/git-2.eclass b/eclass/git-2.eclass index be6862fbe610..121875033710 100644 --- a/eclass/git-2.eclass +++ b/eclass/git-2.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/git-2.eclass,v 1.30 2013/01/09 17:26:55 axs Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/git-2.eclass,v 1.31 2013/09/05 20:39:41 mgorny Exp $ # @ECLASS: git-2.eclass # @MAINTAINER: @@ -11,6 +11,16 @@ # Eclass for easing maitenance of live ebuilds using git as remote repository. # Eclass support working with git submodules and branching. +# @ECLASS-VARIABLE: EGIT_USE_GIT_R3 +# @DEFAULT_UNSET +# @DESCRIPTION: +# Use git-r3 backend instead of classic git-2 behavior. This is intended +# for early testing of git-r3 and is to be set in make.conf. + +if [[ ${EGIT_USE_GIT_R3} ]]; then + inherit git-r3 +fi + # This eclass support all EAPIs EXPORT_FUNCTIONS src_unpack @@ -572,23 +582,66 @@ git-2_cleanup() { unset EGIT_LOCAL_NONBARE } +git-2_r3_wrapper() { + ewarn "Using git-r3 backend in git-2. Not everything is supported." + ewarn "Expect random failures and have fun testing." + + if [[ ${EGIT_SOURCEDIR} ]]; then + EGIT_CHECKOUT_DIR=${EGIT_SOURCEDIR} + unset EGIT_SOURCEDIR + fi + + if [[ ${EGIT_MASTER} ]]; then + : ${EGIT_BRANCH:=${EGIT_MASTER}} + unset EGIT_MASTER + fi + + if [[ ${EGIT_HAS_SUBMODULES} ]]; then + unset EGIT_HAS_SUBMODULES + fi + + if [[ ${EGIT_PROJECT} ]]; then + unset EGIT_PROJECT + fi + + local boots unp + if [[ ${EGIT_NOUNPACK} ]]; then + unp=1 + unset EGIT_NOUNPACK + fi + + if [[ ${EGIT_BOOTSTRAP} ]]; then + boots=1 + unset EGIT_BOOTSTRAP + fi + + git-r3_src_unpack + + [[ ${boots} ]] && EGIT_BOOTSTRAP=${boots} git-2_bootstrap + [[ ${unp} ]] && EGIT_NOUNPACK=1 +} + # @FUNCTION: git-2_src_unpack # @DESCRIPTION: # Default git src_unpack function. git-2_src_unpack() { debug-print-function ${FUNCNAME} "$@" - git-2_init_variables - git-2_prepare_storedir - git-2_migrate_repository - git-2_fetch "$@" - git-2_gc - git-2_submodules - git-2_move_source - git-2_branch - git-2_bootstrap - git-2_cleanup - echo ">>> Unpacked to ${EGIT_SOURCEDIR}" + if [[ ${EGIT_USE_GIT_R3} ]]; then + git-2_r3_wrapper + else + git-2_init_variables + git-2_prepare_storedir + git-2_migrate_repository + git-2_fetch "$@" + git-2_gc + git-2_submodules + git-2_move_source + git-2_branch + git-2_bootstrap + git-2_cleanup + echo ">>> Unpacked to ${EGIT_SOURCEDIR}" + fi # Users can specify some SRC_URI and we should # unpack the files too. |