summaryrefslogtreecommitdiffstats
path: root/db-move
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-move
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-move')
-rwxr-xr-xdb-move10
1 files changed, 4 insertions, 6 deletions
diff --git a/db-move b/db-move
index 41b360d..207baec 100755
--- a/db-move
+++ b/db-move
@@ -1,7 +1,7 @@
#!/bin/bash
if [ $# -ne 4 ]; then
- echo "usage: $(basename $0) <pkgname|pkgbase> <repo-from> <repo-to> <arch>"
+ msg "usage: $(basename $0) <pkgname|pkgbase> <repo-from> <repo-to> <arch>"
exit 1
fi
@@ -24,7 +24,7 @@ svnrepo_from="$repofrom-$arch"
svnrepo_to="$repoto-$arch"
if ! check_repo_permission $repoto || ! check_repo_permission $repofrom; then
- echo "Error: You don't have permission to move packages from ${repofrom} to ${repoto}"
+ error "You don't have permission to move packages from ${repofrom} to ${repoto}"
exit 1
fi
@@ -41,7 +41,7 @@ if [ -d "$packagebase/repos/$svnrepo_from" ]; then
pkgver=$(. "$packagebase/repos/$svnrepo_from/PKGBUILD"; echo ${pkgver})
pkgrel=$(. "$packagebase/repos/$svnrepo_from/PKGBUILD"; echo ${pkgrel})
- echo -n "Moving $packagebase from $repofrom to $repoto..."
+ msg "Moving $packagebase from $repofrom to $repoto..."
if [ -d "$packagebase/repos/$svnrepo_to" ]; then
/usr/bin/svn rm --force -q "$packagebase/repos/$svnrepo_to"
/usr/bin/svn commit -q -m "$(basename $0): $packagebase removed by $(id -un) for move to $repoto"
@@ -71,10 +71,8 @@ if [ -d "$packagebase/repos/$svnrepo_from" ]; then
/usr/bin/repo-add -q "$ftppath_to/${tarch}/$repoto$DBEXT" ${pkgfiles} >/dev/null || die "Error in repo-add $pkgfiles"
/usr/bin/repo-remove -q "$ftppath_from/${tarch}/$repofrom$DBEXT" ${pkgname[@]} >/dev/null || die "Error in repo-remove ${pkgname[@]}"
done
-
- echo 'done'
else
- die "Error: $packagebase is not in repo $repofrom"
+ die "$packagebase is not in repo $repofrom"
fi
repo_unlock $repoto $arch || exit 1