chiark / gitweb /
Mirroring: Check number of arguments to dgit-mirror-rsync
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Jul 2015 15:49:59 +0000 (16:49 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Jul 2015 18:31:19 +0000 (19:31 +0100)
infra/dgit-mirror-rsync

index e73d9a5bcf982fd109902973a4f310f843bf7c67..5b54d16cc0f9a1cdbf0be5251d1943b5f5d3d535 100755 (executable)
@@ -30,6 +30,12 @@ case "$DGIT_DRS_DEBUG" in
 *)             set -x  ;;
 esac
 
 *)             set -x  ;;
 esac
 
+fail () {
+       echo >&2 "dgit-mirror-rsync: $*"; exit 127
+}
+
+if [ $# -lt 2 ]; then fail "too few arguments"; fi
+
 self=$0
 distrodir=$1;  shift
 action=$1;     shift
 self=$0
 distrodir=$1;  shift
 action=$1;     shift
@@ -54,10 +60,6 @@ rsyncssh='ssh -o batchmode=yes'
 cd $repos
 queue=_mirror-queue
 
 cd $repos
 queue=_mirror-queue
 
-fail () {
-       echo >&2 "dgit-mirror-rsync: $*"; exit 127
-}
-
 case "$remoterepos" in
 *:/*|/*)       ;;
 '')            fail "remoterepos config not set" ;;
 case "$remoterepos" in
 *:/*|/*)       ;;
 '')            fail "remoterepos config not set" ;;