summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2009-04-26 02:18:09 +0000
committerArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2009-04-26 02:18:09 +0000
commit3ff353854bf6c434b370d4852e82f84568ef809f (patch)
treeb5b42f047e124c43250f0d8a8485ef0cc9bd9e1b /eclass
parentRun 'svn cleanup' to automatically upgrade working copies. (diff)
downloadgentoo-2-3ff353854bf6c434b370d4852e82f84568ef809f.tar.gz
gentoo-2-3ff353854bf6c434b370d4852e82f84568ef809f.tar.bz2
gentoo-2-3ff353854bf6c434b370d4852e82f84568ef809f.zip
Support ESVN_USER and ESVN_PASSWORD variables.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/subversion.eclass34
1 files changed, 28 insertions, 6 deletions
diff --git a/eclass/subversion.eclass b/eclass/subversion.eclass
index db95b94b4dc9..2feada8ed5c0 100644
--- a/eclass/subversion.eclass
+++ b/eclass/subversion.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/subversion.eclass,v 1.62 2009/04/26 01:57:14 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/subversion.eclass,v 1.63 2009/04/26 02:18:09 arfrever Exp $
# @ECLASS: subversion.eclass
# @MAINTAINER:
@@ -77,6 +77,16 @@ ESVN_REPO_URI="${ESVN_REPO_URI:-}"
# Note: This should never be set in an ebuild!
ESVN_REVISION="${ESVN_REVISION:-}"
+# @ECLASS-VARIABLE: ESVN_USER
+# @DESCRIPTION:
+# User name
+ESVN_USER="${ESVN_USER:-}"
+
+# @ECLASS-VARIABLE: ESVN_PASSWORD
+# @DESCRIPTION:
+# Password
+ESVN_PASSWORD="${ESVN_PASSWORD:-}"
+
# @ECLASS-VARIABLE: ESVN_PROJECT
# @DESCRIPTION:
# project name of your ebuild (= name space)
@@ -171,7 +181,7 @@ subversion_fetch() {
case "${protocol}" in
http|https)
if ! built_with_use --missing true -o dev-util/subversion webdav-neon webdav-serf || \
- built_with_use --missing false dev-util/subversion nowebdav ; then
+ built_with_use --missing false dev-util/subversion nowebdav; then
echo
eerror "In order to emerge this package, you need to"
eerror "reinstall Subversion with support for WebDAV."
@@ -217,7 +227,7 @@ subversion_fetch() {
if [[ ! -d ${wc_path}/.svn ]]; then
if [[ -n ${ESVN_OFFLINE} ]]; then
- ewarn "ESVN_OFFLINE cannot be used when the there is no existing checkout."
+ ewarn "ESVN_OFFLINE cannot be used when there is no existing checkout."
fi
# first check out
einfo "subversion check out start -->"
@@ -227,7 +237,11 @@ subversion_fetch() {
mkdir -p "${ESVN_PROJECT}" || die "${ESVN}: can't mkdir ${ESVN_PROJECT}."
cd "${ESVN_PROJECT}" || die "${ESVN}: can't chdir to ${ESVN_PROJECT}"
- ${ESVN_FETCH_CMD} ${options} "${repo_uri}" || die "${ESVN}: can't fetch to ${wc_path} from ${repo_uri}."
+ if [[ -n "${ESVN_USER}" ]]; then
+ ${ESVN_FETCH_CMD} ${options} --username "${ESVN_USER}" --password "${ESVN_PASSWORD}" "${repo_uri}" || die "${ESVN}: can't fetch to ${wc_path} from ${repo_uri}."
+ else
+ ${ESVN_FETCH_CMD} ${options} "${repo_uri}" || die "${ESVN}: can't fetch to ${wc_path} from ${repo_uri}."
+ fi
elif [[ -n ${ESVN_OFFLINE} ]]; then
svn cleanup "${wc_path}"
@@ -260,7 +274,11 @@ subversion_fetch() {
debug-print "${FUNCNAME}: ${ESVN_SWITCH_CMD} ${options} ${repo_uri}"
cd "${wc_path}" || die "${ESVN}: can't chdir to ${wc_path}"
- ${ESVN_SWITCH_CMD} ${options} ${repo_uri} || die "${ESVN}: can't update ${wc_path} from ${repo_uri}"
+ if [[ -n "${ESVN_USER}" ]]; then
+ ${ESVN_SWITCH_CMD} ${options} --username "${ESVN_USER}" --password "${ESVN_PASSWORD}" ${repo_uri} || die "${ESVN}: can't update ${wc_path} from ${repo_uri}."
+ else
+ ${ESVN_SWITCH_CMD} ${options} ${repo_uri} || die "${ESVN}: can't update ${wc_path} from ${repo_uri}."
+ fi
else
# update working copy
einfo "subversion update start -->"
@@ -269,7 +287,11 @@ subversion_fetch() {
debug-print "${FUNCNAME}: ${ESVN_UPDATE_CMD} ${options}"
cd "${wc_path}" || die "${ESVN}: can't chdir to ${wc_path}"
- ${ESVN_UPDATE_CMD} ${options} || die "${ESVN}: can't update ${wc_path} from ${repo_uri}."
+ if [[ -n "${ESVN_USER}" ]]; then
+ ${ESVN_UPDATE_CMD} ${options} --username "${ESVN_USER}" --password "${ESVN_PASSWORD}" || die "${ESVN}: can't update ${wc_path} from ${repo_uri}."
+ else
+ ${ESVN_UPDATE_CMD} ${options} || die "${ESVN}: can't update ${wc_path} from ${repo_uri}."
+ fi
fi
fi
fi