summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2014-03-02 11:49:05 +0000
committerMichał Górny <mgorny@gentoo.org>2014-03-02 11:49:05 +0000
commit45898d6807b29c7d4da6d854a5cea078720e2b74 (patch)
treeb51a9c525d26be094fcaaa96d29267a69bc57c73 /eclass
parentia64 stable wrt bug #502740 (diff)
downloadgentoo-2-45898d6807b29c7d4da6d854a5cea078720e2b74.tar.gz
gentoo-2-45898d6807b29c7d4da6d854a5cea078720e2b74.tar.bz2
gentoo-2-45898d6807b29c7d4da6d854a5cea078720e2b74.zip
Add EGIT_MIN_CLONE_TYPE to control clone type via ebuilds.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ChangeLog5
-rw-r--r--eclass/git-r3.eclass33
2 files changed, 36 insertions, 2 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index 3f5a31acee9a..1fc8712c2239 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.1159 2014/03/02 11:48:28 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1160 2014/03/02 11:49:05 mgorny Exp $
+
+ 02 Mar 2014; Michał Górny <mgorny@gentoo.org> git-r3.eclass:
+ Add EGIT_MIN_CLONE_TYPE to control clone type via ebuilds.
02 Mar 2014; Michał Górny <mgorny@gentoo.org> git-r3.eclass:
Auto-unshallow when fetching by commit hash.
diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass
index 0a1945fa6115..5002b3497023 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.34 2014/03/02 11:48:28 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/git-r3.eclass,v 1.35 2014/03/02 11:49:05 mgorny Exp $
# @ECLASS: git-r3.eclass
# @MAINTAINER:
@@ -58,6 +58,19 @@ fi
# embedded systems with limited disk space.
: ${EGIT_CLONE_TYPE:=single}
+# @ECLASS-VARIABLE: EGIT_MIN_CLONE_TYPE
+# @DESCRIPTION:
+# 'Minimum' clone type supported by the ebuild. Takes same values
+# as EGIT_CLONE_TYPE. When user sets a type that's 'lower' (that is,
+# later on the list) than EGIT_MIN_CLONE_TYPE, the eclass uses
+# EGIT_MIN_CLONE_TYPE instead.
+#
+# A common case is to use 'single' whenever the build system requires
+# access to full branch history or the remote (Google Code) does not
+# support shallow clones. Please use sparingly, and to fix fatal errors
+# rather than 'non-pretty versions'.
+: ${EGIT_MIN_CLONE_TYPE:=shallow}
+
# @ECLASS-VARIABLE: EGIT3_STORE_DIR
# @DESCRIPTION:
# Storage directory for git sources.
@@ -140,6 +153,24 @@ _git-r3_env_setup() {
*)
die "Invalid EGIT_CLONE_TYPE=${EGIT_CLONE_TYPE}"
esac
+ case "${EGIT_MIN_CLONE_TYPE}" in
+ shallow)
+ ;;
+ single)
+ if [[ ${EGIT_CLONE_TYPE} == shallow ]]; then
+ einfo "git-r3: ebuild needs to be cloned in 'single' mode, adjusting"
+ EGIT_CLONE_TYPE=single
+ fi
+ ;;
+ mirror)
+ if [[ ${EGIT_CLONE_TYPE} != mirror ]]; then
+ einfo "git-r3: ebuild needs to be cloned in 'mirror' mode, adjusting"
+ EGIT_CLONE_TYPE=mirror
+ fi
+ ;;
+ *)
+ die "Invalid EGIT_MIN_CLONE_TYPE=${EGIT_MIN_CLONE_TYPE}"
+ esac
local esc_pn livevar
esc_pn=${PN//[-+]/_}