diff options
author | Dan McGee <dan@archlinux.org> | 2011-11-01 15:55:25 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2011-11-05 14:14:04 +0100 |
commit | 22dd30328ec4229321f1f96026704ff3cf1cc621 (patch) | |
tree | 85875f071b95f913d328a847a94e155bd894d35b | |
parent | d0586258fda6753053a7d28a2d7d15228b1d8897 (diff) | |
download | dbscripts-22dd30328ec4229321f1f96026704ff3cf1cc621.tar.gz dbscripts-22dd30328ec4229321f1f96026704ff3cf1cc621.tar.xz |
db-*: always handle pkgname/pkgbase/pkgfile argument last
This matches what we do in db-update, and makes the most sense if we
want to expand these commands to take multiple arguments at the same
time. Especially in the case of db-repo-add and db-repo-remove, these
wrapper commands should be no more limiting than repo-add and
repo-remove which always allow multiple arguments and are more efficient
that way.
This patch simply reorders the arguments; a later patch will support
multiple pkgname/pkgbase/pkgfile arguments on the command line.
Although this does break backwards compatibility and requires some
changing of muscle memory, I think it is a worthwhile change to make as
the functionality of these commands becomes more powerful and the order
of arguments becomes the same in all of them.
Signed-off-by: Dan McGee <dan@archlinux.org>
-rwxr-xr-x | db-remove | 8 | ||||
-rwxr-xr-x | db-repo-add | 8 | ||||
-rwxr-xr-x | db-repo-remove | 8 |
3 files changed, 12 insertions, 12 deletions
@@ -4,13 +4,13 @@ . "$(dirname $0)/config" if [ $# -ne 3 ]; then - msg "usage: $(basename $0) <pkgname|pkgbase> <repo> <arch>" + msg "usage: $(basename $0) <repo> <arch> <pkgname|pkgbase>" exit 1 fi -pkgbase="$1" -repo="$2" -arch="$3" +repo="$1" +arch="$2" +pkgbase="$3" ftppath="$FTP_BASE/$repo/os" svnrepo="$repo-$arch" diff --git a/db-repo-add b/db-repo-add index 53cfc84..8d4a56d 100755 --- a/db-repo-add +++ b/db-repo-add @@ -4,13 +4,13 @@ . "$(dirname $0)/config" if [ $# -ne 3 ]; then - msg "usage: $(basename $0) <pkgfile> <repo> <arch>" + msg "usage: $(basename $0) <repo> <arch> <pkgfile>" exit 1 fi -pkgfile="$1" -repo="$2" -arch="$3" +repo="$1" +arch="$2" +pkgfile="$3" ftppath="$FTP_BASE/$repo/os" diff --git a/db-repo-remove b/db-repo-remove index b01910f..e55cd07 100755 --- a/db-repo-remove +++ b/db-repo-remove @@ -4,13 +4,13 @@ . "$(dirname $0)/config" if [ $# -ne 3 ]; then - msg "usage: $(basename $0) <pkgname> <repo> <arch>" + msg "usage: $(basename $0) <repo> <arch> <pkgname>" exit 1 fi -pkgname="$1" -repo="$2" -arch="$3" +repo="$1" +arch="$2" +pkgname="$3" ftppath="$FTP_BASE/$repo/os" |