--- a/commitpkg.in 2011-11-03 13:39:16.000000000 +0400 +++ b/commitpkg.in 2011-11-03 13:43:26.000000000 +0400 @@ -36,7 +36,7 @@ case "$cmd" in commitpkg) if [ $# -eq 0 ]; then - die 'usage: commitpkg [-l limit] [-a arch] [commit message]' + die 'usage: commitpkg [-l limit] [-s server] [-a arch] [commit message]' fi repo="$1" shift @@ -45,20 +45,10 @@ repo="${cmd%pkg}" ;; *) - die 'usage: commitpkg [-l limit] [-a arch] [commit message]' + die 'usage: commitpkg [-l limit] [-s server] [-a arch] [commit message]' ;; esac -case "$repo" in - core|extra|testing|staging) - server='gerolde.archlinux.org' ;; - community*|multilib*) - server='aur.archlinux.org' ;; - *) - server='gerolde.archlinux.org' - msg "Non-standard repository $repo in use, defaulting to server $server" ;; -esac - # check if all local source files are under version control for s in "${source[@]}"; do if [[ $s != *://* ]] && ! svn status -v "$s" | grep -q '^[ AMRX~]'; then @@ -79,9 +69,10 @@ # see if any limit options were passed, we'll send them to rsync rsyncopts=(-e ssh -p --chmod=ug=rw,o=r -c -h -L --progress --partial -y) -while getopts ':l:a:' flag; do +while getopts ':l:a:s:' flag; do case $flag in l) rsyncopts+=("--bwlimit=$2") ;; + s) server=$2 ;; a) commit_arch=$2 ;; :) die "option requires an argument -- '$OPTARG'" ;; \?) die "invalid option -- '$OPTARG'" ;; @@ -89,6 +80,18 @@ done shift $(( OPTIND - 1 )) +if [ -z $server ]; then + case "$repo" in + core|extra|testing|staging) + server='gerolde.archlinux.org' ;; + community*|multilib*) + server='aur.archlinux.org' ;; + *) + server='gerolde.archlinux.org' + echo "Non-standard repository $repo in use, defaulting to server $server, override with '-s ' if needed" ;; + esac +fi + if [ -n "$(svn status -q)" ]; then if [ -n "$1" ]; then stat_busy 'committing changes to trunk'