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

Diff of /eclass/git-2.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.17 Revision 1.32
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2013 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/git-2.eclass,v 1.17 2011/09/23 13:57:15 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/git-2.eclass,v 1.32 2013/09/08 22:54:24 mgorny Exp $
4 4
5# @ECLASS: git-2.eclass 5# @ECLASS: git-2.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Michał Górny <mgorny@gentoo.org>
7# Donnie Berkholz <dberkholz@gentoo.org> 8# Donnie Berkholz <dberkholz@gentoo.org>
8# @BLURB: Eclass for fetching and unpacking git repositories. 9# @BLURB: Eclass for fetching and unpacking git repositories.
9# @DESCRIPTION: 10# @DESCRIPTION:
10# Eclass for easing maitenance of live ebuilds using git as remote repository. 11# Eclass for easing maitenance of live ebuilds using git as remote repository.
11# Eclass support working with git submodules and branching. 12# Eclass support working with git submodules and branching.
13
14# @ECLASS-VARIABLE: EGIT_USE_GIT_R3
15# @DEFAULT_UNSET
16# @DESCRIPTION:
17# Use git-r3 backend instead of classic git-2 behavior. This is intended
18# for early testing of git-r3 and is to be set in make.conf.
19
20# (since we override src_unpack this doesn't hurt)
21inherit git-r3
12 22
13# This eclass support all EAPIs 23# This eclass support all EAPIs
14EXPORT_FUNCTIONS src_unpack 24EXPORT_FUNCTIONS src_unpack
15 25
16DEPEND="dev-vcs/git" 26DEPEND="dev-vcs/git"
66# @DEFAULT_UNSET 76# @DEFAULT_UNSET
67# @DESCRIPTION: 77# @DESCRIPTION:
68# URI for the repository 78# URI for the repository
69# e.g. http://foo, git://bar 79# e.g. http://foo, git://bar
70# 80#
81# It can be overriden via env using packagename_LIVE_REPO
82# variable.
83#
71# Support multiple values: 84# Support multiple values:
72# EGIT_REPO_URI="git://a/b.git http://c/d.git" 85# EGIT_REPO_URI="git://a/b.git http://c/d.git"
73 86
74# @ECLASS-VARIABLE: EVCS_OFFLINE 87# @ECLASS-VARIABLE: EVCS_OFFLINE
75# @DEFAULT_UNSET 88# @DEFAULT_UNSET
118# @DESCRIPTION: 131# @DESCRIPTION:
119# If non-empty this variable bans unpacking of ${A} content into the srcdir. 132# If non-empty this variable bans unpacking of ${A} content into the srcdir.
120# Default behaviour is to unpack ${A} content. 133# Default behaviour is to unpack ${A} content.
121 134
122# @FUNCTION: git-2_init_variables 135# @FUNCTION: git-2_init_variables
136# @INTERNAL
123# @DESCRIPTION: 137# @DESCRIPTION:
124# Internal function initializing all git variables. 138# Internal function initializing all git variables.
125# We define it in function scope so user can define 139# We define it in function scope so user can define
126# all the variables before and after inherit. 140# all the variables before and after inherit.
127git-2_init_variables() { 141git-2_init_variables() {
158 172
159 : ${EGIT_PRUNE:=} 173 : ${EGIT_PRUNE:=}
160} 174}
161 175
162# @FUNCTION: git-2_submodules 176# @FUNCTION: git-2_submodules
177# @INTERNAL
163# @DESCRIPTION: 178# @DESCRIPTION:
164# Internal function wrapping the submodule initialisation and update. 179# Internal function wrapping the submodule initialisation and update.
165git-2_submodules() { 180git-2_submodules() {
166 debug-print-function ${FUNCNAME} "$@" 181 debug-print-function ${FUNCNAME} "$@"
167 if [[ ${EGIT_HAS_SUBMODULES} ]]; then 182 if [[ ${EGIT_HAS_SUBMODULES} ]]; then
184 popd > /dev/null 199 popd > /dev/null
185 fi 200 fi
186} 201}
187 202
188# @FUNCTION: git-2_branch 203# @FUNCTION: git-2_branch
204# @INTERNAL
189# @DESCRIPTION: 205# @DESCRIPTION:
190# Internal function that changes branch for the repo based on EGIT_COMMIT and 206# Internal function that changes branch for the repo based on EGIT_COMMIT and
191# EGIT_BRANCH variables. 207# EGIT_BRANCH variables.
192git-2_branch() { 208git-2_branch() {
193 debug-print-function ${FUNCNAME} "$@" 209 debug-print-function ${FUNCNAME} "$@"
208 224
209 popd > /dev/null 225 popd > /dev/null
210} 226}
211 227
212# @FUNCTION: git-2_gc 228# @FUNCTION: git-2_gc
229# @INTERNAL
213# @DESCRIPTION: 230# @DESCRIPTION:
214# Internal function running garbage collector on checked out tree. 231# Internal function running garbage collector on checked out tree.
215git-2_gc() { 232git-2_gc() {
216 debug-print-function ${FUNCNAME} "$@" 233 debug-print-function ${FUNCNAME} "$@"
217 234
218 local args 235 local args
219 236
220 pushd "${EGIT_DIR}" > /dev/null
221 if [[ ${EGIT_REPACK} || ${EGIT_PRUNE} ]]; then 237 if [[ ${EGIT_REPACK} || ${EGIT_PRUNE} ]]; then
238 pushd "${EGIT_DIR}" > /dev/null
222 ebegin "Garbage collecting the repository" 239 ebegin "Garbage collecting the repository"
223 [[ ${EGIT_PRUNE} ]] && args='--prune' 240 [[ ${EGIT_PRUNE} ]] && args='--prune'
224 debug-print "${FUNCNAME}: git gc ${args}" 241 debug-print "${FUNCNAME}: git gc ${args}"
225 git gc ${args} 242 git gc ${args}
226 eend $? 243 eend $?
227 fi
228 popd > /dev/null 244 popd > /dev/null
245 fi
229} 246}
230 247
231# @FUNCTION: git-2_prepare_storedir 248# @FUNCTION: git-2_prepare_storedir
249# @INTERNAL
232# @DESCRIPTION: 250# @DESCRIPTION:
233# Internal function preparing directory where we are going to store SCM 251# Internal function preparing directory where we are going to store SCM
234# repository. 252# repository.
235git-2_prepare_storedir() { 253git-2_prepare_storedir() {
236 debug-print-function ${FUNCNAME} "$@" 254 debug-print-function ${FUNCNAME} "$@"
240 # initial clone, we have to create master git storage directory and play 258 # initial clone, we have to create master git storage directory and play
241 # nicely with sandbox 259 # nicely with sandbox
242 if [[ ! -d ${EGIT_STORE_DIR} ]]; then 260 if [[ ! -d ${EGIT_STORE_DIR} ]]; then
243 debug-print "${FUNCNAME}: Creating git main storage directory" 261 debug-print "${FUNCNAME}: Creating git main storage directory"
244 addwrite / 262 addwrite /
245 mkdir -p "${EGIT_STORE_DIR}" \ 263 mkdir -m 775 -p "${EGIT_STORE_DIR}" \
246 || die "${FUNCNAME}: can't mkdir \"${EGIT_STORE_DIR}\"" 264 || die "${FUNCNAME}: can't mkdir \"${EGIT_STORE_DIR}\""
247 fi 265 fi
248 266
249 # allow writing into EGIT_STORE_DIR 267 # allow writing into EGIT_STORE_DIR
250 addwrite "${EGIT_STORE_DIR}" 268 addwrite "${EGIT_STORE_DIR}"
269
270 # calculate git.eclass store dir for data
271 # We will try to clone the old repository,
272 # and we will remove it if we don't need it anymore.
273 EGIT_OLD_CLONE=
274 if [[ ${EGIT_STORE_DIR} == */egit-src ]]; then
275 local old_store_dir=${EGIT_STORE_DIR/%egit-src/git-src}
276 local old_location=${old_store_dir}/${EGIT_PROJECT:-${PN}}
277
278 if [[ -d ${old_location} ]]; then
279 EGIT_OLD_CLONE=${old_location}
280 # required to remove the old clone
281 addwrite "${old_store_dir}"
282 fi
283 fi
284
251 # calculate the proper store dir for data 285 # calculate the proper store dir for data
252 # If user didn't specify the EGIT_DIR, we check if he did specify 286 # If user didn't specify the EGIT_DIR, we check if he did specify
253 # the EGIT_PROJECT or get the folder name from EGIT_REPO_URI. 287 # the EGIT_PROJECT or get the folder name from EGIT_REPO_URI.
254 EGIT_REPO_URI=${EGIT_REPO_URI%/} 288 EGIT_REPO_URI=${EGIT_REPO_URI%/}
255 if [[ ! ${EGIT_DIR} ]]; then 289 if [[ ! ${EGIT_DIR} ]]; then
256 if [[ ${EGIT_PROJECT} ]]; then 290 if [[ ${EGIT_PROJECT} ]]; then
257 clone_dir=${EGIT_PROJECT} 291 clone_dir=${EGIT_PROJECT}
258 else 292 else
259 clone_dir=${EGIT_REPO_URI##*/} 293 local strippeduri=${EGIT_REPO_URI%/.git}
294 clone_dir=${strippeduri##*/}
260 fi 295 fi
261 EGIT_DIR=${EGIT_STORE_DIR}/${clone_dir} 296 EGIT_DIR=${EGIT_STORE_DIR}/${clone_dir}
297
298 if [[ ${EGIT_OLD_CLONE} && ! -d ${EGIT_DIR} ]]; then
299 elog "${FUNCNAME}: ${CATEGORY}/${PF} will be cloned from old location."
300 elog "It will be necessary to rebuild the package to fetch updates."
301 EGIT_REPO_URI="${EGIT_OLD_CLONE} ${EGIT_REPO_URI}"
302 fi
262 fi 303 fi
263 export EGIT_DIR=${EGIT_DIR} 304 export EGIT_DIR=${EGIT_DIR}
264 debug-print "${FUNCNAME}: Storing the repo into \"${EGIT_DIR}\"." 305 debug-print "${FUNCNAME}: Storing the repo into \"${EGIT_DIR}\"."
265} 306}
266 307
267# @FUNCTION: git-2_move_source 308# @FUNCTION: git-2_move_source
309# @INTERNAL
268# @DESCRIPTION: 310# @DESCRIPTION:
269# Internal function moving sources from the EGIT_DIR to EGIT_SOURCEDIR dir. 311# Internal function moving sources from the EGIT_DIR to EGIT_SOURCEDIR dir.
270git-2_move_source() { 312git-2_move_source() {
271 debug-print-function ${FUNCNAME} "$@" 313 debug-print-function ${FUNCNAME} "$@"
272 314
278 || die "${FUNCNAME}: sync to \"${EGIT_SOURCEDIR}\" failed" 320 || die "${FUNCNAME}: sync to \"${EGIT_SOURCEDIR}\" failed"
279 popd > /dev/null 321 popd > /dev/null
280} 322}
281 323
282# @FUNCTION: git-2_initial_clone 324# @FUNCTION: git-2_initial_clone
325# @INTERNAL
283# @DESCRIPTION: 326# @DESCRIPTION:
284# Internal function running initial clone on specified repo_uri. 327# Internal function running initial clone on specified repo_uri.
285git-2_initial_clone() { 328git-2_initial_clone() {
286 debug-print-function ${FUNCNAME} "$@" 329 debug-print-function ${FUNCNAME} "$@"
287 330
288 local repo_uri 331 local repo_uri
289 332
290 EGIT_REPO_URI_SELECTED="" 333 EGIT_REPO_URI_SELECTED=""
291 for repo_uri in ${EGIT_REPO_URI}; do 334 for repo_uri in ${EGIT_REPO_URI}; do
292 debug-print "${FUNCNAME}: git clone ${EGIT_LOCAL_OPTIONS} \"${repo_uri}\" \"${EGIT_DIR}\"" 335 debug-print "${FUNCNAME}: git clone ${EGIT_LOCAL_OPTIONS} \"${repo_uri}\" \"${EGIT_DIR}\""
293 git clone ${EGIT_LOCAL_OPTIONS} "${repo_uri}" "${EGIT_DIR}" 336 if git clone ${EGIT_LOCAL_OPTIONS} "${repo_uri}" "${EGIT_DIR}"; then
294 if [[ $? -eq 0 ]]; then
295 # global variable containing the repo_name we will be using 337 # global variable containing the repo_name we will be using
296 debug-print "${FUNCNAME}: EGIT_REPO_URI_SELECTED=\"${repo_uri}\"" 338 debug-print "${FUNCNAME}: EGIT_REPO_URI_SELECTED=\"${repo_uri}\""
297 EGIT_REPO_URI_SELECTED="${repo_uri}" 339 EGIT_REPO_URI_SELECTED="${repo_uri}"
298 break 340 break
299 fi 341 fi
302 [[ ${EGIT_REPO_URI_SELECTED} ]] \ 344 [[ ${EGIT_REPO_URI_SELECTED} ]] \
303 || die "${FUNCNAME}: can't fetch from ${EGIT_REPO_URI}" 345 || die "${FUNCNAME}: can't fetch from ${EGIT_REPO_URI}"
304} 346}
305 347
306# @FUNCTION: git-2_update_repo 348# @FUNCTION: git-2_update_repo
349# @INTERNAL
307# @DESCRIPTION: 350# @DESCRIPTION:
308# Internal function running update command on specified repo_uri. 351# Internal function running update command on specified repo_uri.
309git-2_update_repo() { 352git-2_update_repo() {
310 debug-print-function ${FUNCNAME} "$@" 353 debug-print-function ${FUNCNAME} "$@"
311 354
324 for repo_uri in ${EGIT_REPO_URI}; do 367 for repo_uri in ${EGIT_REPO_URI}; do
325 # git urls might change, so reset it 368 # git urls might change, so reset it
326 git config remote.origin.url "${repo_uri}" 369 git config remote.origin.url "${repo_uri}"
327 370
328 debug-print "${EGIT_UPDATE_CMD}" 371 debug-print "${EGIT_UPDATE_CMD}"
329 ${EGIT_UPDATE_CMD} > /dev/null 372 if ${EGIT_UPDATE_CMD} > /dev/null; then
330 if [[ $? -eq 0 ]]; then
331 # global variable containing the repo_name we will be using 373 # global variable containing the repo_name we will be using
332 debug-print "${FUNCNAME}: EGIT_REPO_URI_SELECTED=\"${repo_uri}\"" 374 debug-print "${FUNCNAME}: EGIT_REPO_URI_SELECTED=\"${repo_uri}\""
333 EGIT_REPO_URI_SELECTED="${repo_uri}" 375 EGIT_REPO_URI_SELECTED="${repo_uri}"
334 break 376 break
335 fi 377 fi
338 [[ ${EGIT_REPO_URI_SELECTED} ]] \ 380 [[ ${EGIT_REPO_URI_SELECTED} ]] \
339 || die "${FUNCNAME}: can't update from ${EGIT_REPO_URI}" 381 || die "${FUNCNAME}: can't update from ${EGIT_REPO_URI}"
340} 382}
341 383
342# @FUNCTION: git-2_fetch 384# @FUNCTION: git-2_fetch
385# @INTERNAL
343# @DESCRIPTION: 386# @DESCRIPTION:
344# Internal function fetching repository from EGIT_REPO_URI and storing it in 387# Internal function fetching repository from EGIT_REPO_URI and storing it in
345# specified EGIT_STORE_DIR. 388# specified EGIT_STORE_DIR.
346git-2_fetch() { 389git-2_fetch() {
347 debug-print-function ${FUNCNAME} "$@" 390 debug-print-function ${FUNCNAME} "$@"
393 [[ ${EGIT_COMMIT} != ${EGIT_BRANCH} ]] \ 436 [[ ${EGIT_COMMIT} != ${EGIT_BRANCH} ]] \
394 && echo " commit: ${EGIT_COMMIT}" 437 && echo " commit: ${EGIT_COMMIT}"
395 echo " branch: ${EGIT_BRANCH}" 438 echo " branch: ${EGIT_BRANCH}"
396 echo " storage directory: \"${EGIT_DIR}\"" 439 echo " storage directory: \"${EGIT_DIR}\""
397 echo " checkout type: ${repo_type}" 440 echo " checkout type: ${repo_type}"
441
442 # Cleanup after git.eclass
443 if [[ ${EGIT_OLD_CLONE} ]]; then
444 einfo "${FUNCNAME}: removing old clone in ${EGIT_OLD_CLONE}."
445 rm -rf "${EGIT_OLD_CLONE}"
446 fi
398} 447}
399 448
400# @FUNCTION: git_bootstrap 449# @FUNCTION: git_bootstrap
450# @INTERNAL
401# @DESCRIPTION: 451# @DESCRIPTION:
402# Internal function that runs bootstrap command on unpacked source. 452# Internal function that runs bootstrap command on unpacked source.
403git-2_bootstrap() { 453git-2_bootstrap() {
404 debug-print-function ${FUNCNAME} "$@" 454 debug-print-function ${FUNCNAME} "$@"
405 455
438 popd > /dev/null 488 popd > /dev/null
439 fi 489 fi
440} 490}
441 491
442# @FUNCTION: git-2_migrate_repository 492# @FUNCTION: git-2_migrate_repository
493# @INTERNAL
443# @DESCRIPTION: 494# @DESCRIPTION:
444# Internal function migrating between bare and normal checkout repository. 495# Internal function migrating between bare and normal checkout repository.
445# This is based on usage of EGIT_SUBMODULES, at least until they 496# This is based on usage of EGIT_SUBMODULES, at least until they
446# start to work with bare checkouts sanely. 497# start to work with bare checkouts sanely.
447# This function also set some global variables that differ between 498# This function also set some global variables that differ between
448# bare and non-bare checkout. 499# bare and non-bare checkout.
449git-2_migrate_repository() { 500git-2_migrate_repository() {
450 debug-print-function ${FUNCNAME} "$@" 501 debug-print-function ${FUNCNAME} "$@"
451 502
452 local target returnstate 503 local bare returnstate
453 504
454 # first find out if we have submodules 505 # first find out if we have submodules
506 # or user explicitly wants us to use non-bare clones
455 if [[ ! ${EGIT_HAS_SUBMODULES} ]]; then 507 if ! [[ ${EGIT_HAS_SUBMODULES} || ${EGIT_NONBARE} ]]; then
456 target="bare" 508 bare=1
457 else
458 target="full"
459 fi
460 # check if user didn't specify that we want non-bare repo
461 if [[ ${EGIT_NONBARE} ]]; then
462 target="full"
463 EGIT_LOCAL_NONBARE="true"
464 fi 509 fi
465 510
466 # test if we already have some repo and if so find out if we have 511 # test if we already have some repo and if so find out if we have
467 # to migrate the data 512 # to migrate the data
468 if [[ -d ${EGIT_DIR} ]]; then 513 if [[ -d ${EGIT_DIR} ]]; then
469 if [[ ${target} == bare && -d ${EGIT_DIR}/.git ]]; then 514 if [[ ${bare} && -d ${EGIT_DIR}/.git ]]; then
470 debug-print "${FUNCNAME}: converting \"${EGIT_DIR}\" to bare copy" 515 debug-print "${FUNCNAME}: converting \"${EGIT_DIR}\" to bare copy"
471 516
472 ebegin "Converting \"${EGIT_DIR}\" from non-bare to bare copy" 517 ebegin "Converting \"${EGIT_DIR}\" from non-bare to bare copy"
473 mv "${EGIT_DIR}/.git" "${EGIT_DIR}.bare" 518 mv "${EGIT_DIR}/.git" "${EGIT_DIR}.bare"
474 export GIT_DIR="${EGIT_DIR}.bare" 519 export GIT_DIR="${EGIT_DIR}.bare"
476 returnstate=$? 521 returnstate=$?
477 unset GIT_DIR 522 unset GIT_DIR
478 rm -rf "${EGIT_DIR}" 523 rm -rf "${EGIT_DIR}"
479 mv "${EGIT_DIR}.bare" "${EGIT_DIR}" 524 mv "${EGIT_DIR}.bare" "${EGIT_DIR}"
480 eend ${returnstate} 525 eend ${returnstate}
481 fi
482 if [[ ${target} == full && ! -d ${EGIT_DIR}/.git ]]; then 526 elif [[ ! ${bare} && ! -d ${EGIT_DIR}/.git ]]; then
483 debug-print "${FUNCNAME}: converting \"${EGIT_DIR}\" to non-bare copy" 527 debug-print "${FUNCNAME}: converting \"${EGIT_DIR}\" to non-bare copy"
484 528
485 ebegin "Converting \"${EGIT_DIR}\" from bare to non-bare copy" 529 ebegin "Converting \"${EGIT_DIR}\" from bare to non-bare copy"
486 git clone -l "${EGIT_DIR}" "${EGIT_DIR}.nonbare" > /dev/null 530 git clone -l "${EGIT_DIR}" "${EGIT_DIR}.nonbare" > /dev/null
487 returnstate=$? 531 returnstate=$?
497 einfo "Migration failed, removing \"${EGIT_DIR}\" to start from scratch." 541 einfo "Migration failed, removing \"${EGIT_DIR}\" to start from scratch."
498 rm -rf "${EGIT_DIR}" 542 rm -rf "${EGIT_DIR}"
499 fi 543 fi
500 544
501 # set various options to work with both targets 545 # set various options to work with both targets
502 if [[ ${target} == bare ]]; then 546 if [[ ${bare} ]]; then
503 debug-print "${FUNCNAME}: working in bare repository for \"${EGIT_DIR}\"" 547 debug-print "${FUNCNAME}: working in bare repository for \"${EGIT_DIR}\""
504 EGIT_LOCAL_OPTIONS+="${EGIT_OPTIONS} --bare" 548 EGIT_LOCAL_OPTIONS+="${EGIT_OPTIONS} --bare"
505 MOVE_COMMAND="git clone -l -s -n ${EGIT_DIR// /\\ }" 549 MOVE_COMMAND="git clone -l -s -n ${EGIT_DIR// /\\ }"
506 EGIT_UPDATE_CMD="git fetch -t -f -u origin ${EGIT_BRANCH}:${EGIT_BRANCH}" 550 EGIT_UPDATE_CMD="git fetch -t -f -u origin ${EGIT_BRANCH}:${EGIT_BRANCH}"
507 UPSTREAM_BRANCH="${EGIT_BRANCH}" 551 UPSTREAM_BRANCH="${EGIT_BRANCH}"
552 EGIT_LOCAL_NONBARE=
508 else 553 else
509 debug-print "${FUNCNAME}: working in bare repository for non-bare \"${EGIT_DIR}\"" 554 debug-print "${FUNCNAME}: working in bare repository for non-bare \"${EGIT_DIR}\""
510 MOVE_COMMAND="cp -pPR ." 555 MOVE_COMMAND="cp -pPR ."
511 EGIT_LOCAL_OPTIONS="${EGIT_OPTIONS}" 556 EGIT_LOCAL_OPTIONS="${EGIT_OPTIONS}"
512 EGIT_UPDATE_CMD="git pull -f -u ${EGIT_OPTIONS}" 557 EGIT_UPDATE_CMD="git pull -f -u ${EGIT_OPTIONS}"
514 EGIT_LOCAL_NONBARE="true" 559 EGIT_LOCAL_NONBARE="true"
515 fi 560 fi
516} 561}
517 562
518# @FUNCTION: git-2_cleanup 563# @FUNCTION: git-2_cleanup
564# @INTERNAL
519# @DESCRIPTION: 565# @DESCRIPTION:
520# Internal function cleaning up all the global variables 566# Internal function cleaning up all the global variables
521# that are not required after the unpack has been done. 567# that are not required after the unpack has been done.
522git-2_cleanup() { 568git-2_cleanup() {
523 debug-print-function ${FUNCNAME} "$@" 569 debug-print-function ${FUNCNAME} "$@"
533 unset EGIT_UPDATE_CMD 579 unset EGIT_UPDATE_CMD
534 unset UPSTREAM_BRANCH 580 unset UPSTREAM_BRANCH
535 unset EGIT_LOCAL_NONBARE 581 unset EGIT_LOCAL_NONBARE
536} 582}
537 583
584git-2_r3_wrapper() {
585 ewarn "Using git-r3 backend in git-2. Not everything is supported."
586 ewarn "Expect random failures and have fun testing."
587
588 if [[ ${EGIT_SOURCEDIR} ]]; then
589 EGIT_CHECKOUT_DIR=${EGIT_SOURCEDIR}
590 unset EGIT_SOURCEDIR
591 fi
592
593 if [[ ${EGIT_MASTER} ]]; then
594 : ${EGIT_BRANCH:=${EGIT_MASTER}}
595 unset EGIT_MASTER
596 fi
597
598 if [[ ${EGIT_HAS_SUBMODULES} ]]; then
599 unset EGIT_HAS_SUBMODULES
600 fi
601
602 if [[ ${EGIT_PROJECT} ]]; then
603 unset EGIT_PROJECT
604 fi
605
606 local boots unp
607 if [[ ${EGIT_NOUNPACK} ]]; then
608 unp=1
609 unset EGIT_NOUNPACK
610 fi
611
612 if [[ ${EGIT_BOOTSTRAP} ]]; then
613 boots=1
614 unset EGIT_BOOTSTRAP
615 fi
616
617 git-r3_src_unpack
618
619 [[ ${boots} ]] && EGIT_BOOTSTRAP=${boots} git-2_bootstrap
620 [[ ${unp} ]] && EGIT_NOUNPACK=1
621}
622
538# @FUNCTION: git-2_src_unpack 623# @FUNCTION: git-2_src_unpack
539# @DESCRIPTION: 624# @DESCRIPTION:
540# Default git src_unpack function. 625# Default git src_unpack function.
541git-2_src_unpack() { 626git-2_src_unpack() {
542 debug-print-function ${FUNCNAME} "$@" 627 debug-print-function ${FUNCNAME} "$@"
543 628
629 if [[ ${EGIT_USE_GIT_R3} ]]; then
630 git-2_r3_wrapper
631 else
544 git-2_init_variables 632 git-2_init_variables
545 git-2_prepare_storedir 633 git-2_prepare_storedir
546 git-2_migrate_repository 634 git-2_migrate_repository
547 git-2_fetch "$@" 635 git-2_fetch "$@"
548 git-2_gc 636 git-2_gc
549 git-2_submodules 637 git-2_submodules
550 git-2_move_source 638 git-2_move_source
551 git-2_branch 639 git-2_branch
552 git-2_bootstrap 640 git-2_bootstrap
553 git-2_cleanup 641 git-2_cleanup
554 echo ">>> Unpacked to ${EGIT_SOURCEDIR}" 642 echo ">>> Unpacked to ${EGIT_SOURCEDIR}"
643 fi
555 644
556 # Users can specify some SRC_URI and we should 645 # Users can specify some SRC_URI and we should
557 # unpack the files too. 646 # unpack the files too.
558 if [[ ! ${EGIT_NOUNPACK} ]]; then 647 if [[ ! ${EGIT_NOUNPACK} ]]; then
559 if has ${EAPI:-0} 0 1; then 648 if has ${EAPI:-0} 0 1; then

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.32

  ViewVC Help
Powered by ViewVC 1.1.20