summaryrefslogtreecommitdiffstats
path: root/db-remove
diff options
context:
space:
mode:
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: