diff options
Diffstat (limited to 'eclass/subversion.eclass')
-rw-r--r-- | eclass/subversion.eclass | 55 |
1 files changed, 31 insertions, 24 deletions
diff --git a/eclass/subversion.eclass b/eclass/subversion.eclass index b0411f580f76..a6704a43128b 100644 --- a/eclass/subversion.eclass +++ b/eclass/subversion.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/subversion.eclass,v 1.24 2005/09/21 23:32:21 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/subversion.eclass,v 1.25 2005/12/24 14:18:18 hattya Exp $ ## --------------------------------------------------------------------------- # # Author: Akinori Hattori <hattya@gentoo.org> @@ -37,15 +37,18 @@ ESVN_STORE_DIR="${DISTDIR}/svn-src" ## -- ESVN_FETCH_CMD: subversion fetch command # -# default: svn checkout -# -[ -z "${ESVN_FETCH_CMD}" ] && ESVN_FETCH_CMD="svn checkout" +ESVN_FETCH_CMD="svn checkout" ## -- ESVN_UPDATE_CMD: subversion update command # -# default: svn update +ESVN_UPDATE_CMD="svn update" + + +## -- ESVN_OPTIONS: +# +# the options passed to checkout or update. # -[ -z "${ESVN_UPDATE_CMD}" ] && ESVN_UPDATE_CMD="svn update" +[ -z "${ESVN_OPTIONS}" ] && ESVN_OPTIONS= ## -- ESVN_REPO_URI: repository uri @@ -102,19 +105,21 @@ ESVN_STORE_DIR="${DISTDIR}/svn-src" function subversion_svn_fetch() { + local ESVN_CO_DIR + # ESVN_REPO_URI is empty. [ -z "${ESVN_REPO_URI}" ] && die "${ESVN}: ESVN_REPO_URI is empty." # check for the protocol. case ${ESVN_REPO_URI%%:*} in http|https) - if built_with_use dev-util/subversion nowebdav ; then + if built_with_use dev-util/subversion nowebdav; then eerror "In order to emerge this package, you need to" eerror "re-emerge subversion with USE=-nowebdav" die "Please run 'USE=-nowebdav emerge subversion'" fi ;; - svn) ;; + svn) ;; *) die "${ESVN}: fetch from "${ESVN_REPO_URI%:*}" is not yet implemented." ;; @@ -136,12 +141,21 @@ function subversion_svn_fetch() { addwrite "/etc/subversion" addwrite "${ESVN_STORE_DIR}" - # -userpriv - ! has userpriv ${FEATURE} && addwrite "/root/.subversion" + if ! has userpriv ${FEATURES}; then + # -userpriv + addwrite "/root/.subversion" + + else + # +userpriv + ESVN_OPTIONS="${ESVN_OPTIONS} --config-dir ${ESVN_STORE_DIR}/.subversion" + + fi [ -z "${ESVN_REPO_URI##*/}" ] && ESVN_REPO_URI="${ESVN_REPO_URI%/}" ESVN_CO_DIR="${ESVN_PROJECT}/${ESVN_REPO_URI##*/}" + debug-print "${FUNCNAME}: ESVN_OPTIONS = \"${ESVN_OPTIONS}\"" + if [ ! -d "${ESVN_CO_DIR}/.svn" ]; then # first check out einfo "subversion check out start -->" @@ -150,7 +164,7 @@ function subversion_svn_fetch() { mkdir -p "${ESVN_PROJECT}" || die "${ESVN}: can't mkdir ${ESVN_PROJECT}." chmod -f o+rw "${ESVN_PROJECT}" || die "${ESVN}: can't chmod ${ESVN_PROJECT}." cd "${ESVN_PROJECT}" - ${ESVN_FETCH_CMD} "${ESVN_REPO_URI}" || die "${ESVN}: can't fetch from ${ESVN_REPO_URI}." + ${ESVN_FETCH_CMD} ${ESVN_OPTIONS} "${ESVN_REPO_URI}" || die "${ESVN}: can't fetch from ${ESVN_REPO_URI}." einfo " checkouted in: ${ESVN_STORE_DIR}/${ESVN_CO_DIR}" @@ -158,24 +172,17 @@ function subversion_svn_fetch() { # update working copy einfo "subversion update start -->" einfo " update from: ${ESVN_REPO_URI}" - cd "${ESVN_CO_DIR}" - - local NOW=$(date +%s) UPDATE=$(date -r .svn/entries +%s) INTERVAL=3600 - if (( ${NOW} - ${UPDATE} > ${INTERVAL} )); then - ${ESVN_UPDATE_CMD} || die "${ESVN}: can't update from ${ESVN_REPO_URI}." - else - echo "Skip updating..." - - fi + cd "${ESVN_CO_DIR}" + ${ESVN_UPDATE_CMD} ${ESVN_OPTIONS} || die "${ESVN}: can't update from ${ESVN_REPO_URI}." einfo " updated in: ${ESVN_STORE_DIR}/${ESVN_CO_DIR}" fi - # copy to the ${WORKDIR} - cp -Rf "${ESVN_STORE_DIR}/${ESVN_CO_DIR}" "${S}" || die "${ESVN}: can't copy to ${S}." - einfo " copied to: ${S}" + # export to the ${WORKDIR} + svn export "${ESVN_STORE_DIR}/${ESVN_CO_DIR}" "${S}" || die "${ESVN}: can't exportto ${S}." + einfo " exported to: ${S}" echo } @@ -232,7 +239,7 @@ function subversion_bootstrap() { function subversion_src_unpack() { - if [[ -n ${A} ]] ; then + if [ -n "${A}" ]; then unpack ${A} fi |