summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Griffin <aaronmgriffin@gmail.com>2008-11-11 22:09:24 -0800
committerAaron Griffin <aaronmgriffin@gmail.com>2008-11-11 22:09:24 -0800
commit35e5070403ddae96238bcce6356f4b9713c96675 (patch)
tree28be8d3ae5981d28369c2854447964d581915ed4
parent0dcc6b02d0ed7cf25e9493667030ded9525473ce (diff)
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--config4
-rw-r--r--db-functions5
-rwxr-xr-xdb-move9
-rwxr-xr-xdb-remove7
-rwxr-xr-xdb-update11
-rwxr-xr-xtesting2x3
6 files changed, 19 insertions, 20 deletions
diff --git a/config b/config
new file mode 100644
index 0000000..dbed5bd
--- /dev/null
+++ b/config
@@ -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
diff --git a/db-move b/db-move
index 88a8cb6..5be1813 100755
--- a/db-move
+++ b/db-move
@@ -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
diff --git a/db-remove b/db-remove
index 01f18d6..bdbd254 100755
--- a/db-remove
+++ b/db-remove
@@ -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
diff --git a/db-update b/db-update
index e2a6534..84764eb 100755
--- a/db-update
+++ b/db-update
@@ -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"
diff --git a/testing2x b/testing2x
index 0494b98..d87de11 100755
--- a/testing2x
+++ b/testing2x
@@ -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