summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2008-03-30 05:39:59 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2008-03-30 05:39:59 +0000
commit0ac633a01b482e0c7fd714306f9bf6c9cb6e2ada (patch)
treec3b1040fcb6440a1e2e66e2f0b69163d67198f97
parentPer bug #160801, Grub needs modification to support kernels larger than 3Mb. ... (diff)
downloadhistorical-0ac633a01b482e0c7fd714306f9bf6c9cb6e2ada.tar.gz
historical-0ac633a01b482e0c7fd714306f9bf6c9cb6e2ada.tar.bz2
historical-0ac633a01b482e0c7fd714306f9bf6c9cb6e2ada.zip
Add EGIT_OFFLINE support to git.eclass, modelled after the svn.eclass offline mode. Very useful if the upstream repo is offline for maintenance.
-rw-r--r--eclass/git.eclass13
1 files changed, 12 insertions, 1 deletions
diff --git a/eclass/git.eclass b/eclass/git.eclass
index 66c6f7a2b9ae..95029457144e 100644
--- a/eclass/git.eclass
+++ b/eclass/git.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/git.eclass,v 1.8 2007/12/27 01:02:30 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/git.eclass,v 1.9 2008/03/30 05:39:59 robbat2 Exp $
## --------------------------------------------------------------------------- #
# subversion.eclass author: Akinori Hattori <hattya@gentoo.org>
@@ -95,6 +95,12 @@ EGIT_DIFFSTAT_CMD="git diff --stat"
#
: ${EGIT_BOOTSTRAP:=}
+# @ECLASS-VARIABLE: EGIT_OFFLINE
+# @DESCRIPTION:
+# Set this variable to a non-empty value to disable the automatic updating of
+# an GIT source tree. This is intended to be set outside the subversion source
+# tree by users.
+EGIT_OFFLINE="${EGIT_OFFLINE:-${ESCM_OFFLINE}}"
## -- EGIT_PATCHES:
#
@@ -198,6 +204,11 @@ git_fetch() {
# We use --bare cloning, so git doesn't do this for us.
git config remote.origin.url "${EGIT_REPO_URI}"
+ elif [[ -n ${EGIT_OFFLINE} ]] ; then
+ local oldsha1=$(git rev-parse ${EGIT_BRANCH})
+ einfo "git update offline mode -->"
+ einfo " repository: ${EGIT_REPO_URI}"
+ einfo " commit: ${oldsha1}"
else
# Git urls might change, so unconditionally set it here
git config remote.origin.url "${EGIT_REPO_URI}"