/[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.16 Revision 1.24
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2011 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.16 2011/09/23 13:56:29 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/git-2.eclass,v 1.24 2011/09/23 13:58:58 mgorny Exp $
4 4
5# @ECLASS: git-2.eclass 5# @ECLASS: git-2.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Donnie Berkholz <dberkholz@gentoo.org> 7# Donnie Berkholz <dberkholz@gentoo.org>
8# @BLURB: Eclass for fetching and unpacking git repositories. 8# @BLURB: Eclass for fetching and unpacking git repositories.
118# @DESCRIPTION: 118# @DESCRIPTION:
119# If non-empty this variable bans unpacking of ${A} content into the srcdir. 119# If non-empty this variable bans unpacking of ${A} content into the srcdir.
120# Default behaviour is to unpack ${A} content. 120# Default behaviour is to unpack ${A} content.
121 121
122# @FUNCTION: git-2_init_variables 122# @FUNCTION: git-2_init_variables
123# @INTERNAL
123# @DESCRIPTION: 124# @DESCRIPTION:
124# Internal function initializing all git variables. 125# Internal function initializing all git variables.
125# We define it in function scope so user can define 126# We define it in function scope so user can define
126# all the variables before and after inherit. 127# all the variables before and after inherit.
127git-2_init_variables() { 128git-2_init_variables() {
140 141
141 : ${EGIT_MASTER:=master} 142 : ${EGIT_MASTER:=master}
142 143
143 liverepo=${esc_pn}_LIVE_REPO 144 liverepo=${esc_pn}_LIVE_REPO
144 EGIT_REPO_URI=${!liverepo:-${EGIT_REPO_URI}} 145 EGIT_REPO_URI=${!liverepo:-${EGIT_REPO_URI}}
145 [[ -z ${EGIT_REPO_URI} ]] && die "EGIT_REPO_URI must have some value" 146 [[ ${EGIT_REPO_URI} ]] || die "EGIT_REPO_URI must have some value"
146 147
147 : ${EVCS_OFFLINE:=} 148 : ${EVCS_OFFLINE:=}
148 149
149 livebranch=${esc_pn}_LIVE_BRANCH 150 livebranch=${esc_pn}_LIVE_BRANCH
150 [[ -n ${!livebranch} ]] && ewarn "QA: using \"${esc_pn}_LIVE_BRANCH\" variable, you won't get any support" 151 [[ ${!livebranch} ]] && ewarn "QA: using \"${esc_pn}_LIVE_BRANCH\" variable, you won't get any support"
151 EGIT_BRANCH=${!livebranch:-${EGIT_BRANCH:-${EGIT_MASTER}}} 152 EGIT_BRANCH=${!livebranch:-${EGIT_BRANCH:-${EGIT_MASTER}}}
152 153
153 livecommit=${esc_pn}_LIVE_COMMIT 154 livecommit=${esc_pn}_LIVE_COMMIT
154 [[ -n ${!livecommit} ]] && ewarn "QA: using \"${esc_pn}_LIVE_COMMIT\" variable, you won't get any support" 155 [[ ${!livecommit} ]] && ewarn "QA: using \"${esc_pn}_LIVE_COMMIT\" variable, you won't get any support"
155 EGIT_COMMIT=${!livecommit:-${EGIT_COMMIT:-${EGIT_BRANCH}}} 156 EGIT_COMMIT=${!livecommit:-${EGIT_COMMIT:-${EGIT_BRANCH}}}
156 157
157 : ${EGIT_REPACK:=} 158 : ${EGIT_REPACK:=}
158 159
159 : ${EGIT_PRUNE:=} 160 : ${EGIT_PRUNE:=}
160} 161}
161 162
162# @FUNCTION: git-2_submodules 163# @FUNCTION: git-2_submodules
164# @INTERNAL
163# @DESCRIPTION: 165# @DESCRIPTION:
164# Internal function wrapping the submodule initialisation and update. 166# Internal function wrapping the submodule initialisation and update.
165git-2_submodules() { 167git-2_submodules() {
166 debug-print-function ${FUNCNAME} "$@" 168 debug-print-function ${FUNCNAME} "$@"
167 if [[ -n ${EGIT_HAS_SUBMODULES} ]]; then 169 if [[ ${EGIT_HAS_SUBMODULES} ]]; then
168 if [[ -n ${EVCS_OFFLINE} ]]; then 170 if [[ ${EVCS_OFFLINE} ]]; then
169 # for submodules operations we need to be online 171 # for submodules operations we need to be online
170 debug-print "${FUNCNAME}: not updating submodules in offline mode" 172 debug-print "${FUNCNAME}: not updating submodules in offline mode"
171 return 1 173 return 1
172 fi 174 fi
173 175
184 popd > /dev/null 186 popd > /dev/null
185 fi 187 fi
186} 188}
187 189
188# @FUNCTION: git-2_branch 190# @FUNCTION: git-2_branch
191# @INTERNAL
189# @DESCRIPTION: 192# @DESCRIPTION:
190# Internal function that changes branch for the repo based on EGIT_COMMIT and 193# Internal function that changes branch for the repo based on EGIT_COMMIT and
191# EGIT_BRANCH variables. 194# EGIT_BRANCH variables.
192git-2_branch() { 195git-2_branch() {
193 debug-print-function ${FUNCNAME} "$@" 196 debug-print-function ${FUNCNAME} "$@"
208 211
209 popd > /dev/null 212 popd > /dev/null
210} 213}
211 214
212# @FUNCTION: git-2_gc 215# @FUNCTION: git-2_gc
216# @INTERNAL
213# @DESCRIPTION: 217# @DESCRIPTION:
214# Internal function running garbage collector on checked out tree. 218# Internal function running garbage collector on checked out tree.
215git-2_gc() { 219git-2_gc() {
216 debug-print-function ${FUNCNAME} "$@" 220 debug-print-function ${FUNCNAME} "$@"
217 221
218 local args 222 local args
219 223
224 if [[ ${EGIT_REPACK} || ${EGIT_PRUNE} ]]; then
220 pushd "${EGIT_DIR}" > /dev/null 225 pushd "${EGIT_DIR}" > /dev/null
221 if [[ -n ${EGIT_REPACK} || -n ${EGIT_PRUNE} ]]; then
222 ebegin "Garbage collecting the repository" 226 ebegin "Garbage collecting the repository"
223 [[ -n ${EGIT_PRUNE} ]] && args='--prune' 227 [[ ${EGIT_PRUNE} ]] && args='--prune'
224 debug-print "${FUNCNAME}: git gc ${args}" 228 debug-print "${FUNCNAME}: git gc ${args}"
225 git gc ${args} 229 git gc ${args}
226 eend $? 230 eend $?
227 fi
228 popd > /dev/null 231 popd > /dev/null
232 fi
229} 233}
230 234
231# @FUNCTION: git-2_prepare_storedir 235# @FUNCTION: git-2_prepare_storedir
236# @INTERNAL
232# @DESCRIPTION: 237# @DESCRIPTION:
233# Internal function preparing directory where we are going to store SCM 238# Internal function preparing directory where we are going to store SCM
234# repository. 239# repository.
235git-2_prepare_storedir() { 240git-2_prepare_storedir() {
236 debug-print-function ${FUNCNAME} "$@" 241 debug-print-function ${FUNCNAME} "$@"
250 addwrite "${EGIT_STORE_DIR}" 255 addwrite "${EGIT_STORE_DIR}"
251 # calculate the proper store dir for data 256 # calculate the proper store dir for data
252 # If user didn't specify the EGIT_DIR, we check if he did specify 257 # 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. 258 # the EGIT_PROJECT or get the folder name from EGIT_REPO_URI.
254 EGIT_REPO_URI=${EGIT_REPO_URI%/} 259 EGIT_REPO_URI=${EGIT_REPO_URI%/}
255 if [[ -z ${EGIT_DIR} ]]; then 260 if [[ ! ${EGIT_DIR} ]]; then
256 if [[ -n ${EGIT_PROJECT} ]]; then 261 if [[ ${EGIT_PROJECT} ]]; then
257 clone_dir=${EGIT_PROJECT} 262 clone_dir=${EGIT_PROJECT}
258 else 263 else
259 clone_dir=${EGIT_REPO_URI##*/} 264 clone_dir=${EGIT_REPO_URI##*/}
260 fi 265 fi
261 EGIT_DIR=${EGIT_STORE_DIR}/${clone_dir} 266 EGIT_DIR=${EGIT_STORE_DIR}/${clone_dir}
267
268 # Try to migrate from git.eclass git-src/
269 if [[ ! -d ${EGIT_DIR} && ${EGIT_STORE_DIR} == */egit-src ]]; then
270 local old_store_dir=${EGIT_STORE_DIR/%egit-src/git-src}
271 local old_location=${old_store_dir}/${EGIT_PROJECT:-${PN}}
272
273 if [[ -d ${old_location} ]]; then
274 elog "${FUNCNAME}: ${CATEGORY}/${PF} will be cloned from old location."
275 elog "It will be necessary to rebuild the package to fetch updates."
276 EGIT_REPO_URI="${old_location} ${EGIT_REPO_URI}"
277 fi
278 fi
262 fi 279 fi
263 export EGIT_DIR=${EGIT_DIR} 280 export EGIT_DIR=${EGIT_DIR}
264 debug-print "${FUNCNAME}: Storing the repo into \"${EGIT_DIR}\"." 281 debug-print "${FUNCNAME}: Storing the repo into \"${EGIT_DIR}\"."
265} 282}
266 283
267# @FUNCTION: git-2_move_source 284# @FUNCTION: git-2_move_source
285# @INTERNAL
268# @DESCRIPTION: 286# @DESCRIPTION:
269# Internal function moving sources from the EGIT_DIR to EGIT_SOURCEDIR dir. 287# Internal function moving sources from the EGIT_DIR to EGIT_SOURCEDIR dir.
270git-2_move_source() { 288git-2_move_source() {
271 debug-print-function ${FUNCNAME} "$@" 289 debug-print-function ${FUNCNAME} "$@"
272 290
278 || die "${FUNCNAME}: sync to \"${EGIT_SOURCEDIR}\" failed" 296 || die "${FUNCNAME}: sync to \"${EGIT_SOURCEDIR}\" failed"
279 popd > /dev/null 297 popd > /dev/null
280} 298}
281 299
282# @FUNCTION: git-2_initial_clone 300# @FUNCTION: git-2_initial_clone
301# @INTERNAL
283# @DESCRIPTION: 302# @DESCRIPTION:
284# Internal function running initial clone on specified repo_uri. 303# Internal function running initial clone on specified repo_uri.
285git-2_initial_clone() { 304git-2_initial_clone() {
286 debug-print-function ${FUNCNAME} "$@" 305 debug-print-function ${FUNCNAME} "$@"
287 306
288 local repo_uri 307 local repo_uri
289 308
290 EGIT_REPO_URI_SELECTED="" 309 EGIT_REPO_URI_SELECTED=""
291 for repo_uri in ${EGIT_REPO_URI}; do 310 for repo_uri in ${EGIT_REPO_URI}; do
292 debug-print "${FUNCNAME}: git clone ${EGIT_LOCAL_OPTIONS} \"${repo_uri}\" \"${EGIT_DIR}\"" 311 debug-print "${FUNCNAME}: git clone ${EGIT_LOCAL_OPTIONS} \"${repo_uri}\" \"${EGIT_DIR}\""
293 git clone ${EGIT_LOCAL_OPTIONS} "${repo_uri}" "${EGIT_DIR}" 312 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 313 # global variable containing the repo_name we will be using
296 debug-print "${FUNCNAME}: EGIT_REPO_URI_SELECTED=\"${repo_uri}\"" 314 debug-print "${FUNCNAME}: EGIT_REPO_URI_SELECTED=\"${repo_uri}\""
297 EGIT_REPO_URI_SELECTED="${repo_uri}" 315 EGIT_REPO_URI_SELECTED="${repo_uri}"
298 break 316 break
299 fi 317 fi
300 done 318 done
301 319
302 if [[ -z ${EGIT_REPO_URI_SELECTED} ]]; then 320 [[ ${EGIT_REPO_URI_SELECTED} ]] \
303 die "${FUNCNAME}: can't fetch from ${EGIT_REPO_URI}" 321 || die "${FUNCNAME}: can't fetch from ${EGIT_REPO_URI}"
304 fi
305} 322}
306 323
307# @FUNCTION: git-2_update_repo 324# @FUNCTION: git-2_update_repo
325# @INTERNAL
308# @DESCRIPTION: 326# @DESCRIPTION:
309# Internal function running update command on specified repo_uri. 327# Internal function running update command on specified repo_uri.
310git-2_update_repo() { 328git-2_update_repo() {
311 debug-print-function ${FUNCNAME} "$@" 329 debug-print-function ${FUNCNAME} "$@"
312 330
313 local repo_uri 331 local repo_uri
314 332
315 if [[ -n ${EGIT_LOCAL_NONBARE} ]]; then 333 if [[ ${EGIT_LOCAL_NONBARE} ]]; then
316 # checkout master branch and drop all other local branches 334 # checkout master branch and drop all other local branches
317 git checkout ${EGIT_MASTER} || die "${FUNCNAME}: can't checkout master branch ${EGIT_MASTER}" 335 git checkout ${EGIT_MASTER} || die "${FUNCNAME}: can't checkout master branch ${EGIT_MASTER}"
318 for x in $(git branch | grep -v "* ${EGIT_MASTER}" | tr '\n' ' '); do 336 for x in $(git branch | grep -v "* ${EGIT_MASTER}" | tr '\n' ' '); do
319 debug-print "${FUNCNAME}: git branch -D ${x}" 337 debug-print "${FUNCNAME}: git branch -D ${x}"
320 git branch -D ${x} > /dev/null 338 git branch -D ${x} > /dev/null
325 for repo_uri in ${EGIT_REPO_URI}; do 343 for repo_uri in ${EGIT_REPO_URI}; do
326 # git urls might change, so reset it 344 # git urls might change, so reset it
327 git config remote.origin.url "${repo_uri}" 345 git config remote.origin.url "${repo_uri}"
328 346
329 debug-print "${EGIT_UPDATE_CMD}" 347 debug-print "${EGIT_UPDATE_CMD}"
330 ${EGIT_UPDATE_CMD} > /dev/null 348 if ${EGIT_UPDATE_CMD} > /dev/null; then
331 if [[ $? -eq 0 ]]; then
332 # global variable containing the repo_name we will be using 349 # global variable containing the repo_name we will be using
333 debug-print "${FUNCNAME}: EGIT_REPO_URI_SELECTED=\"${repo_uri}\"" 350 debug-print "${FUNCNAME}: EGIT_REPO_URI_SELECTED=\"${repo_uri}\""
334 EGIT_REPO_URI_SELECTED="${repo_uri}" 351 EGIT_REPO_URI_SELECTED="${repo_uri}"
335 break 352 break
336 fi 353 fi
337 done 354 done
338 355
339 if [[ -z ${EGIT_REPO_URI_SELECTED} ]]; then 356 [[ ${EGIT_REPO_URI_SELECTED} ]] \
340 die "${FUNCNAME}: can't update from ${EGIT_REPO_URI}" 357 || die "${FUNCNAME}: can't update from ${EGIT_REPO_URI}"
341 fi
342} 358}
343 359
344# @FUNCTION: git-2_fetch 360# @FUNCTION: git-2_fetch
361# @INTERNAL
345# @DESCRIPTION: 362# @DESCRIPTION:
346# Internal function fetching repository from EGIT_REPO_URI and storing it in 363# Internal function fetching repository from EGIT_REPO_URI and storing it in
347# specified EGIT_STORE_DIR. 364# specified EGIT_STORE_DIR.
348git-2_fetch() { 365git-2_fetch() {
349 debug-print-function ${FUNCNAME} "$@" 366 debug-print-function ${FUNCNAME} "$@"
350 367
351 local oldsha cursha repo_type 368 local oldsha cursha repo_type
352 369
353 [[ -n ${EGIT_LOCAL_NONBARE} ]] && repo_type="non-bare repository" || repo_type="bare repository" 370 [[ ${EGIT_LOCAL_NONBARE} ]] && repo_type="non-bare repository" || repo_type="bare repository"
354 371
355 if [[ ! -d ${EGIT_DIR} ]]; then 372 if [[ ! -d ${EGIT_DIR} ]]; then
356 git-2_initial_clone 373 git-2_initial_clone
357 pushd "${EGIT_DIR}" > /dev/null 374 pushd "${EGIT_DIR}" > /dev/null
358 cursha=$(git rev-parse ${UPSTREAM_BRANCH}) 375 cursha=$(git rev-parse ${UPSTREAM_BRANCH})
359 echo "GIT NEW clone -->" 376 echo "GIT NEW clone -->"
360 echo " repository: ${EGIT_REPO_URI_SELECTED}" 377 echo " repository: ${EGIT_REPO_URI_SELECTED}"
361 echo " at the commit: ${cursha}" 378 echo " at the commit: ${cursha}"
362 379
363 popd > /dev/null 380 popd > /dev/null
364 elif [[ -n ${EVCS_OFFLINE} ]]; then 381 elif [[ ${EVCS_OFFLINE} ]]; then
365 pushd "${EGIT_DIR}" > /dev/null 382 pushd "${EGIT_DIR}" > /dev/null
366 cursha=$(git rev-parse ${UPSTREAM_BRANCH}) 383 cursha=$(git rev-parse ${UPSTREAM_BRANCH})
367 echo "GIT offline update -->" 384 echo "GIT offline update -->"
368 echo " repository: $(git config remote.origin.url)" 385 echo " repository: $(git config remote.origin.url)"
369 echo " at the commit: ${cursha}" 386 echo " at the commit: ${cursha}"
398 echo " storage directory: \"${EGIT_DIR}\"" 415 echo " storage directory: \"${EGIT_DIR}\""
399 echo " checkout type: ${repo_type}" 416 echo " checkout type: ${repo_type}"
400} 417}
401 418
402# @FUNCTION: git_bootstrap 419# @FUNCTION: git_bootstrap
420# @INTERNAL
403# @DESCRIPTION: 421# @DESCRIPTION:
404# Internal function that runs bootstrap command on unpacked source. 422# Internal function that runs bootstrap command on unpacked source.
405git-2_bootstrap() { 423git-2_bootstrap() {
406 debug-print-function ${FUNCNAME} "$@" 424 debug-print-function ${FUNCNAME} "$@"
407 425
410 # Command to be executed after checkout and clone of the specified 428 # Command to be executed after checkout and clone of the specified
411 # repository. 429 # repository.
412 # enviroment the package will fail if there is no update, thus in 430 # enviroment the package will fail if there is no update, thus in
413 # combination with --keep-going it would lead in not-updating 431 # combination with --keep-going it would lead in not-updating
414 # pakcages that are up-to-date. 432 # pakcages that are up-to-date.
415 if [[ -n ${EGIT_BOOTSTRAP} ]]; then 433 if [[ ${EGIT_BOOTSTRAP} ]]; then
416 pushd "${EGIT_SOURCEDIR}" > /dev/null 434 pushd "${EGIT_SOURCEDIR}" > /dev/null
417 einfo "Starting bootstrap" 435 einfo "Starting bootstrap"
418 436
419 if [[ -f ${EGIT_BOOTSTRAP} ]]; then 437 if [[ -f ${EGIT_BOOTSTRAP} ]]; then
420 # we have file in the repo which we should execute 438 # we have file in the repo which we should execute
440 popd > /dev/null 458 popd > /dev/null
441 fi 459 fi
442} 460}
443 461
444# @FUNCTION: git-2_migrate_repository 462# @FUNCTION: git-2_migrate_repository
463# @INTERNAL
445# @DESCRIPTION: 464# @DESCRIPTION:
446# Internal function migrating between bare and normal checkout repository. 465# Internal function migrating between bare and normal checkout repository.
447# This is based on usage of EGIT_SUBMODULES, at least until they 466# This is based on usage of EGIT_SUBMODULES, at least until they
448# start to work with bare checkouts sanely. 467# start to work with bare checkouts sanely.
449# This function also set some global variables that differ between 468# This function also set some global variables that differ between
450# bare and non-bare checkout. 469# bare and non-bare checkout.
451git-2_migrate_repository() { 470git-2_migrate_repository() {
452 debug-print-function ${FUNCNAME} "$@" 471 debug-print-function ${FUNCNAME} "$@"
453 472
454 local target returnstate 473 local bare returnstate
455 474
456 # first find out if we have submodules 475 # first find out if we have submodules
476 # or user explicitly wants us to use non-bare clones
457 if [[ -z ${EGIT_HAS_SUBMODULES} ]]; then 477 if ! [[ ${EGIT_HAS_SUBMODULES} || ${EGIT_NONBARE} ]]; then
458 target="bare" 478 bare=1
459 else
460 target="full"
461 fi
462 # check if user didn't specify that we want non-bare repo
463 if [[ -n ${EGIT_NONBARE} ]]; then
464 target="full"
465 EGIT_LOCAL_NONBARE="true"
466 fi 479 fi
467 480
468 # test if we already have some repo and if so find out if we have 481 # test if we already have some repo and if so find out if we have
469 # to migrate the data 482 # to migrate the data
470 if [[ -d ${EGIT_DIR} ]]; then 483 if [[ -d ${EGIT_DIR} ]]; then
471 if [[ ${target} == bare && -d ${EGIT_DIR}/.git ]]; then 484 if [[ ${bare} && -d ${EGIT_DIR}/.git ]]; then
472 debug-print "${FUNCNAME}: converting \"${EGIT_DIR}\" to bare copy" 485 debug-print "${FUNCNAME}: converting \"${EGIT_DIR}\" to bare copy"
473 486
474 ebegin "Converting \"${EGIT_DIR}\" from non-bare to bare copy" 487 ebegin "Converting \"${EGIT_DIR}\" from non-bare to bare copy"
475 mv "${EGIT_DIR}/.git" "${EGIT_DIR}.bare" 488 mv "${EGIT_DIR}/.git" "${EGIT_DIR}.bare"
476 export GIT_DIR="${EGIT_DIR}.bare" 489 export GIT_DIR="${EGIT_DIR}.bare"
478 returnstate=$? 491 returnstate=$?
479 unset GIT_DIR 492 unset GIT_DIR
480 rm -rf "${EGIT_DIR}" 493 rm -rf "${EGIT_DIR}"
481 mv "${EGIT_DIR}.bare" "${EGIT_DIR}" 494 mv "${EGIT_DIR}.bare" "${EGIT_DIR}"
482 eend ${returnstate} 495 eend ${returnstate}
483 fi
484 if [[ ${target} == full && ! -d ${EGIT_DIR}/.git ]]; then 496 elif [[ ! ${bare} && ! -d ${EGIT_DIR}/.git ]]; then
485 debug-print "${FUNCNAME}: converting \"${EGIT_DIR}\" to non-bare copy" 497 debug-print "${FUNCNAME}: converting \"${EGIT_DIR}\" to non-bare copy"
486 498
487 ebegin "Converting \"${EGIT_DIR}\" from bare to non-bare copy" 499 ebegin "Converting \"${EGIT_DIR}\" from bare to non-bare copy"
488 git clone -l "${EGIT_DIR}" "${EGIT_DIR}.nonbare" > /dev/null 500 git clone -l "${EGIT_DIR}" "${EGIT_DIR}.nonbare" > /dev/null
489 returnstate=$? 501 returnstate=$?
499 einfo "Migration failed, removing \"${EGIT_DIR}\" to start from scratch." 511 einfo "Migration failed, removing \"${EGIT_DIR}\" to start from scratch."
500 rm -rf "${EGIT_DIR}" 512 rm -rf "${EGIT_DIR}"
501 fi 513 fi
502 514
503 # set various options to work with both targets 515 # set various options to work with both targets
504 if [[ ${target} == bare ]]; then 516 if [[ ${bare} ]]; then
505 debug-print "${FUNCNAME}: working in bare repository for \"${EGIT_DIR}\"" 517 debug-print "${FUNCNAME}: working in bare repository for \"${EGIT_DIR}\""
506 EGIT_LOCAL_OPTIONS+="${EGIT_OPTIONS} --bare" 518 EGIT_LOCAL_OPTIONS+="${EGIT_OPTIONS} --bare"
507 MOVE_COMMAND="git clone -l -s -n ${EGIT_DIR// /\\ }" 519 MOVE_COMMAND="git clone -l -s -n ${EGIT_DIR// /\\ }"
508 EGIT_UPDATE_CMD="git fetch -t -f -u origin ${EGIT_BRANCH}:${EGIT_BRANCH}" 520 EGIT_UPDATE_CMD="git fetch -t -f -u origin ${EGIT_BRANCH}:${EGIT_BRANCH}"
509 UPSTREAM_BRANCH="${EGIT_BRANCH}" 521 UPSTREAM_BRANCH="${EGIT_BRANCH}"
522 EGIT_LOCAL_NONBARE=
510 else 523 else
511 debug-print "${FUNCNAME}: working in bare repository for non-bare \"${EGIT_DIR}\"" 524 debug-print "${FUNCNAME}: working in bare repository for non-bare \"${EGIT_DIR}\""
512 MOVE_COMMAND="cp -pPR ." 525 MOVE_COMMAND="cp -pPR ."
513 EGIT_LOCAL_OPTIONS="${EGIT_OPTIONS}" 526 EGIT_LOCAL_OPTIONS="${EGIT_OPTIONS}"
514 EGIT_UPDATE_CMD="git pull -f -u ${EGIT_OPTIONS}" 527 EGIT_UPDATE_CMD="git pull -f -u ${EGIT_OPTIONS}"
516 EGIT_LOCAL_NONBARE="true" 529 EGIT_LOCAL_NONBARE="true"
517 fi 530 fi
518} 531}
519 532
520# @FUNCTION: git-2_cleanup 533# @FUNCTION: git-2_cleanup
534# @INTERNAL
521# @DESCRIPTION: 535# @DESCRIPTION:
522# Internal function cleaning up all the global variables 536# Internal function cleaning up all the global variables
523# that are not required after the unpack has been done. 537# that are not required after the unpack has been done.
524git-2_cleanup() { 538git-2_cleanup() {
525 debug-print-function ${FUNCNAME} "$@" 539 debug-print-function ${FUNCNAME} "$@"
555 git-2_cleanup 569 git-2_cleanup
556 echo ">>> Unpacked to ${EGIT_SOURCEDIR}" 570 echo ">>> Unpacked to ${EGIT_SOURCEDIR}"
557 571
558 # Users can specify some SRC_URI and we should 572 # Users can specify some SRC_URI and we should
559 # unpack the files too. 573 # unpack the files too.
560 if [[ -z ${EGIT_NOUNPACK} ]]; then 574 if [[ ! ${EGIT_NOUNPACK} ]]; then
561 if has ${EAPI:-0} 0 1; then 575 if has ${EAPI:-0} 0 1; then
562 [[ -n ${A} ]] && unpack ${A} 576 [[ ${A} ]] && unpack ${A}
563 else 577 else
564 default_src_unpack 578 default_src_unpack
565 fi 579 fi
566 fi 580 fi
567} 581}

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.24

  ViewVC Help
Powered by ViewVC 1.1.20