From 9b7b2a7e774f307b6b5ab398908e883364af7247 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Fri, 20 Feb 2009 10:23:07 -0800 Subject: Add per-repo SVN configs This could be useful if we move community to a separate SVN repo Signed-off-by: Aaron Griffin --- config | 7 ++++++- db-functions | 15 +++++++++++++++ db-move | 7 ++++++- db-remove | 3 ++- db-update | 3 ++- testing2x | 3 ++- 6 files changed, 33 insertions(+), 5 deletions(-) diff --git a/config b/config index 07cf783..867d28e 100644 --- a/config +++ b/config @@ -1,6 +1,11 @@ FTP_BASE="/srv/ftp" -SVN_PATH="file:///srv/svn-packages" + +SVNREPO_core="file:///srv/svn-packages" +SVNREPO_extra="file:///srv/svn-packages" +SVNREPO_testing="file:///srv/svn-packages" +SVNREPO_community="file:///srv/svn-community" + STAGING="$HOME/staging" TMPDIR="/srv/tmp" ARCHES=(i686 x86_64) diff --git a/db-functions b/db-functions index c105dab..99de756 100644 --- a/db-functions +++ b/db-functions @@ -92,4 +92,19 @@ check_pkg_arch () { #check_pkg_arch pkgfile arch fi } +get_svnpath () { #get_svnpath reponame + local var + local repopath + var="\$SVNREPO_${1}" + + eval repopath=${var} + if [ -z "$repopath" ]; then + echo "ERROR: SVN path not defined for '${1}'" >2 + echo " Please check SVNREPO_${1} config setting" >2 + fi + + echo "$repopath" +} + + # vim: set ts=4 sw=4 noet ft=sh: diff --git a/db-move b/db-move index ff9677b..e4f2fef 100755 --- a/db-move +++ b/db-move @@ -21,6 +21,11 @@ ftppath_from="$FTP_BASE/$repofrom/os/$_arch/" ftppath_to="$FTP_BASE/$repoto/os/$_arch/" svnrepo_from="$repofrom-$_arch" svnrepo_to="$repoto-$_arch" +svnpath="$(get_svnpath $repoto)" +if [ "$svnpath" != "$(get_svnpath $repofrom" ]; then + echo "ERROR: Cannot move packages across SVN repos" + echo " A move must be within the same svn repo" +fi [ "$UID" = "" ] && UID=$(uid) @@ -54,7 +59,7 @@ repo_lock $repofrom $_arch /bin/mkdir -p "$WORKDIR" cd "$WORKDIR" -/usr/bin/svn checkout -N $SVN_PATH checkout +/usr/bin/svn checkout -N $svnpath checkout cd checkout /usr/bin/svn up -q $packagename diff --git a/db-remove b/db-remove index acc849d..501c70a 100755 --- a/db-remove +++ b/db-remove @@ -17,6 +17,7 @@ export CARCH="$arch" ftppath="$FTP_BASE/$reponame/os/$arch/" svnrepo="$reponame-$arch" +svnpath="$(get_svnpath $reponame)" [ "$UID" = "" ] && UID=$(uid) @@ -51,7 +52,7 @@ repo_lock $reponame $arch echo "==> Removing package '$packagename' from '$reponame'..." >&2 cd "$WORKDIR" -/usr/bin/svn checkout -N $SVN_PATH checkout +/usr/bin/svn checkout -N $svnpath checkout cd checkout /usr/bin/svn up -q $packagename diff --git a/db-update b/db-update index ea57eed..3f3b0cc 100755 --- a/db-update +++ b/db-update @@ -87,6 +87,7 @@ for A in ${ARCHES[@]}; do exit 1 fi + svnpath="$(get_svnpath $reponame)" svnrepo="$reponame-$current_arch" repo_lock $reponame $current_arch @@ -118,7 +119,7 @@ for A in ${ARCHES[@]}; do echo "==> Processing new/updated packages for repository '$reponame'..." >&2 cd "$WORKDIR" - /usr/bin/svn checkout -N $SVN_PATH checkout + /usr/bin/svn checkout -N $svnpath checkout cd checkout for pkg in $ADDPKGS; do diff --git a/testing2x b/testing2x index 6a3a70e..0314738 100755 --- a/testing2x +++ b/testing2x @@ -13,6 +13,7 @@ case "$0" in ;; esac WORKDIR="$TMPDIR/testing2x.$UID" +svnpath="$(get_svnpath testing)" cleanup() { trap '' 0 2 @@ -30,7 +31,7 @@ trap cleanup 0 /bin/mkdir "${WORKDIR}" cd "${WORKDIR}" -/usr/bin/svn checkout -N $SVN_PATH checkout +/usr/bin/svn checkout -N $svnpath checkout cd checkout for pkg in $*; do -- cgit v1.2.3