summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2018-06-26 15:11:15 -0400
committerLuke Shumaker <lukeshu@parabola.nu>2018-10-07 18:15:03 -0400
commit331494d4625464b61d81898c34b50a045d2a74d0 (patch)
tree3ab4701728843bf1e790d45ef814a1854a80820a
parent96db855c1044b397235baccc46cc18e010c97464 (diff)
Preliminary work to break out svn-specific code.
Introduce "db-functions-$VCS" which will eventually contain all VCS-specific code, and make this configurable in config. Move private arch_svn function and svn acl handling here. (Luke Shumaker: this is a partial cherry pick of commit 3bb6775dea3e6dda58d94e8ef9a19026cb9248a4)
-rw-r--r--config7
-rw-r--r--db-functions13
-rw-r--r--db-functions-svn15
-rwxr-xr-xdb-update2
4 files changed, 22 insertions, 15 deletions
diff --git a/config b/config
index fd79b6e..1cfe11f 100644
--- a/config
+++ b/config
@@ -1,14 +1,17 @@
#!/hint/bash
FTP_BASE="/srv/ftp"
-SVNREPO=''
-SVNUSER=''
PKGREPOS=()
PKGPOOL=''
SRCPOOL=''
TESTING_REPO=''
STABLE_REPOS=()
+# VCS backend
+VCS=svn
+SVNREPO=''
+SVNUSER=''
+
CLEANUP_DESTDIR="/var/tmp"
CLEANUP_DRYRUN=false
# Time in days to keep moved packages
diff --git a/db-functions b/db-functions
index 260cc67..f7fffeb 100644
--- a/db-functions
+++ b/db-functions
@@ -36,11 +36,6 @@ mv_acl() {
# set up general environment
WORKDIR=$(mktemp -dt "${0##*/}.XXXXXXXXXX")
-if [[ -n ${SVNUSER} ]]; then
- setfacl -m u:"${SVNUSER}":rwx "${WORKDIR}"
- setfacl -m d:u:"${USER}":rwx "${WORKDIR}"
- setfacl -m d:u:"${SVNUSER}":rwx "${WORKDIR}"
-fi
LOCKS=()
REPO_MODIFIED=0
@@ -494,10 +489,4 @@ arch_repo_modify() {
REPO_MODIFIED=1
}
-arch_svn() {
- if [[ -z ${SVNUSER} ]]; then
- /usr/bin/svn "${@}"
- else
- sudo -u "${SVNUSER}" -- /usr/bin/svn --username "${USER}" "${@}"
- fi
-}
+. "$(dirname "$(readlink -e "${BASH_SOURCE[0]}")")/db-functions-${VCS}"
diff --git a/db-functions-svn b/db-functions-svn
new file mode 100644
index 0000000..fe043a0
--- /dev/null
+++ b/db-functions-svn
@@ -0,0 +1,15 @@
+#!/hint/bash
+
+if [[ -n ${SVNUSER} ]]; then
+ setfacl -m u:"${SVNUSER}":rwx "${WORKDIR}"
+ setfacl -m d:u:"${USER}":rwx "${WORKDIR}"
+ setfacl -m d:u:"${SVNUSER}":rwx "${WORKDIR}"
+fi
+
+arch_svn() {
+ if [[ -z ${SVNUSER} ]]; then
+ /usr/bin/svn "${@}"
+ else
+ sudo -u "${SVNUSER}" -- /usr/bin/svn --username "${USER}" "${@}"
+ fi
+}
diff --git a/db-update b/db-update
index 8eb27df..c9b727a 100755
--- a/db-update
+++ b/db-update
@@ -47,7 +47,7 @@ for repo in "${repos[@]}"; do
die "Package %s does not have a valid signature" "$repo/${pkg##*/}"
fi
if ! check_pkgsvn "${pkg}" "${repo}"; then
- die "Package %s is not consistent with svn repository" "$repo/${pkg##*/}"
+ die "Package %s is not consistent with %s repository" "$repo/${pkg##*/}" "$VCS"
fi
if ! check_pkgrepos "${pkg}"; then
die "Package %s already exists in another repository" "$repo/${pkg##*/}"