summaryrefslogtreecommitdiffstats
path: root/db-remove
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-08-13 09:47:31 +0200
committerPierre Schmitz <pierre@archlinux.de>2010-08-13 09:47:31 +0200
commita422060414670bb49d2422a38467b73ae01e7ecb (patch)
treef67c7216398ea6bf0aced46828235ca07fdbcf90 /db-remove
parente2c005b490df6762e23da3223944151c17d1de80 (diff)
downloaddbscripts-a422060414670bb49d2422a38467b73ae01e7ecb.tar.gz
dbscripts-a422060414670bb49d2422a38467b73ae01e7ecb.tar.xz
Use common functions to print messages, warnings and errors
These functions are copied from makepkg
Diffstat (limited to 'db-remove')
-rwxr-xr-xdb-remove10
1 files changed, 4 insertions, 6 deletions
diff --git a/db-remove b/db-remove
index 1492d18..2f05c16 100755
--- a/db-remove
+++ b/db-remove
@@ -1,7 +1,7 @@
#!/bin/bash
if [ $# -ne 3 ]; then
- echo "usage: $(basename $0) <pkgname|packagebase> <reponame> <arch>"
+ msg "usage: $(basename $0) <pkgname|packagebase> <reponame> <arch>"
exit 1
fi
@@ -16,13 +16,13 @@ ftppath="$FTP_BASE/$reponame/os"
svnrepo="$reponame-$arch"
if ! check_repo_permission $reponame; then
- echo "Error: You don't have permission to remove packages from ${reponam}"
+ error "You don't have permission to remove packages from ${reponam}"
exit 1
fi
repo_lock $reponame $arch || exit 1
-echo -n "Removing $packagebase from $reponame..."
+msg "Removing $packagebase from $reponame..."
cd "$WORKDIR"
/usr/bin/svn checkout -q -N $SVNREPO checkout >/dev/null
cd checkout
@@ -33,7 +33,7 @@ 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
- die "Error: $packagebase not found in $svnrepo"
+ die "$packagebase not found in $svnrepo"
fi
cd "$WORKDIR"
@@ -53,8 +53,6 @@ for tarch in $arches; do
/usr/bin/repo-remove -q "$ftppath/$tarch/$reponame$DBEXT" ${pkgname[@]} >/dev/null
done
-echo 'done'
-
repo_unlock $reponame $arch || exit 1
# vim: set ts=4 sw=4 noet ft=sh: