diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2010-08-08 11:39:42 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2010-08-08 11:39:42 +0200 |
commit | 20f1c1c27a1691cf92ad11ebc81dfaa175ace305 (patch) | |
tree | 72f41644ebbd512a11b30379746a0f50474b0cf9 | |
parent | cbe9204ce41a81086c7498360769a66cfe48ce34 (diff) | |
download | dbscripts-20f1c1c27a1691cf92ad11ebc81dfaa175ace305.tar.gz dbscripts-20f1c1c27a1691cf92ad11ebc81dfaa175ace305.tar.xz |
Cleanup db-remove
* There is no need to copy the db into a working dir
* cleanup is automatically called on exit
-rwxr-xr-x | db-remove | 23 |
1 files changed, 5 insertions, 18 deletions
@@ -54,13 +54,10 @@ if [ -d "$packagebase/repos/$svnrepo" ]; then /usr/bin/svn rm --force -q "$packagebase/repos/$svnrepo" /usr/bin/svn commit -q -m "$(basename $0): $packagebase removed by $(id -un)" else - echo " Warning: $packagebase not found in $svnrepo" - echo " Removing split packages is not yet supported" - exit 1 + die "Error: $packagebase not found in $svnrepo" fi cd "$WORKDIR" -[ -d build/ ] || mkdir build if [ "$_arch" == "any" ]; then arches="i686 x86_64" @@ -69,24 +66,14 @@ else fi # copy the db file into our working area -for architecture in $arches; do - if [ -f "$ftppath/$architecture/$reponame$DBEXT" ]; then - /bin/cp "$ftppath/$architecture/$reponame$DBEXT" build/ - else - echo "No database found at '$ftppath/$architecture', nothing more to do" - exit 0 +for arch in $arches; do + if [ ! -f "$ftppath/$arch/$reponame$DBEXT" ]; then + die "No database found at '$ftppath/$arch', nothing more to do" fi - cd build/ - /usr/bin/repo-remove -q "$reponame$DBEXT" ${pkgname[@]} >/dev/null - - /bin/mv "$reponame$DBEXT" "$ftppath/$architecture" - - cd .. + /usr/bin/repo-remove -q "$ftppath/$arch/$reponame$DBEXT" ${pkgname[@]} >/dev/null done echo 'done' -cleanup - # vim: set ts=4 sw=4 noet ft=sh: |