/[gentoo-x86]/eclass/git-2.eclass
Gentoo

Contents of /eclass/git-2.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.27 - (show annotations) (download)
Wed Dec 14 23:40:18 2011 UTC (3 years ago) by vapier
Branch: MAIN
Changes since 1.26: +2 -2 lines
create backing store dirs with group write perms so that people can more easily switch between user based testing (ebuild/etc...) and root/userpriv based emerging

1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/git-2.eclass,v 1.26 2011/09/23 14:10:47 mgorny Exp $
4
5 # @ECLASS: git-2.eclass
6 # @MAINTAINER:
7 # Donnie Berkholz <dberkholz@gentoo.org>
8 # Michał Górny <mgorny@gentoo.org>
9 # @BLURB: Eclass for fetching and unpacking git repositories.
10 # @DESCRIPTION:
11 # Eclass for easing maitenance of live ebuilds using git as remote repository.
12 # Eclass support working with git submodules and branching.
13
14 # This eclass support all EAPIs
15 EXPORT_FUNCTIONS src_unpack
16
17 DEPEND="dev-vcs/git"
18
19 # @ECLASS-VARIABLE: EGIT_SOURCEDIR
20 # @DESCRIPTION:
21 # This variable specifies destination where the cloned
22 # data are copied to.
23 #
24 # EGIT_SOURCEDIR="${S}"
25
26 # @ECLASS-VARIABLE: EGIT_STORE_DIR
27 # @DESCRIPTION:
28 # Storage directory for git sources.
29 #
30 # EGIT_STORE_DIR="${DISTDIR}/egit-src"
31
32 # @ECLASS-VARIABLE: EGIT_HAS_SUBMODULES
33 # @DEFAULT_UNSET
34 # @DESCRIPTION:
35 # If non-empty this variable enables support for git submodules in our
36 # checkout. Also this makes the checkout to be non-bare for now.
37
38 # @ECLASS-VARIABLE: EGIT_OPTIONS
39 # @DEFAULT_UNSET
40 # @DESCRIPTION:
41 # Variable specifying additional options for fetch command.
42
43 # @ECLASS-VARIABLE: EGIT_MASTER
44 # @DESCRIPTION:
45 # Variable for specifying master branch.
46 # Usefull when upstream don't have master branch or name it differently.
47 #
48 # EGIT_MASTER="master"
49
50 # @ECLASS-VARIABLE: EGIT_PROJECT
51 # @DESCRIPTION:
52 # Variable specifying name for the folder where we check out the git
53 # repository. Value of this variable should be unique in the
54 # EGIT_STORE_DIR as otherwise you would override another repository.
55 #
56 # EGIT_PROJECT="${EGIT_REPO_URI##*/}"
57
58 # @ECLASS-VARIABLE: EGIT_DIR
59 # @DESCRIPTION:
60 # Directory where we want to store the git data.
61 # This variable should not be overriden.
62 #
63 # EGIT_DIR="${EGIT_STORE_DIR}/${EGIT_PROJECT}"
64
65 # @ECLASS-VARIABLE: EGIT_REPO_URI
66 # @REQUIRED
67 # @DEFAULT_UNSET
68 # @DESCRIPTION:
69 # URI for the repository
70 # e.g. http://foo, git://bar
71 #
72 # Support multiple values:
73 # EGIT_REPO_URI="git://a/b.git http://c/d.git"
74
75 # @ECLASS-VARIABLE: EVCS_OFFLINE
76 # @DEFAULT_UNSET
77 # @DESCRIPTION:
78 # If non-empty this variable prevents performance of any online
79 # operations.
80
81 # @ECLASS-VARIABLE: EGIT_BRANCH
82 # @DESCRIPTION:
83 # Variable containing branch name we want to check out.
84 # It can be overriden via env using packagename_LIVE_BRANCH
85 # variable.
86 #
87 # EGIT_BRANCH="${EGIT_MASTER}"
88
89 # @ECLASS-VARIABLE: EGIT_COMMIT
90 # @DESCRIPTION:
91 # Variable containing commit hash/tag we want to check out.
92 # It can be overriden via env using packagename_LIVE_COMMIT
93 # variable.
94 #
95 # EGIT_COMMIT="${EGIT_BRANCH}"
96
97 # @ECLASS-VARIABLE: EGIT_REPACK
98 # @DEFAULT_UNSET
99 # @DESCRIPTION:
100 # If non-empty this variable specifies that repository will be repacked to
101 # save space. However this can take a REALLY LONG time with VERY big
102 # repositories.
103
104 # @ECLASS-VARIABLE: EGIT_PRUNE
105 # @DEFAULT_UNSET
106 # @DESCRIPTION:
107 # If non-empty this variable enables pruning all loose objects on each fetch.
108 # This is useful if upstream rewinds and rebases branches often.
109
110 # @ECLASS-VARIABLE: EGIT_NONBARE
111 # @DEFAULT_UNSET
112 # @DESCRIPTION:
113 # If non-empty this variable specifies that all checkouts will be done using
114 # non bare repositories. This is useful if you can't operate with bare
115 # checkouts for some reason.
116
117 # @ECLASS-VARIABLE: EGIT_NOUNPACK
118 # @DEFAULT_UNSET
119 # @DESCRIPTION:
120 # If non-empty this variable bans unpacking of ${A} content into the srcdir.
121 # Default behaviour is to unpack ${A} content.
122
123 # @FUNCTION: git-2_init_variables
124 # @INTERNAL
125 # @DESCRIPTION:
126 # Internal function initializing all git variables.
127 # We define it in function scope so user can define
128 # all the variables before and after inherit.
129 git-2_init_variables() {
130 debug-print-function ${FUNCNAME} "$@"
131
132 local esc_pn liverepo livebranch livecommit
133 esc_pn=${PN//[-+]/_}
134
135 : ${EGIT_SOURCEDIR="${S}"}
136
137 : ${EGIT_STORE_DIR:="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/egit-src"}
138
139 : ${EGIT_HAS_SUBMODULES:=}
140
141 : ${EGIT_OPTIONS:=}
142
143 : ${EGIT_MASTER:=master}
144
145 liverepo=${esc_pn}_LIVE_REPO
146 EGIT_REPO_URI=${!liverepo:-${EGIT_REPO_URI}}
147 [[ ${EGIT_REPO_URI} ]] || die "EGIT_REPO_URI must have some value"
148
149 : ${EVCS_OFFLINE:=}
150
151 livebranch=${esc_pn}_LIVE_BRANCH
152 [[ ${!livebranch} ]] && ewarn "QA: using \"${esc_pn}_LIVE_BRANCH\" variable, you won't get any support"
153 EGIT_BRANCH=${!livebranch:-${EGIT_BRANCH:-${EGIT_MASTER}}}
154
155 livecommit=${esc_pn}_LIVE_COMMIT
156 [[ ${!livecommit} ]] && ewarn "QA: using \"${esc_pn}_LIVE_COMMIT\" variable, you won't get any support"
157 EGIT_COMMIT=${!livecommit:-${EGIT_COMMIT:-${EGIT_BRANCH}}}
158
159 : ${EGIT_REPACK:=}
160
161 : ${EGIT_PRUNE:=}
162 }
163
164 # @FUNCTION: git-2_submodules
165 # @INTERNAL
166 # @DESCRIPTION:
167 # Internal function wrapping the submodule initialisation and update.
168 git-2_submodules() {
169 debug-print-function ${FUNCNAME} "$@"
170 if [[ ${EGIT_HAS_SUBMODULES} ]]; then
171 if [[ ${EVCS_OFFLINE} ]]; then
172 # for submodules operations we need to be online
173 debug-print "${FUNCNAME}: not updating submodules in offline mode"
174 return 1
175 fi
176
177 debug-print "${FUNCNAME}: working in \"${1}\""
178 pushd "${EGIT_DIR}" > /dev/null
179
180 debug-print "${FUNCNAME}: git submodule init"
181 git submodule init || die
182 debug-print "${FUNCNAME}: git submodule sync"
183 git submodule sync || die
184 debug-print "${FUNCNAME}: git submodule update"
185 git submodule update || die
186
187 popd > /dev/null
188 fi
189 }
190
191 # @FUNCTION: git-2_branch
192 # @INTERNAL
193 # @DESCRIPTION:
194 # Internal function that changes branch for the repo based on EGIT_COMMIT and
195 # EGIT_BRANCH variables.
196 git-2_branch() {
197 debug-print-function ${FUNCNAME} "$@"
198
199 local branchname src
200
201 debug-print "${FUNCNAME}: working in \"${EGIT_SOURCEDIR}\""
202 pushd "${EGIT_SOURCEDIR}" > /dev/null
203
204 local branchname=branch-${EGIT_BRANCH} src=origin/${EGIT_BRANCH}
205 if [[ ${EGIT_COMMIT} != ${EGIT_BRANCH} ]]; then
206 branchname=tree-${EGIT_COMMIT}
207 src=${EGIT_COMMIT}
208 fi
209 debug-print "${FUNCNAME}: git checkout -b ${branchname} ${src}"
210 git checkout -b ${branchname} ${src} \
211 || die "${FUNCNAME}: changing the branch failed"
212
213 popd > /dev/null
214 }
215
216 # @FUNCTION: git-2_gc
217 # @INTERNAL
218 # @DESCRIPTION:
219 # Internal function running garbage collector on checked out tree.
220 git-2_gc() {
221 debug-print-function ${FUNCNAME} "$@"
222
223 local args
224
225 if [[ ${EGIT_REPACK} || ${EGIT_PRUNE} ]]; then
226 pushd "${EGIT_DIR}" > /dev/null
227 ebegin "Garbage collecting the repository"
228 [[ ${EGIT_PRUNE} ]] && args='--prune'
229 debug-print "${FUNCNAME}: git gc ${args}"
230 git gc ${args}
231 eend $?
232 popd > /dev/null
233 fi
234 }
235
236 # @FUNCTION: git-2_prepare_storedir
237 # @INTERNAL
238 # @DESCRIPTION:
239 # Internal function preparing directory where we are going to store SCM
240 # repository.
241 git-2_prepare_storedir() {
242 debug-print-function ${FUNCNAME} "$@"
243
244 local clone_dir
245
246 # initial clone, we have to create master git storage directory and play
247 # nicely with sandbox
248 if [[ ! -d ${EGIT_STORE_DIR} ]]; then
249 debug-print "${FUNCNAME}: Creating git main storage directory"
250 addwrite /
251 mkdir -m 775 -p "${EGIT_STORE_DIR}" \
252 || die "${FUNCNAME}: can't mkdir \"${EGIT_STORE_DIR}\""
253 fi
254
255 # allow writing into EGIT_STORE_DIR
256 addwrite "${EGIT_STORE_DIR}"
257
258 # calculate git.eclass store dir for data
259 # We will try to clone the old repository,
260 # and we will remove it if we don't need it anymore.
261 EGIT_OLD_CLONE=
262 if [[ ${EGIT_STORE_DIR} == */egit-src ]]; then
263 local old_store_dir=${EGIT_STORE_DIR/%egit-src/git-src}
264 local old_location=${old_store_dir}/${EGIT_PROJECT:-${PN}}
265
266 if [[ -d ${old_location} ]]; then
267 EGIT_OLD_CLONE=${old_location}
268 # required to remove the old clone
269 addwrite "${old_store_dir}"
270 fi
271 fi
272
273 # calculate the proper store dir for data
274 # If user didn't specify the EGIT_DIR, we check if he did specify
275 # the EGIT_PROJECT or get the folder name from EGIT_REPO_URI.
276 EGIT_REPO_URI=${EGIT_REPO_URI%/}
277 if [[ ! ${EGIT_DIR} ]]; then
278 if [[ ${EGIT_PROJECT} ]]; then
279 clone_dir=${EGIT_PROJECT}
280 else
281 clone_dir=${EGIT_REPO_URI##*/}
282 fi
283 EGIT_DIR=${EGIT_STORE_DIR}/${clone_dir}
284
285 if [[ ${EGIT_OLD_CLONE} && ! -d ${EGIT_DIR} ]]; then
286 elog "${FUNCNAME}: ${CATEGORY}/${PF} will be cloned from old location."
287 elog "It will be necessary to rebuild the package to fetch updates."
288 EGIT_REPO_URI="${EGIT_OLD_CLONE} ${EGIT_REPO_URI}"
289 fi
290 fi
291 export EGIT_DIR=${EGIT_DIR}
292 debug-print "${FUNCNAME}: Storing the repo into \"${EGIT_DIR}\"."
293 }
294
295 # @FUNCTION: git-2_move_source
296 # @INTERNAL
297 # @DESCRIPTION:
298 # Internal function moving sources from the EGIT_DIR to EGIT_SOURCEDIR dir.
299 git-2_move_source() {
300 debug-print-function ${FUNCNAME} "$@"
301
302 debug-print "${FUNCNAME}: ${MOVE_COMMAND} \"${EGIT_DIR}\" \"${EGIT_SOURCEDIR}\""
303 pushd "${EGIT_DIR}" > /dev/null
304 mkdir -p "${EGIT_SOURCEDIR}" \
305 || die "${FUNCNAME}: failed to create ${EGIT_SOURCEDIR}"
306 ${MOVE_COMMAND} "${EGIT_SOURCEDIR}" \
307 || die "${FUNCNAME}: sync to \"${EGIT_SOURCEDIR}\" failed"
308 popd > /dev/null
309 }
310
311 # @FUNCTION: git-2_initial_clone
312 # @INTERNAL
313 # @DESCRIPTION:
314 # Internal function running initial clone on specified repo_uri.
315 git-2_initial_clone() {
316 debug-print-function ${FUNCNAME} "$@"
317
318 local repo_uri
319
320 EGIT_REPO_URI_SELECTED=""
321 for repo_uri in ${EGIT_REPO_URI}; do
322 debug-print "${FUNCNAME}: git clone ${EGIT_LOCAL_OPTIONS} \"${repo_uri}\" \"${EGIT_DIR}\""
323 if git clone ${EGIT_LOCAL_OPTIONS} "${repo_uri}" "${EGIT_DIR}"; then
324 # global variable containing the repo_name we will be using
325 debug-print "${FUNCNAME}: EGIT_REPO_URI_SELECTED=\"${repo_uri}\""
326 EGIT_REPO_URI_SELECTED="${repo_uri}"
327 break
328 fi
329 done
330
331 [[ ${EGIT_REPO_URI_SELECTED} ]] \
332 || die "${FUNCNAME}: can't fetch from ${EGIT_REPO_URI}"
333 }
334
335 # @FUNCTION: git-2_update_repo
336 # @INTERNAL
337 # @DESCRIPTION:
338 # Internal function running update command on specified repo_uri.
339 git-2_update_repo() {
340 debug-print-function ${FUNCNAME} "$@"
341
342 local repo_uri
343
344 if [[ ${EGIT_LOCAL_NONBARE} ]]; then
345 # checkout master branch and drop all other local branches
346 git checkout ${EGIT_MASTER} || die "${FUNCNAME}: can't checkout master branch ${EGIT_MASTER}"
347 for x in $(git branch | grep -v "* ${EGIT_MASTER}" | tr '\n' ' '); do
348 debug-print "${FUNCNAME}: git branch -D ${x}"
349 git branch -D ${x} > /dev/null
350 done
351 fi
352
353 EGIT_REPO_URI_SELECTED=""
354 for repo_uri in ${EGIT_REPO_URI}; do
355 # git urls might change, so reset it
356 git config remote.origin.url "${repo_uri}"
357
358 debug-print "${EGIT_UPDATE_CMD}"
359 if ${EGIT_UPDATE_CMD} > /dev/null; then
360 # global variable containing the repo_name we will be using
361 debug-print "${FUNCNAME}: EGIT_REPO_URI_SELECTED=\"${repo_uri}\""
362 EGIT_REPO_URI_SELECTED="${repo_uri}"
363 break
364 fi
365 done
366
367 [[ ${EGIT_REPO_URI_SELECTED} ]] \
368 || die "${FUNCNAME}: can't update from ${EGIT_REPO_URI}"
369 }
370
371 # @FUNCTION: git-2_fetch
372 # @INTERNAL
373 # @DESCRIPTION:
374 # Internal function fetching repository from EGIT_REPO_URI and storing it in
375 # specified EGIT_STORE_DIR.
376 git-2_fetch() {
377 debug-print-function ${FUNCNAME} "$@"
378
379 local oldsha cursha repo_type
380
381 [[ ${EGIT_LOCAL_NONBARE} ]] && repo_type="non-bare repository" || repo_type="bare repository"
382
383 if [[ ! -d ${EGIT_DIR} ]]; then
384 git-2_initial_clone
385 pushd "${EGIT_DIR}" > /dev/null
386 cursha=$(git rev-parse ${UPSTREAM_BRANCH})
387 echo "GIT NEW clone -->"
388 echo " repository: ${EGIT_REPO_URI_SELECTED}"
389 echo " at the commit: ${cursha}"
390
391 popd > /dev/null
392 elif [[ ${EVCS_OFFLINE} ]]; then
393 pushd "${EGIT_DIR}" > /dev/null
394 cursha=$(git rev-parse ${UPSTREAM_BRANCH})
395 echo "GIT offline update -->"
396 echo " repository: $(git config remote.origin.url)"
397 echo " at the commit: ${cursha}"
398 popd > /dev/null
399 else
400 pushd "${EGIT_DIR}" > /dev/null
401 oldsha=$(git rev-parse ${UPSTREAM_BRANCH})
402 git-2_update_repo
403 cursha=$(git rev-parse ${UPSTREAM_BRANCH})
404
405 # fetch updates
406 echo "GIT update -->"
407 echo " repository: ${EGIT_REPO_URI_SELECTED}"
408 # write out message based on the revisions
409 if [[ "${oldsha}" != "${cursha}" ]]; then
410 echo " updating from commit: ${oldsha}"
411 echo " to commit: ${cursha}"
412 else
413 echo " at the commit: ${cursha}"
414 fi
415
416 # print nice statistic of what was changed
417 git --no-pager diff --stat ${oldsha}..${UPSTREAM_BRANCH}
418 popd > /dev/null
419 fi
420 # export the version the repository is at
421 export EGIT_VERSION="${cursha}"
422 # log the repo state
423 [[ ${EGIT_COMMIT} != ${EGIT_BRANCH} ]] \
424 && echo " commit: ${EGIT_COMMIT}"
425 echo " branch: ${EGIT_BRANCH}"
426 echo " storage directory: \"${EGIT_DIR}\""
427 echo " checkout type: ${repo_type}"
428
429 # Cleanup after git.eclass
430 if [[ ${EGIT_OLD_CLONE} ]]; then
431 einfo "${FUNCNAME}: removing old clone in ${EGIT_OLD_CLONE}."
432 rm -rf "${EGIT_OLD_CLONE}"
433 fi
434 }
435
436 # @FUNCTION: git_bootstrap
437 # @INTERNAL
438 # @DESCRIPTION:
439 # Internal function that runs bootstrap command on unpacked source.
440 git-2_bootstrap() {
441 debug-print-function ${FUNCNAME} "$@"
442
443 # @ECLASS-VARIABLE: EGIT_BOOTSTRAP
444 # @DESCRIPTION:
445 # Command to be executed after checkout and clone of the specified
446 # repository.
447 # enviroment the package will fail if there is no update, thus in
448 # combination with --keep-going it would lead in not-updating
449 # pakcages that are up-to-date.
450 if [[ ${EGIT_BOOTSTRAP} ]]; then
451 pushd "${EGIT_SOURCEDIR}" > /dev/null
452 einfo "Starting bootstrap"
453
454 if [[ -f ${EGIT_BOOTSTRAP} ]]; then
455 # we have file in the repo which we should execute
456 debug-print "${FUNCNAME}: bootstraping with file \"${EGIT_BOOTSTRAP}\""
457
458 if [[ -x ${EGIT_BOOTSTRAP} ]]; then
459 eval "./${EGIT_BOOTSTRAP}" \
460 || die "${FUNCNAME}: bootstrap script failed"
461 else
462 eerror "\"${EGIT_BOOTSTRAP}\" is not executable."
463 eerror "Report upstream, or bug ebuild maintainer to remove bootstrap command."
464 die "\"${EGIT_BOOTSTRAP}\" is not executable"
465 fi
466 else
467 # we execute some system command
468 debug-print "${FUNCNAME}: bootstraping with commands \"${EGIT_BOOTSTRAP}\""
469
470 eval "${EGIT_BOOTSTRAP}" \
471 || die "${FUNCNAME}: bootstrap commands failed"
472 fi
473
474 einfo "Bootstrap finished"
475 popd > /dev/null
476 fi
477 }
478
479 # @FUNCTION: git-2_migrate_repository
480 # @INTERNAL
481 # @DESCRIPTION:
482 # Internal function migrating between bare and normal checkout repository.
483 # This is based on usage of EGIT_SUBMODULES, at least until they
484 # start to work with bare checkouts sanely.
485 # This function also set some global variables that differ between
486 # bare and non-bare checkout.
487 git-2_migrate_repository() {
488 debug-print-function ${FUNCNAME} "$@"
489
490 local bare returnstate
491
492 # first find out if we have submodules
493 # or user explicitly wants us to use non-bare clones
494 if ! [[ ${EGIT_HAS_SUBMODULES} || ${EGIT_NONBARE} ]]; then
495 bare=1
496 fi
497
498 # test if we already have some repo and if so find out if we have
499 # to migrate the data
500 if [[ -d ${EGIT_DIR} ]]; then
501 if [[ ${bare} && -d ${EGIT_DIR}/.git ]]; then
502 debug-print "${FUNCNAME}: converting \"${EGIT_DIR}\" to bare copy"
503
504 ebegin "Converting \"${EGIT_DIR}\" from non-bare to bare copy"
505 mv "${EGIT_DIR}/.git" "${EGIT_DIR}.bare"
506 export GIT_DIR="${EGIT_DIR}.bare"
507 git config core.bare true > /dev/null
508 returnstate=$?
509 unset GIT_DIR
510 rm -rf "${EGIT_DIR}"
511 mv "${EGIT_DIR}.bare" "${EGIT_DIR}"
512 eend ${returnstate}
513 elif [[ ! ${bare} && ! -d ${EGIT_DIR}/.git ]]; then
514 debug-print "${FUNCNAME}: converting \"${EGIT_DIR}\" to non-bare copy"
515
516 ebegin "Converting \"${EGIT_DIR}\" from bare to non-bare copy"
517 git clone -l "${EGIT_DIR}" "${EGIT_DIR}.nonbare" > /dev/null
518 returnstate=$?
519 rm -rf "${EGIT_DIR}"
520 mv "${EGIT_DIR}.nonbare" "${EGIT_DIR}"
521 eend ${returnstate}
522 fi
523 fi
524 if [[ ${returnstate} -ne 0 ]]; then
525 debug-print "${FUNCNAME}: converting \"${EGIT_DIR}\" failed, removing to start from scratch"
526
527 # migration failed, remove the EGIT_DIR to play it safe
528 einfo "Migration failed, removing \"${EGIT_DIR}\" to start from scratch."
529 rm -rf "${EGIT_DIR}"
530 fi
531
532 # set various options to work with both targets
533 if [[ ${bare} ]]; then
534 debug-print "${FUNCNAME}: working in bare repository for \"${EGIT_DIR}\""
535 EGIT_LOCAL_OPTIONS+="${EGIT_OPTIONS} --bare"
536 MOVE_COMMAND="git clone -l -s -n ${EGIT_DIR// /\\ }"
537 EGIT_UPDATE_CMD="git fetch -t -f -u origin ${EGIT_BRANCH}:${EGIT_BRANCH}"
538 UPSTREAM_BRANCH="${EGIT_BRANCH}"
539 EGIT_LOCAL_NONBARE=
540 else
541 debug-print "${FUNCNAME}: working in bare repository for non-bare \"${EGIT_DIR}\""
542 MOVE_COMMAND="cp -pPR ."
543 EGIT_LOCAL_OPTIONS="${EGIT_OPTIONS}"
544 EGIT_UPDATE_CMD="git pull -f -u ${EGIT_OPTIONS}"
545 UPSTREAM_BRANCH="origin/${EGIT_BRANCH}"
546 EGIT_LOCAL_NONBARE="true"
547 fi
548 }
549
550 # @FUNCTION: git-2_cleanup
551 # @INTERNAL
552 # @DESCRIPTION:
553 # Internal function cleaning up all the global variables
554 # that are not required after the unpack has been done.
555 git-2_cleanup() {
556 debug-print-function ${FUNCNAME} "$@"
557
558 # Here we can unset only variables that are GLOBAL
559 # defined by the eclass, BUT NOT subject to change
560 # by user (like EGIT_PROJECT).
561 # If ebuild writer polutes his environment it is
562 # his problem only.
563 unset EGIT_DIR
564 unset MOVE_COMMAND
565 unset EGIT_LOCAL_OPTIONS
566 unset EGIT_UPDATE_CMD
567 unset UPSTREAM_BRANCH
568 unset EGIT_LOCAL_NONBARE
569 }
570
571 # @FUNCTION: git-2_src_unpack
572 # @DESCRIPTION:
573 # Default git src_unpack function.
574 git-2_src_unpack() {
575 debug-print-function ${FUNCNAME} "$@"
576
577 git-2_init_variables
578 git-2_prepare_storedir
579 git-2_migrate_repository
580 git-2_fetch "$@"
581 git-2_gc
582 git-2_submodules
583 git-2_move_source
584 git-2_branch
585 git-2_bootstrap
586 git-2_cleanup
587 echo ">>> Unpacked to ${EGIT_SOURCEDIR}"
588
589 # Users can specify some SRC_URI and we should
590 # unpack the files too.
591 if [[ ! ${EGIT_NOUNPACK} ]]; then
592 if has ${EAPI:-0} 0 1; then
593 [[ ${A} ]] && unpack ${A}
594 else
595 default_src_unpack
596 fi
597 fi
598 }

  ViewVC Help
Powered by ViewVC 1.1.20