summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2014-04-17 20:28:37 +0000
committerMichał Górny <mgorny@gentoo.org>2014-04-17 20:28:37 +0000
commit2954418165e61346eabc40a4401c910e92532b87 (patch)
tree0820b18518f0b417e7190cdc8765970c340edbae /eclass
parentQt multibuild by Uwe L. Korn <uwelk@xhochy.com>. Remove old. (diff)
downloadhistorical-2954418165e61346eabc40a4401c910e92532b87.tar.gz
historical-2954418165e61346eabc40a4401c910e92532b87.tar.bz2
historical-2954418165e61346eabc40a4401c910e92532b87.zip
Automatically switch to EGIT_CLONE_TYPE=single+tags for Google Code.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ChangeLog5
-rw-r--r--eclass/git-r3.eclass33
2 files changed, 29 insertions, 9 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index 76d6cba0764a..82276f2123d9 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for eclass directory
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1211 2014/04/17 18:16:54 kensington Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1212 2014/04/17 20:28:37 mgorny Exp $
+
+ 17 Apr 2014; Michał Górny <mgorny@gentoo.org> git-r3.eclass:
+ Automatically switch to EGIT_CLONE_TYPE=single+tags for Google Code.
17 Apr 2014; Michael Palimaka <kensington@gentoo.org> kde4-meta.eclass:
Sync with overlay. Remove unused inherit. Switch to git-r3 eclass. Fix file
diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass
index 4c18baca7ec7..1154721c1324 100644
--- a/eclass/git-r3.eclass
+++ b/eclass/git-r3.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/git-r3.eclass,v 1.40 2014/03/24 21:32:31 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/git-r3.eclass,v 1.41 2014/04/17 20:28:37 mgorny Exp $
# @ECLASS: git-r3.eclass
# @MAINTAINER:
@@ -468,8 +468,25 @@ git-r3_fetch() {
einfo "Fetching ${r} ..."
local fetch_command=( git fetch "${r}" )
+ local clone_type=${EGIT_CLONE_TYPE}
+
+ if [[ ${r} == https://code.google.com/* ]]; then
+ # Google Code has special magic on top of git that:
+ # 1) can't handle shallow clones at all,
+ # 2) fetches duplicately when tags are pulled in with branch
+ # so automatically switch to single+tags mode.
+ if [[ ${clone_type} == shallow ]]; then
+ einfo " Google Code does not support shallow clones"
+ einfo " using EGIT_CLONE_TYPE=single+tags"
+ clone_type=single+tags
+ elif [[ ${clone_type} == single ]]; then
+ einfo " git-r3: Google Code does not send tags properly in 'single' mode"
+ einfo " using EGIT_CLONE_TYPE=single+tags"
+ clone_type=single+tags
+ fi
+ fi
- if [[ ${EGIT_CLONE_TYPE} == mirror ]]; then
+ if [[ ${clone_type} == mirror ]]; then
fetch_command+=(
--prune
# mirror the remote branches as local branches
@@ -510,8 +527,8 @@ git-r3_fetch() {
fi
# fetching by commit in shallow mode? can't do.
- if [[ ${EGIT_CLONE_TYPE} == shallow ]]; then
- local EGIT_CLONE_TYPE=single
+ if [[ ${clone_type} == shallow ]]; then
+ clone_type=single
fi
fi
fi
@@ -526,7 +543,7 @@ git-r3_fetch() {
"+${fetch_l}:${fetch_r}"
)
- if [[ ${EGIT_CLONE_TYPE} == single+tags ]]; then
+ if [[ ${clone_type} == single+tags ]]; then
fetch_command+=(
# pull tags explicitly as requested
"+refs/tags/*:refs/tags/*"
@@ -534,11 +551,11 @@ git-r3_fetch() {
fi
fi
- if [[ ${EGIT_CLONE_TYPE} == shallow ]]; then
+ if [[ ${clone_type} == shallow ]]; then
if _git-r3_is_local_repo; then
# '--depth 1' causes sandbox violations with local repos
# bug #491260
- local EGIT_CLONE_TYPE=single
+ clone_type=single
elif [[ ! $(git rev-parse --quiet --verify "${fetch_r}") ]]
then
# use '--depth 1' when fetching a new branch
@@ -553,7 +570,7 @@ git-r3_fetch() {
set -- "${fetch_command[@]}"
echo "${@}" >&2
if "${@}"; then
- if [[ ${EGIT_CLONE_TYPE} == mirror ]]; then
+ if [[ ${clone_type} == mirror ]]; then
# find remote HEAD and update our HEAD properly
git symbolic-ref HEAD \
"$(_git-r3_find_head refs/git-r3/HEAD \