1 |
robbat2 08/03/30 05:39:59 |
2 |
|
3 |
Modified: git.eclass |
4 |
Log: |
5 |
Add EGIT_OFFLINE support to git.eclass, modelled after the svn.eclass offline mode. Very useful if the upstream repo is offline for maintenance. |
6 |
|
7 |
Revision Changes Path |
8 |
1.9 eclass/git.eclass |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/git.eclass?rev=1.9&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/git.eclass?rev=1.9&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/git.eclass?r1=1.8&r2=1.9 |
13 |
|
14 |
Index: git.eclass |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/git.eclass,v |
17 |
retrieving revision 1.8 |
18 |
retrieving revision 1.9 |
19 |
diff -p -w -b -B -u -u -r1.8 -r1.9 |
20 |
--- git.eclass 27 Dec 2007 01:02:30 -0000 1.8 |
21 |
+++ git.eclass 30 Mar 2008 05:39:59 -0000 1.9 |
22 |
@@ -1,6 +1,6 @@ |
23 |
# Copyright 1999-2006 Gentoo Foundation |
24 |
# Distributed under the terms of the GNU General Public License v2 |
25 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/git.eclass,v 1.8 2007/12/27 01:02:30 robbat2 Exp $ |
26 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/git.eclass,v 1.9 2008/03/30 05:39:59 robbat2 Exp $ |
27 |
|
28 |
## --------------------------------------------------------------------------- # |
29 |
# subversion.eclass author: Akinori Hattori <hattya@g.o> |
30 |
@@ -95,6 +95,12 @@ EGIT_DIFFSTAT_CMD="git diff --stat" |
31 |
# |
32 |
: ${EGIT_BOOTSTRAP:=} |
33 |
|
34 |
+# @ECLASS-VARIABLE: EGIT_OFFLINE |
35 |
+# @DESCRIPTION: |
36 |
+# Set this variable to a non-empty value to disable the automatic updating of |
37 |
+# an GIT source tree. This is intended to be set outside the subversion source |
38 |
+# tree by users. |
39 |
+EGIT_OFFLINE="${EGIT_OFFLINE:-${ESCM_OFFLINE}}" |
40 |
|
41 |
## -- EGIT_PATCHES: |
42 |
# |
43 |
@@ -198,6 +204,11 @@ git_fetch() { |
44 |
|
45 |
# We use --bare cloning, so git doesn't do this for us. |
46 |
git config remote.origin.url "${EGIT_REPO_URI}" |
47 |
+ elif [[ -n ${EGIT_OFFLINE} ]] ; then |
48 |
+ local oldsha1=$(git rev-parse ${EGIT_BRANCH}) |
49 |
+ einfo "git update offline mode -->" |
50 |
+ einfo " repository: ${EGIT_REPO_URI}" |
51 |
+ einfo " commit: ${oldsha1}" |
52 |
else |
53 |
# Git urls might change, so unconditionally set it here |
54 |
git config remote.origin.url "${EGIT_REPO_URI}" |
55 |
|
56 |
|
57 |
|
58 |
-- |
59 |
gentoo-commits@l.g.o mailing list |