1 |
scarabeus 09/04/05 20:22:15 |
2 |
|
3 |
Modified: git.eclass |
4 |
Log: |
5 |
EAPI2fy git eclass. Make it eclassdoc compatible (at least i hope :]) |
6 |
There are new elog informations which are requested by upstream often. |
7 |
Note that this elog can be supresed by setting EGIT_QUIET="ON" in make.conf or somewhere else in the env. :] |
8 |
|
9 |
Revision Changes Path |
10 |
1.17 eclass/git.eclass |
11 |
|
12 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/git.eclass?rev=1.17&view=markup |
13 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/git.eclass?rev=1.17&content-type=text/plain |
14 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/git.eclass?r1=1.16&r2=1.17 |
15 |
|
16 |
Index: git.eclass |
17 |
=================================================================== |
18 |
RCS file: /var/cvsroot/gentoo-x86/eclass/git.eclass,v |
19 |
retrieving revision 1.16 |
20 |
retrieving revision 1.17 |
21 |
diff -u -r1.16 -r1.17 |
22 |
--- git.eclass 19 Mar 2009 11:51:13 -0000 1.16 |
23 |
+++ git.eclass 5 Apr 2009 20:22:15 -0000 1.17 |
24 |
@@ -1,99 +1,95 @@ |
25 |
-# Copyright 1999-2006 Gentoo Foundation |
26 |
+# Copyright 1999-2009 Gentoo Foundation |
27 |
# Distributed under the terms of the GNU General Public License v2 |
28 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/git.eclass,v 1.16 2009/03/19 11:51:13 scarabeus Exp $ |
29 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/git.eclass,v 1.17 2009/04/05 20:22:15 scarabeus Exp $ |
30 |
|
31 |
-## --------------------------------------------------------------------------- # |
32 |
-# subversion.eclass author: Akinori Hattori <hattya@g.o> |
33 |
-# modified for git by Donnie Berkholz <spyderous@g.o> |
34 |
-# improved by Fernando J. Pereda <ferdy@g.o> |
35 |
-# you should currently poke with updates Tomas Chvatal <scarabeus@g.o> |
36 |
-# |
37 |
-# The git eclass is written to fetch the software sources from |
38 |
-# git repositories like the subversion eclass. |
39 |
-# |
40 |
-# |
41 |
-# Description: |
42 |
-# If you use this eclass, the ${S} is ${WORKDIR}/${P}. |
43 |
-# It is necessary to define the EGIT_REPO_URI variable at least. |
44 |
-# |
45 |
-## --------------------------------------------------------------------------- # |
46 |
+# @ECLASS: git.eclass |
47 |
+# @MAINTAINER: |
48 |
+# Tomas Chvatal <scarabeus@g.o> |
49 |
+# Donnie Berkholz <dberkholz@g.o> |
50 |
+# @BLURB: This eclass provides functions for fetch and unpack git repozitories |
51 |
+# @DESCRIPTION: |
52 |
+# The eclass is based on subversion eclass. |
53 |
+# If you use this eclass, the ${S} is ${WORKDIR}/${P}. |
54 |
+# It is necessary to define the EGIT_REPO_URI variable at least. |
55 |
+# @THANKS TO: |
56 |
+# Fernando J. Pereda <ferdy@g.o> |
57 |
|
58 |
inherit eutils |
59 |
|
60 |
EGIT="git.eclass" |
61 |
|
62 |
-EXPORT_FUNCTIONS src_unpack |
63 |
- |
64 |
-HOMEPAGE="http://git.or.cz/" |
65 |
-DESCRIPTION="Based on the ${ECLASS} eclass" |
66 |
+EXPORTED_FUNCTIONS="src_unpack" |
67 |
+case "${EAPI:-0}" in |
68 |
+ 2) EXPORT_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare" ;; |
69 |
+ 0|1) ;; |
70 |
+ *) die "Unknown EAPI, Bug eclass maintainers." ;; |
71 |
+esac |
72 |
+EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS} |
73 |
|
74 |
+# define some nice defaults but only if nothing is set already |
75 |
+: ${HOMEPAGE:=http://git-scm.com/} |
76 |
|
77 |
-## -- add git in DEPEND |
78 |
-# |
79 |
-DEPEND=">=dev-util/git-1.5" |
80 |
+# We DEPEND on at least a bit recent git version |
81 |
+DEPEND=">=dev-util/git-1.6" |
82 |
|
83 |
+# @ECLASS-VARIABLE: EGIT_QUIET |
84 |
+# @DESCRIPTION: |
85 |
+# Enables user specified verbosity for the eclass elog informations. |
86 |
+# The user just needs to add EGIT_QUIET="ON" to the /etc/make.conf. |
87 |
+: ${EGIT_QUIET:="OFF"} |
88 |
|
89 |
-## -- EGIT_STORE_DIR: git sources store directory |
90 |
-# |
91 |
+# @ECLASS-VARIABLE: EGIT_STORE_DIR |
92 |
+# @DESCRIPTION: |
93 |
+# Storage directory for git sources. |
94 |
EGIT_STORE_DIR="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/git-src" |
95 |
|
96 |
- |
97 |
-## -- EGIT_FETCH_CMD: git clone command |
98 |
-# |
99 |
+# @ECLASS-VARIABLE: EGIT_FETCH_CMD |
100 |
+# @DESCRIPTION: |
101 |
+# Command for cloning the repository. |
102 |
EGIT_FETCH_CMD="git clone --bare" |
103 |
|
104 |
-## -- EGIT_UPDATE_CMD: git fetch command |
105 |
-# |
106 |
+# @ECLASS-VARIABLE: EGIT_UPDATE_CMD |
107 |
+# @DESCRIPTION: |
108 |
+# Git fetch command. |
109 |
EGIT_UPDATE_CMD="git fetch -f -u" |
110 |
|
111 |
-## -- EGIT_DIFFSTAT_CMD: Command to get diffstat output |
112 |
-# |
113 |
+# @ECLASS-VARIABLE: EGIT_DIFFSTAT_CMD |
114 |
+# @DESCRIPTION: |
115 |
+# Git command for diffstat. |
116 |
EGIT_DIFFSTAT_CMD="git diff --stat" |
117 |
|
118 |
- |
119 |
-## -- EGIT_OPTIONS: |
120 |
-# |
121 |
-# the options passed to clone and fetch |
122 |
-# |
123 |
+# @ECLASS-VARIABLE: EGIT_OPTIONS |
124 |
+# @DESCRIPTION: |
125 |
+# This variable value is passed to clone and fetch. |
126 |
: ${EGIT_OPTIONS:=} |
127 |
|
128 |
- |
129 |
-## -- EGIT_REPO_URI: repository uri |
130 |
-# |
131 |
+# @ECLASS-VARIABLE: EGIT_REPO_URI |
132 |
+# @DESCRIPTION: |
133 |
+# URI for the repository |
134 |
# e.g. http://foo, git://bar |
135 |
-# |
136 |
-# supported protocols: |
137 |
+# Supported protocols: |
138 |
# http:// |
139 |
# https:// |
140 |
# git:// |
141 |
# git+ssh:// |
142 |
# rsync:// |
143 |
# ssh:// |
144 |
-# |
145 |
: ${EGIT_REPO_URI:=} |
146 |
|
147 |
- |
148 |
-## -- EGIT_PROJECT: project name of your ebuild |
149 |
-# |
150 |
-# git eclass will check out the git repository like: |
151 |
-# |
152 |
-# ${EGIT_STORE_DIR}/${EGIT_PROJECT}/${EGIT_REPO_URI##*/} |
153 |
-# |
154 |
+# @ECLASS-VARIABLE: EGIT_PROJECT |
155 |
+# @DESCRIPTION: |
156 |
+# Project name of your ebuild. |
157 |
+# Git eclass will check out the git repository like: |
158 |
+# ${EGIT_STORE_DIR}/${EGIT_PROJECT}/${EGIT_REPO_URI##*/} |
159 |
# so if you define EGIT_REPO_URI as http://git.collab.net/repo/git or |
160 |
# http://git.collab.net/repo/git. and PN is subversion-git. |
161 |
# it will check out like: |
162 |
-# |
163 |
-# ${EGIT_STORE_DIR}/subversion |
164 |
-# |
165 |
-# default: ${PN/-git}. |
166 |
-# |
167 |
+# ${EGIT_STORE_DIR}/subversion |
168 |
: ${EGIT_PROJECT:=${PN/-git}} |
169 |
|
170 |
- |
171 |
-## -- EGIT_BOOTSTRAP: |
172 |
-# |
173 |
-# bootstrap script or command like autogen.sh or etc.. |
174 |
-# |
175 |
+# @ECLASS-VARIABLE: EGIT_BOOSTRAP |
176 |
+# @DESCRIPTION: |
177 |
+# bootstrap script or command like autogen.sh or etc... |
178 |
: ${EGIT_BOOTSTRAP:=} |
179 |
|
180 |
# @ECLASS-VARIABLE: EGIT_OFFLINE |
181 |
@@ -103,60 +99,55 @@ |
182 |
# tree by users. |
183 |
EGIT_OFFLINE="${EGIT_OFFLINE:-${ESCM_OFFLINE}}" |
184 |
|
185 |
-## -- EGIT_PATCHES: |
186 |
-# |
187 |
-# git eclass can apply pathces in git_bootstrap(). |
188 |
-# you can use regexp in this valiable like *.diff or *.patch or etc. |
189 |
-# NOTE: this patches will apply before eval EGIT_BOOTSTRAP. |
190 |
-# |
191 |
-# the process of applying the patch is: |
192 |
-# 1. just epatch it, if the patch exists in the path. |
193 |
-# 2. scan it under FILESDIR and epatch it, if the patch exists in FILESDIR. |
194 |
-# 3. die. |
195 |
-# |
196 |
-: ${EGIT_PATCHES:=} |
197 |
- |
198 |
+# @ECLASS-VARIABLE: EGIT_PATCHES |
199 |
+# @DESCRIPTION: |
200 |
+# Similar to PATCHES array from base.eclass |
201 |
+# Only difference is that this patches are applied before bootstrap. |
202 |
+# Please take note that this variable should be bash array. |
203 |
|
204 |
-## -- EGIT_BRANCH: |
205 |
-# |
206 |
+# @ECLASS-VARIABLE: EGIT_BRANCH |
207 |
+# @DESCRIPTION: |
208 |
# git eclass can fetch any branch in git_fetch(). |
209 |
-# If set, it must be before 'inherit git', otherwise both EGIT_BRANCH and |
210 |
-# EGIT_TREE must be set after 'inherit git'. |
211 |
-# Defaults to 'master' |
212 |
-# |
213 |
: ${EGIT_BRANCH:=master} |
214 |
|
215 |
- |
216 |
-## -- EGIT_TREE: |
217 |
-# |
218 |
+# @ECLASS-VARIABLE: EGIT_TREE |
219 |
+# @DESCRIPTION: |
220 |
# git eclass can checkout any tree. |
221 |
-# Defaults to EGIT_BRANCH. |
222 |
-# |
223 |
: ${EGIT_TREE:=${EGIT_BRANCH}} |
224 |
|
225 |
- |
226 |
-## - EGIT_REPACK: |
227 |
-# |
228 |
+# @ECLASS-VARIABLE: EGIT_REPACK |
229 |
+# @DESCRIPTION: |
230 |
# git eclass will repack objects to save disk space. However this can take a |
231 |
-# long time with VERY big repositories. If this is your case set: |
232 |
-# EGIT_REPACK=false |
233 |
-# |
234 |
+# long time with VERY big repositories. |
235 |
: ${EGIT_REPACK:=false} |
236 |
|
237 |
-## - EGIT_PRUNE: |
238 |
-# |
239 |
-# git eclass can prune the local clone. This is useful if upstream rewinds and |
240 |
-# rebases branches too often. If you don't want this to happen, set: |
241 |
-# EGIT_PRUNE=false |
242 |
-# |
243 |
+# @ECLASS-VARIABLE: EGIT_PRUNE |
244 |
+# @DESCRIPTION: |
245 |
+# git.eclass can prune the local clone. This is useful if upstream rewinds and |
246 |
+# rebases branches too often. |
247 |
: ${EGIT_PRUNE:=false} |
248 |
|
249 |
+# @FUNCTION: git_fetch |
250 |
+# @DESCRIPTION: |
251 |
+# Gets repository from EGIT_REPO_URI and store it in specified EGIT_STORE_DIR |
252 |
+git_fetch() { |
253 |
+ debug-print-function ${FUNCNAME} "$@" |
254 |
|
255 |
-## -- git_fetch() ------------------------------------------------- # |
256 |
+ local EGIT_CLONE_DIR oldsha1 cursha1 |
257 |
|
258 |
-git_fetch() { |
259 |
+ # choose if user wants elog or just einfo. |
260 |
+ if [[ ${EGIT_QUIET} != OFF ]]; then |
261 |
+ elogcmd="einfo" |
262 |
+ else |
263 |
+ elogcmd="elog" |
264 |
+ fi |
265 |
|
266 |
- local EGIT_CLONE_DIR |
267 |
+ # If we have same branch and the tree we can do --depth 1 clone |
268 |
+ # which outputs into really smaller data transfers. |
269 |
+ # Sadly we can do shallow copy for now because quite few packages need .git |
270 |
+ # folder. |
271 |
+ #[[ ${EGIT_TREE} = ${EGIT_BRANCH} ]] && \ |
272 |
+ # EGIT_FETCH_CMD="${EGIT_FETCH_CMD} --depth 1" |
273 |
|
274 |
# EGIT_REPO_URI is empty. |
275 |
[[ -z ${EGIT_REPO_URI} ]] && die "${EGIT}: EGIT_REPO_URI is empty." |
276 |
@@ -164,14 +155,13 @@ |
277 |
# check for the protocol or pull from a local repo. |
278 |
if [[ -z ${EGIT_REPO_URI%%:*} ]] ; then |
279 |
case ${EGIT_REPO_URI%%:*} in |
280 |
- git*|http|https|rsync|ssh) |
281 |
- ;; |
282 |
- *) |
283 |
- die "${EGIT}: fetch from "${EGIT_REPO_URI%:*}" is not yet implemented." |
284 |
- ;; |
285 |
+ git*|http|https|rsync|ssh) ;; |
286 |
+ *) die "${EGIT}: protocol for fetch from "${EGIT_REPO_URI%:*}" is not yet implemented in eclass." ;; |
287 |
esac |
288 |
fi |
289 |
|
290 |
+ # initial clone, we have to create master git storage directory and play |
291 |
+ # nicely with sandbox |
292 |
if [[ ! -d ${EGIT_STORE_DIR} ]] ; then |
293 |
debug-print "${FUNCNAME}: initial clone. creating git directory" |
294 |
addwrite / |
295 |
@@ -183,122 +173,162 @@ |
296 |
cd -P "${EGIT_STORE_DIR}" || die "${EGIT}: can't chdir to ${EGIT_STORE_DIR}" |
297 |
EGIT_STORE_DIR=${PWD} |
298 |
|
299 |
- # every time |
300 |
+ # allow writing into EGIT_STORE_DIR |
301 |
addwrite "${EGIT_STORE_DIR}" |
302 |
|
303 |
[[ -z ${EGIT_REPO_URI##*/} ]] && EGIT_REPO_URI="${EGIT_REPO_URI%/}" |
304 |
EGIT_CLONE_DIR="${EGIT_PROJECT}" |
305 |
|
306 |
- # determine whether to perform shallow clone |
307 |
- local EGIT_FETCH_OPTS |
308 |
- if [[ ${EGIT_BRANCH} = ${EGIT_TREE} ]] && [[ ${EGIT_BRANCH} = master ]] ; then |
309 |
- EGIT_FETCH_OPTS="--depth 1" |
310 |
- fi |
311 |
- |
312 |
debug-print "${FUNCNAME}: EGIT_OPTIONS = \"${EGIT_OPTIONS}\"" |
313 |
|
314 |
export GIT_DIR="${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" |
315 |
|
316 |
if [[ ! -d ${EGIT_CLONE_DIR} ]] ; then |
317 |
# first clone |
318 |
- einfo "git clone start -->" |
319 |
- einfo " repository: ${EGIT_REPO_URI}" |
320 |
+ ${elogcmd} "GIT NEW clone -->" |
321 |
+ ${elogcmd} " repository: ${EGIT_REPO_URI}" |
322 |
|
323 |
- ${EGIT_FETCH_CMD} ${EGIT_FETCH_OPTS} ${EGIT_OPTIONS} "${EGIT_REPO_URI}" ${EGIT_PROJECT} \ |
324 |
+ ${EGIT_FETCH_CMD} ${EGIT_OPTIONS} "${EGIT_REPO_URI}" ${EGIT_PROJECT} \ |
325 |
|| die "${EGIT}: can't fetch from ${EGIT_REPO_URI}." |
326 |
|
327 |
+ oldsha1=$(git rev-parse ${EGIT_BRANCH}) |
328 |
+ ${elogcmd} " at the commit: ${oldsha1}" |
329 |
+ |
330 |
# We use --bare cloning, so git doesn't do this for us. |
331 |
git config remote.origin.url "${EGIT_REPO_URI}" |
332 |
elif [[ -n ${EGIT_OFFLINE} ]] ; then |
333 |
- local oldsha1=$(git rev-parse ${EGIT_BRANCH}) |
334 |
- einfo "git update offline mode -->" |
335 |
- einfo " repository: ${EGIT_REPO_URI}" |
336 |
- einfo " commit: ${oldsha1}" |
337 |
+ oldsha1=$(git rev-parse ${EGIT_BRANCH}) |
338 |
+ ${elogcmd} "GIT offline update -->" |
339 |
+ ${elogcmd} " repository: ${EGIT_REPO_URI}" |
340 |
+ ${elogcmd} " at the commit: ${oldsha1}" |
341 |
else |
342 |
# Git urls might change, so unconditionally set it here |
343 |
git config remote.origin.url "${EGIT_REPO_URI}" |
344 |
|
345 |
# fetch updates |
346 |
- einfo "git update start -->" |
347 |
- einfo " repository: ${EGIT_REPO_URI}" |
348 |
+ ${elogcmd} "GIT update -->" |
349 |
+ ${elogcmd} " repository: ${EGIT_REPO_URI}" |
350 |
|
351 |
- local oldsha1=$(git rev-parse ${EGIT_BRANCH}) |
352 |
+ oldsha1=$(git rev-parse ${EGIT_BRANCH}) |
353 |
|
354 |
${EGIT_UPDATE_CMD} ${EGIT_OPTIONS} origin ${EGIT_BRANCH}:${EGIT_BRANCH} \ |
355 |
|| die "${EGIT}: can't update from ${EGIT_REPO_URI}." |
356 |
|
357 |
+ cursha1=$(git rev-parse ${EGIT_BRANCH}) |
358 |
+ |
359 |
+ # write out message based on the revisions |
360 |
+ if [[ ${oldsha1} != ${cursha1} ]]; then |
361 |
+ ${elogcmd} " updating from commit: ${oldsha1}" |
362 |
+ ${elogcmd} " to commit: ${cursha1}" |
363 |
+ else |
364 |
+ ${elogcmd} " at the commit: ${cursha1}" |
365 |
+ fi |
366 |
# piping through cat is needed to avoid a stupid Git feature |
367 |
${EGIT_DIFFSTAT_CMD} ${oldsha1}..${EGIT_BRANCH} | cat |
368 |
fi |
369 |
|
370 |
- einfo " local clone: ${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" |
371 |
- |
372 |
if ${EGIT_REPACK} || ${EGIT_PRUNE} ; then |
373 |
ebegin "Garbage collecting the repository" |
374 |
git gc $(${EGIT_PRUNE} && echo '--prune') |
375 |
eend $? |
376 |
fi |
377 |
|
378 |
- einfo " committish: ${EGIT_TREE}" |
379 |
+ [[ ${EGIT_TREE} != ${EGIT_BRANCH} ]] && elog " tree: ${EGIT_TREE}" |
380 |
+ ${elogcmd} " branch: ${EGIT_BRANCH}" |
381 |
+ ${elogcmd} " storage directory: \"${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}\"" |
382 |
|
383 |
# export to the ${WORKDIR} |
384 |
mkdir -p "${S}" |
385 |
+ |
386 |
+ # git data are used in some packages for various variables definition. So we |
387 |
+ # copy also .git folder. |
388 |
+ pushd "${S}" > /dev/null |
389 |
+ git clone --bare ${EGIT_STORE_DIR}/${EGIT_CLONE_DIR} .git |
390 |
+ popd > /dev/null |
391 |
+ |
392 |
git archive --format=tar ${EGIT_TREE} | ( cd "${S}" ; tar xf - ) |
393 |
|
394 |
echo ">>> Unpacked to ${S}" |
395 |
- |
396 |
} |
397 |
|
398 |
- |
399 |
-## -- git_bootstrap() ------------------------------------------------ # |
400 |
- |
401 |
+# @FUNCTION: git_bootstrap |
402 |
+# @DESCRIPTION: |
403 |
+# Runs bootstrap command if EGIT_BOOTSTRAP variable contains some value |
404 |
+# Remember that what ever gets to the EGIT_BOOTSTRAP variable gets evaled by bash. |
405 |
git_bootstrap() { |
406 |
+ debug-print-function ${FUNCNAME} "$@" |
407 |
|
408 |
- local patch lpatch |
409 |
- |
410 |
- cd "${S}" |
411 |
- |
412 |
- if [[ -n ${EGIT_PATCHES} ]] ; then |
413 |
- einfo "apply patches -->" |
414 |
+ if [[ -n ${EGIT_BOOTSTRAP} ]] ; then |
415 |
+ pushd "${S}" > /dev/null |
416 |
+ einfo "Starting bootstrap" |
417 |
|
418 |
- for patch in ${EGIT_PATCHES} ; do |
419 |
- if [[ -f ${patch} ]] ; then |
420 |
- epatch ${patch} |
421 |
+ if [[ -f ${EGIT_BOOTSTRAP} ]]; then |
422 |
+ # we have file in the repo which we should execute |
423 |
+ debug-print "$FUNCNAME: bootstraping with file \"${EGIT_BOOTSTRAP}\"" |
424 |
+ |
425 |
+ if [[ -x ${EGIT_BOOTSTRAP} ]]; then |
426 |
+ eval "./${EGIT_BOOTSTRAP}" \ |
427 |
+ || die "${EGIT}: bootstrap script failed" |
428 |
else |
429 |
- for lpatch in "${FILESDIR}"/${patch} ; do |
430 |
- if [[ -f ${lpatch} ]] ; then |
431 |
- epatch ${lpatch} |
432 |
- else |
433 |
- die "${EGIT}: ${patch} is not found" |
434 |
- fi |
435 |
- done |
436 |
+ eerror "\"${EGIT_BOOTSTRAP}\" is not executable." |
437 |
+ eerror "Report upstream, or bug ebuild maintainer to remove bootstrap command." |
438 |
+ die "${EGIT}: \"${EGIT_BOOTSTRAP}\" is not executable." |
439 |
fi |
440 |
- done |
441 |
- echo |
442 |
- fi |
443 |
- |
444 |
- if [[ -n ${EGIT_BOOTSTRAP} ]] ; then |
445 |
- einfo "begin bootstrap -->" |
446 |
- |
447 |
- if [[ -f ${EGIT_BOOTSTRAP} ]] && [[ -x ${EGIT_BOOTSTRAP} ]] ; then |
448 |
- einfo " bootstrap with a file: ${EGIT_BOOTSTRAP}" |
449 |
- eval "./${EGIT_BOOTSTRAP}" \ |
450 |
- || die "${EGIT}: can't execute EGIT_BOOTSTRAP." |
451 |
else |
452 |
- einfo " bootstrap with commands: ${EGIT_BOOTSTRAP}" |
453 |
+ # we execute some system command |
454 |
+ debug-print "$FUNCNAME: bootstraping with commands \"${EGIT_BOOTSTRAP}\"" |
455 |
+ |
456 |
eval "${EGIT_BOOTSTRAP}" \ |
457 |
- || die "${EGIT}: can't eval EGIT_BOOTSTRAP." |
458 |
+ || die "${EGIT}: bootstrap commands failed." |
459 |
+ |
460 |
fi |
461 |
- fi |
462 |
|
463 |
+ einfo "Bootstrap finished" |
464 |
+ popd > /dev/null |
465 |
+ fi |
466 |
} |
467 |
|
468 |
+# @FUNCTION: git_apply_patches |
469 |
+# @DESCRIPTION: |
470 |
+# Apply patches from EGIT_PATCHES bash array. |
471 |
+# Preffered is using the variable as bash array but for now it allows to write |
472 |
+# it also as normal space separated string list. (This part of code should be |
473 |
+# removed when all ebuilds get converted on bash array). |
474 |
+git_apply_patches() { |
475 |
+ debug-print-function ${FUNCNAME} "$@" |
476 |
+ |
477 |
+ pushd "${S}" > /dev/null |
478 |
+ if [[ ${#EGIT_PATCHES[@]} -gt 1 ]] ; then |
479 |
+ for i in "${EGIT_PATCHES[@]}"; do |
480 |
+ debug-print "$FUNCNAME: git_autopatch: patching from ${i}" |
481 |
+ epatch "${i}" |
482 |
+ done |
483 |
+ elif [[ ${EGIT_PATCHES} != "" ]]; then |
484 |
+ # no need for loop if space separated string is passed. |
485 |
+ debug-print "$FUNCNAME: git_autopatch: patching from ${EGIT_PATCHES}" |
486 |
+ epatch "${EGIT_PATCHES}" |
487 |
+ fi |
488 |
|
489 |
-## -- git_src_unpack() ------------------------------------------------ # |
490 |
+ popd > /dev/null |
491 |
+} |
492 |
|
493 |
+# @FUNCTION: git_src_unpack |
494 |
+# @DESCRIPTION: |
495 |
+# src_upack function, calls src_prepare one if EAPI!=2. |
496 |
git_src_unpack() { |
497 |
+ debug-print-function ${FUNCNAME} "$@" |
498 |
+ |
499 |
+ git_fetch || die "${EGIT}: unknown problem in git_fetch()." |
500 |
|
501 |
- git_fetch || die "${EGIT}: unknown problem in git_fetch()." |
502 |
- git_bootstrap || die "${EGIT}: unknown problem in git_bootstrap()." |
503 |
+ has src_prepare ${EXPORTED_FUNCTIONS} || git_src_prepare |
504 |
+} |
505 |
+ |
506 |
+# @FUNCTION: git_src_prepare |
507 |
+# @DESCRIPTION: |
508 |
+# src_prepare function for git stuff. Patches, bootstrap... |
509 |
+git_src_prepare() { |
510 |
+ debug-print-function ${FUNCNAME} "$@" |
511 |
|
512 |
+ git_apply_patches |
513 |
+ git_bootstrap |
514 |
} |