summaryrefslogtreecommitdiffstats
path: root/db-remove
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-08-08 11:39:42 +0200
committerPierre Schmitz <pierre@archlinux.de>2010-08-08 11:39:42 +0200
commit20f1c1c27a1691cf92ad11ebc81dfaa175ace305 (patch)
tree72f41644ebbd512a11b30379746a0f50474b0cf9 /db-remove
parentcbe9204ce41a81086c7498360769a66cfe48ce34 (diff)
downloaddbscripts-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
Diffstat (limited to 'db-remove')
-rwxr-xr-xdb-remove23
1 files changed, 5 insertions, 18 deletions
diff --git a/db-remove b/db-remove
index 357e6c4..bf325c4 100755
--- a/db-remove
+++ b/db-remove
@@ -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: