| 1 | # Copyright 1999-2006 Gentoo Foundation |
1 | # Copyright 1999-2006 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.eclass,v 1.10 2008/03/30 05:52:27 robbat2 Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/git.eclass,v 1.12 2008/06/15 17:47:57 zlin Exp $ |
| 4 | |
4 | |
| 5 | ## --------------------------------------------------------------------------- # |
5 | ## --------------------------------------------------------------------------- # |
| 6 | # subversion.eclass author: Akinori Hattori <hattya@gentoo.org> |
6 | # subversion.eclass author: Akinori Hattori <hattya@gentoo.org> |
| 7 | # modified for git by Donnie Berkholz <spyderous@gentoo.org> |
7 | # modified for git by Donnie Berkholz <spyderous@gentoo.org> |
| 8 | # improved by Fernando J. Pereda <ferdy@gentoo.org> |
8 | # improved by Fernando J. Pereda <ferdy@gentoo.org> |
| … | |
… | |
| 174 | if [[ ! -d ${EGIT_STORE_DIR} ]] ; then |
174 | if [[ ! -d ${EGIT_STORE_DIR} ]] ; then |
| 175 | debug-print "${FUNCNAME}: initial clone. creating git directory" |
175 | debug-print "${FUNCNAME}: initial clone. creating git directory" |
| 176 | addwrite / |
176 | addwrite / |
| 177 | mkdir -p "${EGIT_STORE_DIR}" \ |
177 | mkdir -p "${EGIT_STORE_DIR}" \ |
| 178 | || die "${EGIT}: can't mkdir ${EGIT_STORE_DIR}." |
178 | || die "${EGIT}: can't mkdir ${EGIT_STORE_DIR}." |
| 179 | chmod -f o+rw "${EGIT_STORE_DIR}" \ |
|
|
| 180 | || die "${EGIT}: can't chmod ${EGIT_STORE_DIR}." |
|
|
| 181 | export SANDBOX_WRITE="${SANDBOX_WRITE%%:/}" |
179 | export SANDBOX_WRITE="${SANDBOX_WRITE%%:/}" |
| 182 | fi |
180 | fi |
| 183 | |
181 | |
| 184 | cd -P "${EGIT_STORE_DIR}" || die "${EGIT}: can't chdir to ${EGIT_STORE_DIR}" |
182 | cd -P "${EGIT_STORE_DIR}" || die "${EGIT}: can't chdir to ${EGIT_STORE_DIR}" |
| 185 | EGIT_STORE_DIR=${PWD} |
183 | EGIT_STORE_DIR=${PWD} |
| … | |
… | |
| 190 | [[ -z ${EGIT_REPO_URI##*/} ]] && EGIT_REPO_URI="${EGIT_REPO_URI%/}" |
188 | [[ -z ${EGIT_REPO_URI##*/} ]] && EGIT_REPO_URI="${EGIT_REPO_URI%/}" |
| 191 | EGIT_CLONE_DIR="${EGIT_PROJECT}" |
189 | EGIT_CLONE_DIR="${EGIT_PROJECT}" |
| 192 | |
190 | |
| 193 | debug-print "${FUNCNAME}: EGIT_OPTIONS = \"${EGIT_OPTIONS}\"" |
191 | debug-print "${FUNCNAME}: EGIT_OPTIONS = \"${EGIT_OPTIONS}\"" |
| 194 | |
192 | |
| 195 | export GIT_DIR="${EGIT_CLONE_DIR}" |
193 | export GIT_DIR="${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" |
| 196 | |
194 | |
| 197 | if [[ ! -d ${EGIT_CLONE_DIR} ]] ; then |
195 | if [[ ! -d ${EGIT_CLONE_DIR} ]] ; then |
| 198 | # first clone |
196 | # first clone |
| 199 | einfo "git clone start -->" |
197 | einfo "git clone start -->" |
| 200 | einfo " repository: ${EGIT_REPO_URI}" |
198 | einfo " repository: ${EGIT_REPO_URI}" |