diff options
author | Aaron Griffin <aaronmgriffin@gmail.com> | 2008-11-12 07:09:24 +0100 |
---|---|---|
committer | Aaron Griffin <aaronmgriffin@gmail.com> | 2008-11-12 07:09:24 +0100 |
commit | 35e5070403ddae96238bcce6356f4b9713c96675 (patch) | |
tree | 28be8d3ae5981d28369c2854447964d581915ed4 | |
parent | 0dcc6b02d0ed7cf25e9493667030ded9525473ce (diff) | |
download | dbscripts-35e5070403ddae96238bcce6356f4b9713c96675.tar.gz dbscripts-35e5070403ddae96238bcce6356f4b9713c96675.tar.xz |
Move as much as we can out to a config file
This should allow us to move FTP and SVN placement
around
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
-rw-r--r-- | config | 4 | ||||
-rw-r--r-- | db-functions | 5 | ||||
-rwxr-xr-x | db-move | 9 | ||||
-rwxr-xr-x | db-remove | 7 | ||||
-rwxr-xr-x | db-update | 11 | ||||
-rwxr-xr-x | testing2x | 3 |
6 files changed, 19 insertions, 20 deletions
@@ -0,0 +1,4 @@ + +FTP_BASE="/home/ftp/" +SVN_PATH="file:///home/svn-packages" +STAGING="$HOME/staging/" diff --git a/db-functions b/db-functions index a20496b..9724e1c 100644 --- a/db-functions +++ b/db-functions @@ -3,6 +3,11 @@ # Random integrity things [ "$UID" = "" ] && UID=$(uid) +BASEDIR="$(dirname $0)" +if [ -f "$BASEDIR/config" ]; then + . "$BASEDIR/config" +fi + # Useful functions source_makepkg () { if [ -f "/etc/makepkg.conf" ]; then @@ -17,13 +17,10 @@ arch="$4" export CARCH="$arch" -##### Arch specific stuff. TODO make this configurable ##### -ftppath_from="/home/ftp/$repofrom/os/$arch/" -ftppath_to="/home/ftp/$repoto/os/$arch/" -svnpath="file:///home/svn-packages" +ftppath_from="$FTP_BASE/$repofrom/os/$arch/" +ftppath_to="$FTP_BASE/$repoto/os/$arch/" svnrepo_from="$repofrom-$arch" svnrepo_to="$repoto-$arch" -############################################################ [ "$UID" = "" ] && UID=$(uid) @@ -56,7 +53,7 @@ repo_lock $repofrom $arch /bin/mkdir -p "$WORKDIR" cd "$WORKDIR" -/usr/bin/svn checkout -N $svnpath checkout +/usr/bin/svn checkout -N $SVN_PATH checkout cd checkout /usr/bin/svn up -q $packagename @@ -15,11 +15,8 @@ arch="$3" export CARCH="$arch" -##### Arch specific stuff. TODO make this configurable ##### -ftppath="/home/ftp/$reponame/os/$arch/" -svnpath="file:///home/svn-packages" +ftppath="$FTP_BASE/$reponame/os/$arch/" svnrepo="$reponame-$arch" -############################################################ [ "$UID" = "" ] && UID=$(uid) @@ -53,7 +50,7 @@ repo_lock $reponame $arch echo "==> Removing package '$packagename' from '$reponame'..." >&2 cd "$WORKDIR" -/usr/bin/svn checkout -N $svnpath checkout +/usr/bin/svn checkout -N $SVN_PATH checkout cd checkout /usr/bin/svn up -q $packagename @@ -14,12 +14,9 @@ arch="$2" export CARCH="$arch" -##### Arch specific stuff. TODO make this configurable ##### -ftppath="/home/ftp/$reponame/os/$arch/" -svnpath="file:///home/svn-packages" +ftppath="$FTP_BASE/$reponame/os/$arch/" svnrepo="$reponame-$arch" -stagedir="$HOME/staging/$reponame" -############################################################ +stagedir="$STAGING/$reponame" [ "$UID" = "" ] && UID=$(uid) @@ -102,7 +99,7 @@ if [ -n "$ADDPKGS" ]; then echo "==> Processing new/updated packages for repository '$reponame'..." >&2 cd "$WORKDIR" - /usr/bin/svn checkout -N $svnpath checkout + /usr/bin/svn checkout -N $SVN_PATH checkout cd checkout for pkg in $ADDPKGS; do @@ -154,7 +151,7 @@ if [ -n "$REMPKGS" ]; then if [ ! -d "$WORKDIR/checkout" ]; then cd "$WORKDIR" - /usr/bin/svn checkout -N $svnpath checkout + /usr/bin/svn checkout -N $SVN_PATH checkout fi cd "$WORKDIR/checkout" @@ -12,7 +12,6 @@ case "$0" in arch="i686" ;; esac -svnpath="file:///home/svn-packages" WORKDIR="/home/tmp/testing2x.$UID" cleanup() { @@ -29,7 +28,7 @@ trap ctrl_c 2 trap cleanup 0 cd "${WORKDIR}" -/usr/bin/svn checkout -N ${svnpath} checkout +/usr/bin/svn checkout -N $SVN_PATH checkout cd checkout for pkg in $*; do |