From c955ecf35d34c9121e7709b705d924976ad64923 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 1 Apr 2011 16:35:34 -0500 Subject: commitpkg: upload all files at the same time Batch them up using a bash array and then pass them all to a single invocation of rsync. Signed-off-by: Dan McGee Signed-off-by: Pierre Schmitz --- commitpkg | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'commitpkg') diff --git a/commitpkg b/commitpkg index 413161c..ed2254c 100755 --- a/commitpkg +++ b/commitpkg @@ -112,6 +112,8 @@ else fi echo 'done' +declare -a uploads + for _arch in ${arch[@]}; do for _pkgname in ${pkgname[@]}; do fullver=$(get_full_version ${epoch:-0} $pkgver $pkgrel) @@ -126,13 +128,16 @@ for _arch in ${arch[@]}; do echo "skipping ${_arch}" continue 2 fi - - echo -n 'uploading ' - rsync $rsyncopts "${pkgfile}" "$server:staging/$repo/${pkgfile##*/}" || abort + uploads+=("$pkgfile") done archrelease $repo-${_arch} || abort done +if [[ ${#uploads[*]} -gt 0 ]]; then + echo 'uploading all package files' + rsync $rsyncopts "${uploads[@]}" "$server:staging/$repo/" || abort +fi + if [ "${arch[*]}" == 'any' ]; then if [ -d ../repos/$repo-i686 -a -d ../repos/$repo-x86_64 ]; then pushd ../repos/ >/dev/null -- cgit v1.2.3-24-g4f1b