summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2012-03-04 22:38:07 +0100
committerPierre Schmitz <pierre@archlinux.de>2012-03-04 22:38:07 +0100
commit82dcc19ff9b2da486e1fe45621da3303add921d8 (patch)
treecc4d47cf878ef5c1f04b2cd833241fa2d4bea178
parentc5893672a639939b63dc338edc31d952035ff8c2 (diff)
commitpkg: Add ability to override the server
This might be useful for unofficial repos
-rw-r--r--commitpkg.in30
1 files changed, 16 insertions, 14 deletions
diff --git a/commitpkg.in b/commitpkg.in
index 4ce0f7b..81af1c6 100644
--- a/commitpkg.in
+++ b/commitpkg.in
@@ -42,7 +42,7 @@ pkgbase=${pkgbase:-$pkgname}
case "$cmd" in
commitpkg)
if (( $# == 0 )); then
- die 'usage: commitpkg <reponame> [-l limit] [-a arch] [commit message]'
+ die 'usage: commitpkg <reponame> [-s server] [-l limit] [-a arch] [commit message]'
fi
repo="$1"
shift
@@ -51,20 +51,10 @@ case "$cmd" in
repo="${cmd%pkg}"
;;
*)
- die 'usage: commitpkg <reponame> [-l limit] [-a arch] [commit message]'
+ die 'usage: commitpkg <reponame> [-s server] [-l limit] [-a arch] [commit message]'
;;
esac
-case "$repo" in
- core|extra|testing|staging|kde-unstable|gnome-unstable)
- 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
@@ -83,10 +73,10 @@ for i in 'changelog' 'install'; do
done < <(sed -n "s/^[[:space:]]*$i=//p" PKGBUILD)
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
+ s) server=$2 ;;
l) rsyncopts+=("--bwlimit=$2") ;;
a) commit_arch=$2 ;;
:) die "Option requires an argument -- '$OPTARG'" ;;
@@ -95,6 +85,18 @@ while getopts ':l:a:' flag; do
done
shift $(( OPTIND - 1 ))
+if [[ -z $server ]]; then
+ case "$repo" in
+ core|extra|testing|staging|kde-unstable|gnome-unstable)
+ 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
+fi
+
if [[ -n $(svn status -q) ]]; then
msgtemplate="upgpkg: $pkgbase $(get_full_version)"$'\n\n'
if [[ -n $1 ]]; then