From 71320a5387779f648a1e979c3925f4d0be511952 Mon Sep 17 00:00:00 2001 From: Sergej Pupykin Date: Fri, 2 Sep 2011 01:00:59 +0400 Subject: [PATCH] commitpkg: add -s flag for using with Unofficial User Repositories --- commitpkg | 29 ++++++++++++++++------------- 1 files changed, 16 insertions(+), 13 deletions(-) diff --git a/commitpkg b/commitpkg index 2a732b5..1680b52 100755 --- a/commitpkg +++ b/commitpkg @@ -54,7 +54,7 @@ pkgbase=${pkgbase:-$pkgname} case "$cmd" in commitpkg) if [ $# -eq 0 ]; then - abort 'usage: commitpkg [-l limit] [-a arch] [commit message]' + abort 'usage: commitpkg [-l limit] [-s server] [-a arch] [commit message]' fi repo="$1" shift @@ -63,20 +63,10 @@ case "$cmd" in repo="${cmd%pkg}" ;; *) - abort 'usage: commitpkg [-l limit] [-a arch] [commit message]' + abort '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' - echo "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 @@ -98,9 +88,10 @@ done # 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 ;; :) echo "option requires an argument -- '$OPTARG'" >&2 exit 1 ;; @@ -110,6 +101,18 @@ while getopts ':l:a:' flag; do 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 echo -n 'committing changes to trunk...' msgtemplate="upgpkg: $pkgbase $(get_full_version ${epoch:-0} $pkgver $pkgrel)"$'\n\n' -- 1.7.6.1