summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvangelos Foutras <foutrelis@gmail.com>2009-09-23 18:17:48 +0200
committerAaron Griffin <aaronmgriffin@gmail.com>2009-09-23 21:00:45 +0200
commit3d9c9c1b46e0a2cb9dee6965fd2262837e5b097b (patch)
tree35a61b631787f4259803698620700085b9656fca
parent70e48eff7a9bbec2eaac2633bb131ebcd31fc96b (diff)
downloaddevtools-3d9c9c1b46e0a2cb9dee6965fd2262837e5b097b.tar.gz
devtools-3d9c9c1b46e0a2cb9dee6965fd2262837e5b097b.tar.xz
Move initialization code out of the upload loop
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
-rwxr-xr-xcommitpkg60
1 files changed, 30 insertions, 30 deletions
diff --git a/commitpkg b/commitpkg
index 15f6981..d7b4b6c 100755
--- a/commitpkg
+++ b/commitpkg
@@ -28,6 +28,36 @@ fi
source PKGBUILD
pkgbase=${pkgbase:-${pkgname[0]}}
+# set up repo-specific opts depending on how we were called
+server="gerolde.archlinux.org"
+if [ "$cmd" == "extrapkg" ]; then
+ repo="extra"
+elif [ "$cmd" == "corepkg" ]; then
+ repo="core"
+elif [ "$cmd" == "testingpkg" ]; then
+ repo="testing"
+elif [ "$cmd" == "communitypkg" ]; then
+ repo="community"
+ server="aur.archlinux.org"
+elif [ "$cmd" == "community-testingpkg" ]; then
+ repo="community-testing"
+ server="aur.archlinux.org"
+else
+ if [ $# -eq 0 ]; then
+ echo "usage: commitpkg <reponame> [-l limit] [commit message]"
+ exit 1
+ fi
+ repo="$1"
+ shift
+fi
+
+# see if any limit options were passed, we'll send them to SCP
+unset scpopts
+if [ "$1" = "-l" ]; then
+ scpopts="$1 $2"
+ shift 2
+fi
+
for _pkgname in ${pkgname[@]}; do
pkgfile=${_pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}
anypkgfile=${_pkgname}-${pkgver}-${pkgrel}-any${PKGEXT}
@@ -47,36 +77,6 @@ for _pkgname in ${pkgname[@]}; do
fi
fi
- # set up repo-specific opts depending on how we were called
- server="gerolde.archlinux.org"
- if [ "$cmd" == "extrapkg" ]; then
- repo="extra"
- elif [ "$cmd" == "corepkg" ]; then
- repo="core"
- elif [ "$cmd" == "testingpkg" ]; then
- repo="testing"
- elif [ "$cmd" == "communitypkg" ]; then
- repo="community"
- server="aur.archlinux.org"
- elif [ "$cmd" == "community-testingpkg" ]; then
- repo="community-testing"
- server="aur.archlinux.org"
- else
- if [ $# -eq 0 ]; then
- echo "usage: commitpkg <reponame> [-l limit] [commit message]"
- exit 1
- fi
- repo="$1"
- shift
- fi
-
- # see if any limit options were passed, we'll send them to SCP
- unset scpopts
- if [ "$1" = "-l" ]; then
- scpopts="$1 $2"
- shift 2
- fi
-
# combine what we know into a variable
uploadto="staging/${repo}/$(basename ${pkgfile})"
scp ${scpopts} "${pkgfile}" "${server}:${uploadto}"