From 67e112955482397bae1971fa60e1634a92ec361c Mon Sep 17 00:00:00 2001 From: Abhishek Dasgupta Date: Fri, 20 Mar 2009 20:56:15 +0530 Subject: 'any' architecture support for db-move, db-remove Also: changed empty variable '$ftpdir' in db-remove to '$ftppath/$architecture' --- db-remove | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'db-remove') 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: -- cgit v1.2.3-24-g4f1b