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

Diff of /eclass/git-r3.eclass

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

Revision 1.47 Revision 1.48
1# Copyright 1999-2014 Gentoo Foundation 1# Copyright 1999-2015 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-r3.eclass,v 1.47 2014/07/28 14:13:50 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/git-r3.eclass,v 1.48 2015/02/04 09:44:24 ulm Exp $
4 4
5# @ECLASS: git-r3.eclass 5# @ECLASS: git-r3.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Michał Górny <mgorny@gentoo.org> 7# Michał Górny <mgorny@gentoo.org>
8# @BLURB: Eclass for fetching and unpacking git repositories. 8# @BLURB: Eclass for fetching and unpacking git repositories.
128 128
129# @ECLASS-VARIABLE: EVCS_OFFLINE 129# @ECLASS-VARIABLE: EVCS_OFFLINE
130# @DEFAULT_UNSET 130# @DEFAULT_UNSET
131# @DESCRIPTION: 131# @DESCRIPTION:
132# If non-empty, this variable prevents any online operations. 132# If non-empty, this variable prevents any online operations.
133
134# @ECLASS-VARIABLE: EVCS_UMASK
135# @DEFAULT_UNSET
136# @DESCRIPTION:
137# Set this variable to a custom umask. This is intended to be set by
138# users. By setting this to something like 002, it can make life easier
139# for people who do development as non-root (but are in the portage
140# group), and then switch over to building with FEATURES=userpriv.
141# Or vice-versa. Shouldn't be a security issue here as anyone who has
142# portage group write access already can screw the system over in more
143# creative ways.
133 144
134# @ECLASS-VARIABLE: EGIT_BRANCH 145# @ECLASS-VARIABLE: EGIT_BRANCH
135# @DEFAULT_UNSET 146# @DEFAULT_UNSET
136# @DESCRIPTION: 147# @DESCRIPTION:
137# The branch name to check out. If unset, the upstream default (HEAD) 148# The branch name to check out. If unset, the upstream default (HEAD)
307 ) || die "Unable to create ${EGIT3_STORE_DIR}" 318 ) || die "Unable to create ${EGIT3_STORE_DIR}"
308 fi 319 fi
309 320
310 addwrite "${EGIT3_STORE_DIR}" 321 addwrite "${EGIT3_STORE_DIR}"
311 if [[ ! -d ${GIT_DIR} ]]; then 322 if [[ ! -d ${GIT_DIR} ]]; then
323 local saved_umask
324 if [[ ${EVCS_UMASK} ]]; then
325 saved_umask=$(umask)
326 umask "${EVCS_UMASK}" || die "Bad options to umask: ${EVCS_UMASK}"
327 fi
312 mkdir "${GIT_DIR}" || die 328 mkdir "${GIT_DIR}" || die
313 git init --bare || die 329 git init --bare || die
330 if [[ ${saved_umask} ]]; then
331 umask "${saved_umask}" || die
332 fi
314 fi 333 fi
315} 334}
316 335
317# @FUNCTION: _git-r3_set_submodules 336# @FUNCTION: _git-r3_set_submodules
318# @USAGE: <file-contents> 337# @USAGE: <file-contents>
505 "${repos[@]}" 524 "${repos[@]}"
506 ) 525 )
507 fi 526 fi
508 527
509 # try to fetch from the remote 528 # try to fetch from the remote
510 local r success 529 local r success saved_umask
530 if [[ ${EVCS_UMASK} ]]; then
531 saved_umask=$(umask)
532 umask "${EVCS_UMASK}" || die "Bad options to umask: ${EVCS_UMASK}"
533 fi
511 for r in "${repos[@]}"; do 534 for r in "${repos[@]}"; do
512 einfo "Fetching ${r} ..." 535 einfo "Fetching ${r} ..."
513 536
514 local fetch_command=( git fetch "${r}" ) 537 local fetch_command=( git fetch "${r}" )
515 local clone_type=${EGIT_CLONE_TYPE} 538 local clone_type=${EGIT_CLONE_TYPE}
666 689
667 success=1 690 success=1
668 break 691 break
669 fi 692 fi
670 done 693 done
694 if [[ ${saved_umask} ]]; then
695 umask "${saved_umask}" || die
696 fi
671 [[ ${success} ]] || die "Unable to fetch from any of EGIT_REPO_URI" 697 [[ ${success} ]] || die "Unable to fetch from any of EGIT_REPO_URI"
672 698
673 # submodules can reference commits in any branch 699 # submodules can reference commits in any branch
674 # always use the 'clone' mode to accomodate that, bug #503332 700 # always use the 'clone' mode to accomodate that, bug #503332
675 local EGIT_CLONE_TYPE=mirror 701 local EGIT_CLONE_TYPE=mirror

Legend:
Removed from v.1.47  
changed lines
  Added in v.1.48

  ViewVC Help
Powered by ViewVC 1.1.20