diff options
author | Tomas Chvatal <scarabeus@gentoo.org> | 2010-01-13 22:14:59 +0000 |
---|---|---|
committer | Tomas Chvatal <scarabeus@gentoo.org> | 2010-01-13 22:14:59 +0000 |
commit | 1db8111a22a8fc29a7960044bc2ede081181df25 (patch) | |
tree | 434c707bf5bd72253dcc15e12daa36daa0e2c7f3 /eclass | |
parent | Version bump. Remove filter-flags -Wall. (diff) | |
download | gentoo-2-1db8111a22a8fc29a7960044bc2ede081181df25.tar.gz gentoo-2-1db8111a22a8fc29a7960044bc2ede081181df25.tar.bz2 gentoo-2-1db8111a22a8fc29a7960044bc2ede081181df25.zip |
Fix that EGIT_TREE and EGIT_BRANCH again, now it looks all fine, fully tested with x11 repos and mainly mesa.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/git.eclass | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/eclass/git.eclass b/eclass/git.eclass index 17c82b21e760..84c7b943bdb2 100644 --- a/eclass/git.eclass +++ b/eclass/git.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/git.eclass,v 1.35 2010/01/13 20:04:19 scarabeus Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/git.eclass,v 1.36 2010/01/13 22:14:59 scarabeus Exp $ # @ECLASS: git.eclass # @MAINTAINER: @@ -152,6 +152,22 @@ git_sumbodules() { git submodule update } +# @FUNCTION: git_branch +# @DESCRIPTION: +# Internal function that changes branch for the repo based on EGIT_TREE and +# EGIT_BRANCH variables. +git_branch() { + local branchname=branch-${EGIT_BRANCH} src=origin/${EGIT_BRANCH} + if [[ ${EGIT_COMMIT} != ${EGIT_BRANCH} ]]; then + branchname=tree-${EGIT_COMMIT} + src=${EGIT_COMMIT} + fi + debug-print "git checkout -b ${branchname} ${src}" + git checkout -b ${branchname} ${src} &> /dev/null + + unset branchname src +} + # @FUNCTION: git_fetch # @DESCRIPTION: # Gets repository from EGIT_REPO_URI and store it in specified EGIT_STORE_DIR @@ -238,6 +254,7 @@ git_fetch() { cursha1=$(git rev-parse origin/${EGIT_BRANCH}) ${elogcmd} " at the commit: ${cursha1}" + git_branch git_sumbodules popd &> /dev/null elif [[ -n ${EGIT_OFFLINE} ]] ; then @@ -262,6 +279,7 @@ git_fetch() { ${EGIT_UPDATE_CMD} ${EGIT_OPTIONS} \ || die "${EGIT}: can't update from ${EGIT_REPO_URI}." + git_branch git_sumbodules cursha1=$(git rev-parse origin/${EGIT_BRANCH}) @@ -303,22 +321,8 @@ git_fetch() { # unpack to the ${S} popd &> /dev/null - debug-print "git clone -l \"${GIT_DIR}\" \"${S}\"" - git clone -l "${GIT_DIR}" "${S}" - - # set correct branch and the tree ebuild specified - pushd "${S}" > /dev/null - local branchname=branch-${EGIT_BRANCH} src=origin/${EGIT_BRANCH} - if [[ ${EGIT_COMMIT} != ${EGIT_BRANCH} ]]; then - branchname=tree-${EGIT_COMMIT} - src=${EGIT_COMMIT} - fi - debug-print "git checkout -b ${branchname} ${src}" - git checkout -b ${branchname} ${src} 2>&1 > /dev/null - git_sumbodules - popd > /dev/null - - unset branchname src + debug-print "git clone -l -s \"${GIT_DIR}\" \"${S}\"" + git clone -l -s "${GIT_DIR}" "${S}" echo ">>> Unpacked to ${S}" } |