summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2014-03-02 11:47:10 +0000
committerMichał Górny <mgorny@gentoo.org>2014-03-02 11:47:10 +0000
commit2838b39cf6b1ea3cd68824c976cefb455b6507d3 (patch)
tree0ed1081eb46e5713bf32e8862757e76b32eec707 /eclass
parentSupport using a local git mirror. (diff)
downloadhistorical-2838b39cf6b1ea3cd68824c976cefb455b6507d3.tar.gz
historical-2838b39cf6b1ea3cd68824c976cefb455b6507d3.tar.bz2
historical-2838b39cf6b1ea3cd68824c976cefb455b6507d3.zip
Introduce EGIT_CLONE_TYPE for future use.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ChangeLog5
-rw-r--r--eclass/git-r3.eclass23
2 files changed, 26 insertions, 2 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index 52dd41df6c18..3ee9edb6a0ee 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.1155 2014/03/02 11:46:42 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1156 2014/03/02 11:47:10 mgorny Exp $
+
+ 02 Mar 2014; Michał Górny <mgorny@gentoo.org> git-r3.eclass:
+ Introduce EGIT_CLONE_TYPE for future use.
02 Mar 2014; Michał Górny <mgorny@gentoo.org> git-r3.eclass:
Support using a local git mirror.
diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass
index 7aa1d1ce698a..bb85064ed3f9 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.30 2014/03/02 11:46:42 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/git-r3.eclass,v 1.31 2014/03/02 11:47:10 mgorny Exp $
# @ECLASS: git-r3.eclass
# @MAINTAINER:
@@ -32,6 +32,19 @@ if [[ ! ${_INHERITED_BY_GIT_2} ]]; then
DEPEND="dev-vcs/git"
fi
+# @ECLASS-VARIABLE: EGIT_CLONE_TYPE
+# @DESCRIPTION:
+# Type of clone that should be used against the remote repository.
+# This can be either of: 'mirror'.
+#
+# The 'mirror' type clones all remote branches and tags with complete
+# history and all notes. EGIT_COMMIT can specify any commit hash.
+# Upstream-removed branches and tags are purged from the local clone
+# while fetching. This mode is suitable for cloning the local copy
+# for development or hosting a local git mirror. However, clones
+# of repositories with large diverged branches may quickly grow large.
+: ${EGIT_CLONE_TYPE:=mirror}
+
# @ECLASS-VARIABLE: EGIT3_STORE_DIR
# @DESCRIPTION:
# Storage directory for git sources.
@@ -107,6 +120,14 @@ fi
_git-r3_env_setup() {
debug-print-function ${FUNCNAME} "$@"
+ # check the clone type
+ case "${EGIT_CLONE_TYPE}" in
+ mirror)
+ ;;
+ *)
+ die "Invalid EGIT_CLONE_TYPE=${EGIT_CLONE_TYPE}"
+ esac
+
local esc_pn livevar
esc_pn=${PN//[-+]/_}