From a73cfdebff22fb433371b027c24742a2ffc7c76b Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Tue, 21 Jun 2011 16:53:13 +0000 Subject: check arguments --- mga-move-update | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'mga-move-update') diff --git a/mga-move-update b/mga-move-update index a2423db..881a35f 100644 --- a/mga-move-update +++ b/mga-move-update @@ -5,12 +5,25 @@ moveupdate_allowed_group=mga-qa dryrun=echo +if [ $# != 3 ] +then + echo 'Usage: mga-move-update distrorelease section srcname' >&2 + exit 1 +fi + distrorelease="$1" section="$2" srcname="$3" -if test -z $distrorelease || test -z $section || test -z $srcname + +if ! inlist "$distrorelease" "$distroreleases" +then + echo "Incorrect distrorelease $distrorelease" >&2 + exit 1 +fi + +if ! inlist "$section" "$distrosections" then - echo 'Missing argument' >&2 + echo "Incorrect section $section" >&2 exit 1 fi -- cgit v1.2.1