diff options
-rw-r--r-- | config | 7 | ||||
-rw-r--r-- | db-functions | 15 | ||||
-rwxr-xr-x | db-move | 7 | ||||
-rwxr-xr-x | db-remove | 3 | ||||
-rwxr-xr-x | db-update | 3 | ||||
-rwxr-xr-x | testing2x | 3 |
6 files changed, 33 insertions, 5 deletions
@@ -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: @@ -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 @@ -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 @@ -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 @@ -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 |