summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorTomas Chvatal <scarabeus@gentoo.org>2009-04-10 19:33:03 +0000
committerTomas Chvatal <scarabeus@gentoo.org>2009-04-10 19:33:03 +0000
commitc2d53212a9d916a27fb9bae97324b6634381ec4d (patch)
treeff0324f73a0631f76936672e14e54e5ddef851d1 /eclass
parentVersion bump; fixes bug #221385 and bug #231872 (diff)
downloadgentoo-2-c2d53212a9d916a27fb9bae97324b6634381ec4d.tar.gz
gentoo-2-c2d53212a9d916a27fb9bae97324b6634381ec4d.tar.bz2
gentoo-2-c2d53212a9d916a27fb9bae97324b6634381ec4d.zip
Update the unpack to actualy extract correct .git folder. Thanks to robbat2 for help with this.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/git.eclass25
1 files changed, 16 insertions, 9 deletions
diff --git a/eclass/git.eclass b/eclass/git.eclass
index 42b7fae09d3c..5a3a6df21f26 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.22 2009/04/08 16:46:34 scarabeus Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/git.eclass,v 1.23 2009/04/10 19:33:03 scarabeus Exp $
# @ECLASS: git.eclass
# @MAINTAINER:
@@ -112,7 +112,7 @@ EGIT_OFFLINE="${EGIT_OFFLINE:-${ESCM_OFFLINE}}"
# @ECLASS-VARIABLE: EGIT_TREE
# @DESCRIPTION:
-# git eclass can checkout any tree.
+# git eclass can checkout any tree (commit).
: ${EGIT_TREE:=${EGIT_BRANCH}}
# @ECLASS-VARIABLE: EGIT_REPACK
@@ -243,16 +243,23 @@ git_fetch() {
${elogcmd} " branch: ${EGIT_BRANCH}"
${elogcmd} " storage directory: \"${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}\""
- # export to the ${WORKDIR}
- mkdir -p "${S}"
-
- # git data are used in some packages for various variables definition. So we
- # copy also .git folder.
+ # unpack to the ${S}
+ unset GIT_DIR
+ debug-print "git clone -l -s -n \"${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}\" \"${S}\""
+ git clone -l -s -n "${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" "${S}"
+
+ # set correct branch and the tree ebuild specified
pushd "${S}" > /dev/null
- git clone --bare ${EGIT_STORE_DIR}/${EGIT_CLONE_DIR} .git
+ local branchname=branch-${EGIT_BRANCH} src=origin/${EGIT_BRANCH}
+ if [[ ${EGIT_TREE} != ${EGIT_BRANCH} ]]; then
+ branchname=tree-${EGIT_TREE}
+ src=${EGIT_TREE}
+ fi
+ debug-print "git checkout -b ${branchname} ${src}"
+ git checkout -b ${branchname} ${src} 2>&1 > /dev/null
popd > /dev/null
- git archive --format=tar ${EGIT_TREE} | ( cd "${S}" ; tar xf - )
+ unset branchname src
echo ">>> Unpacked to ${S}"
}