summaryrefslogtreecommitdiff
path: root/db-remove
diff options
context:
space:
mode:
authorAbhishek Dasgupta <abhidg@gmail.com>2009-03-20 20:56:15 +0530
committerAbhishek Dasgupta <abhidg@gmail.com>2009-03-20 20:56:15 +0530
commit67e112955482397bae1971fa60e1634a92ec361c (patch)
tree4233afa6c9b3936b512631a30d6eab5ee135c309 /db-remove
parent60f7e2bf28bed7d18438d9378e19a82e8b6a2d24 (diff)
'any' architecture support for db-move, db-remove
Also: changed empty variable '$ftpdir' in db-remove to '$ftppath/$architecture'
Diffstat (limited to 'db-remove')
-rwxr-xr-xdb-remove36
1 files changed, 22 insertions, 14 deletions
diff --git a/db-remove b/db-remove
index 501c70a..4763f3d 100755
--- a/db-remove
+++ b/db-remove
@@ -15,7 +15,7 @@ arch="$3"
export CARCH="$arch"
-ftppath="$FTP_BASE/$reponame/os/$arch/"
+ftppath="$FTP_BASE/$reponame/os"
svnrepo="$reponame-$arch"
svnpath="$(get_svnpath $reponame)"
@@ -65,21 +65,29 @@ fi
cd "$WORKDIR"
[ -d build/ ] || mkdir build
-# copy the db file into our working area
-if [ -f "$ftppath/$reponame.db.tar.$DB_COMPRESSION" ]; then
- /bin/cp "$ftppath/$reponame.db.tar.$DB_COMPRESSION" build/
+if [ "$arch" == "any" ]; then
+ arches="i686 x86_64"
else
- echo "No database found at '$ftpdir', nothing more to do"
- exit 0
+ arches="$arch"
fi
-echo " Removing from $reponame DB file"
-cd build/
-/usr/bin/repo-remove -q "$reponame.db.tar.$DB_COMPRESSION" $packagename
-
-/bin/cp "$reponame.db.tar.$DB_COMPRESSION" "$ftppath/"
-
-echo "Package files will be cleaned up automatically"
-
+# copy the db file into our working area
+for architecture in $arches; do
+ if [ -f "$ftppath/$architecture/$reponame.db.tar.$DB_COMPRESSION" ]; then
+ /bin/cp "$ftppath/$architecture/$reponame.db.tar.$DB_COMPRESSION" build/
+ else
+ echo "No database found at '$ftppath/$architecture', nothing more to do"
+ exit 0
+ fi
+
+ echo " Removing from $reponame DB file ($architecture)"
+ cd build/
+ /usr/bin/repo-remove -q "$reponame.db.tar.$DB_COMPRESSION" $packagename
+
+ /bin/mv "$reponame.db.tar.$DB_COMPRESSION" "$ftppath/$architecture"
+
+ echo "Package files will be cleaned up automatically"
+ cd ..
+done
cleanup
# vim: set ts=4 sw=4 noet ft=sh: