From a422060414670bb49d2422a38467b73ae01e7ecb Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 13 Aug 2010 09:47:31 +0200 Subject: Use common functions to print messages, warnings and errors These functions are copied from makepkg --- db-remove | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'db-remove') 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) " + msg "usage: $(basename $0) " 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: -- cgit v1.2.3-24-g4f1b