1 |
scarabeus 09/08/24 21:48:58 |
2 |
|
3 |
Modified: git.eclass |
4 |
Log: |
5 |
Update git eclass from x11 overlay. |
6 |
FEATURES |
7 |
* git submodule support |
8 |
* LIVE_FAIL_FETCH_IF_REPO_NOT_UPDATED usage |
9 |
- this makes build die when git repo is up-to-date and nothing new |
10 |
has been done in it. Quite lovely with --keep-going. |
11 |
* specific per overrides of TREE/BRANCH/REPO |
12 |
- just define ${PN//-/_}_LIVE_TREE/BRANCH/REPO in enviroment and you can |
13 |
override in ebuild values. |
14 |
|
15 |
Revision Changes Path |
16 |
1.28 eclass/git.eclass |
17 |
|
18 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/git.eclass?rev=1.28&view=markup |
19 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/git.eclass?rev=1.28&content-type=text/plain |
20 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/git.eclass?r1=1.27&r2=1.28 |
21 |
|
22 |
Index: git.eclass |
23 |
=================================================================== |
24 |
RCS file: /var/cvsroot/gentoo-x86/eclass/git.eclass,v |
25 |
retrieving revision 1.27 |
26 |
retrieving revision 1.28 |
27 |
diff -u -r1.27 -r1.28 |
28 |
--- git.eclass 14 May 2009 13:52:08 -0000 1.27 |
29 |
+++ git.eclass 24 Aug 2009 21:48:58 -0000 1.28 |
30 |
@@ -1,6 +1,6 @@ |
31 |
# Copyright 1999-2009 Gentoo Foundation |
32 |
# Distributed under the terms of the GNU General Public License v2 |
33 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/git.eclass,v 1.27 2009/05/14 13:52:08 scarabeus Exp $ |
34 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/git.eclass,v 1.28 2009/08/24 21:48:58 scarabeus Exp $ |
35 |
|
36 |
# @ECLASS: git.eclass |
37 |
# @MAINTAINER: |
38 |
@@ -75,8 +75,12 @@ |
39 |
# git+ssh:// |
40 |
# rsync:// |
41 |
# ssh:// |
42 |
-: ${EGIT_REPO_URI:=} |
43 |
- |
44 |
+eval X="\$${PN//-/_}_LIVE_REPO" |
45 |
+if [[ ${X} = "" ]]; then |
46 |
+ EGIT_REPO_URI=${EGIT_REPO_URI:=} |
47 |
+else |
48 |
+ EGIT_REPO_URI="${X}" |
49 |
+fi |
50 |
# @ECLASS-VARIABLE: EGIT_PROJECT |
51 |
# @DESCRIPTION: |
52 |
# Project name of your ebuild. |
53 |
@@ -109,12 +113,22 @@ |
54 |
# @ECLASS-VARIABLE: EGIT_BRANCH |
55 |
# @DESCRIPTION: |
56 |
# git eclass can fetch any branch in git_fetch(). |
57 |
-: ${EGIT_BRANCH:=master} |
58 |
+eval X="\$${PN//-/_}_LIVE_BRANCH" |
59 |
+if [[ ${X} = "" ]]; then |
60 |
+ EGIT_BRANCH=${EGIT_BRANCH:=master} |
61 |
+else |
62 |
+ EGIT_BRANCH="${X}" |
63 |
+fi |
64 |
|
65 |
# @ECLASS-VARIABLE: EGIT_TREE |
66 |
# @DESCRIPTION: |
67 |
# git eclass can checkout any tree (commit). |
68 |
-: ${EGIT_TREE:=${EGIT_BRANCH}} |
69 |
+eval X="\$${PN//-/_}_LIVE_TREE" |
70 |
+if [[ ${X} = "" ]]; then |
71 |
+ : ${EGIT_TREE:=${EGIT_BRANCH}} |
72 |
+else |
73 |
+ EGIT_TREE="${X}" |
74 |
+fi |
75 |
|
76 |
# @ECLASS-VARIABLE: EGIT_REPACK |
77 |
# @DESCRIPTION: |
78 |
@@ -218,6 +232,7 @@ |
79 |
|
80 |
oldsha1=$(git rev-parse ${EGIT_BRANCH}) |
81 |
|
82 |
+ ${elogcmd} ${EGIT_UPDATE_CMD} ${EGIT_OPTIONS} origin ${EGIT_BRANCH}:${EGIT_BRANCH} |
83 |
${EGIT_UPDATE_CMD} ${EGIT_OPTIONS} origin ${EGIT_BRANCH}:${EGIT_BRANCH} \ |
84 |
|| die "${EGIT}: can't update from ${EGIT_REPO_URI}." |
85 |
|
86 |
@@ -229,6 +244,16 @@ |
87 |
${elogcmd} " to commit: ${cursha1}" |
88 |
else |
89 |
${elogcmd} " at the commit: ${cursha1}" |
90 |
+ # @ECLASS_VARIABLE: LIVE_FAIL_FETCH_IF_REPO_NOT_UPDATED |
91 |
+ # @DESCRIPTION: |
92 |
+ # If this variable is set to TRUE in make.conf or somewhere in |
93 |
+ # enviroment the package will fail if there is no update, thus in |
94 |
+ # combination with --keep-going it would lead in not-updating |
95 |
+ # pakcages that are up-to-date. |
96 |
+ # TODO: this can lead to issues if more projects/packages use same repo |
97 |
+ [[ ${LIVE_FAIL_FETCH_IF_REPO_NOT_UPDATED} = true ]] && \ |
98 |
+ debug-print "${FUNCNAME}: Repository \"${EGIT_REPO_URI}\" is up-to-date. Skipping." && \ |
99 |
+ die "${EGIT}: Repository \"${EGIT_REPO_URI}\" is up-to-date. Skipping." |
100 |
fi |
101 |
${EGIT_DIFFSTAT_CMD} ${oldsha1}..${EGIT_BRANCH} |
102 |
fi |
103 |
@@ -260,6 +285,10 @@ |
104 |
fi |
105 |
debug-print "git checkout -b ${branchname} ${src}" |
106 |
git checkout -b ${branchname} ${src} 2>&1 > /dev/null |
107 |
+ debug-print "git submodule init" |
108 |
+ git submodule init 2>&1 > /dev/null |
109 |
+ debug-print "git submodule update" |
110 |
+ git submodule update 2>&1 > /dev/null |
111 |
popd > /dev/null |
112 |
|
113 |
unset branchname src |