diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2010-08-13 09:47:31 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2010-08-13 09:47:31 +0200 |
commit | a422060414670bb49d2422a38467b73ae01e7ecb (patch) | |
tree | f67c7216398ea6bf0aced46828235ca07fdbcf90 /db-remove | |
parent | e2c005b490df6762e23da3223944151c17d1de80 (diff) | |
download | dbscripts-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-x | db-remove | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -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: |