summaryrefslogtreecommitdiffstats
path: root/db-functions
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2012-10-27 14:32:39 +0200
committerPierre Schmitz <pierre@archlinux.de>2012-10-27 14:39:47 +0200
commitb2952784db9995ecc21d3a770530a19394234d3b (patch)
tree8fedbc5d9b3c309554a45aaf31d414332e28adf0 /db-functions
parenta539598c640caa92e2b1967949836d73c5264036 (diff)
downloaddbscripts-b2952784db9995ecc21d3a770530a19394234d3b.tar.gz
dbscripts-b2952784db9995ecc21d3a770530a19394234d3b.tar.xz
Add the possibility to run all svn commands with a different user
* A SVNUSER can be configured in the config file * This user needs to be able to call svn without a password
Diffstat (limited to 'db-functions')
-rw-r--r--db-functions12
1 files changed, 10 insertions, 2 deletions
diff --git a/db-functions b/db-functions
index e3485d3..b9d0d2f 100644
--- a/db-functions
+++ b/db-functions
@@ -347,7 +347,7 @@ check_pkgsvn() {
if [ ! -f "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}" ]; then
mkdir -p "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}"
- svn export -q "${SVNREPO}/${_pkgbase}/repos/${repo}-${_pkgarch}/PKGBUILD" \
+ arch_svn export -q "${SVNREPO}/${_pkgbase}/repos/${repo}-${_pkgarch}/PKGBUILD" \
"${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}" >/dev/null
[ $? -ge 1 ] && return 1
fi
@@ -382,7 +382,7 @@ check_splitpkgs() {
if [ ! -f "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}" ]; then
mkdir -p "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}"
- svn export -q "${SVNREPO}/${_pkgbase}/repos/${repo}-${_pkgarch}/PKGBUILD" \
+ arch_svn export -q "${SVNREPO}/${_pkgbase}/repos/${repo}-${_pkgarch}/PKGBUILD" \
"${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}" >/dev/null
[ $? -ge 1 ] && return 1
fi
@@ -504,3 +504,11 @@ arch_repo_remove() {
|| error "repo-remove ${filesfile} ${pkgs[@]}"
set_repo_permission "${repo}" "${arch}"
}
+
+arch_svn() {
+ if [ -z "${SVNUSER}" ]; then
+ /usr/bin/svn "${@}"
+ else
+ sudo -u "${SVNUSER}" -- /usr/bin/svn "${@}"
+ fi
+}