From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 0945259CA5 for ; Sun, 20 Mar 2016 22:39:39 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 96C2421C08D; Sun, 20 Mar 2016 22:39:15 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0F33521C08D for ; Sun, 20 Mar 2016 22:39:15 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C0DF734067D for ; Sun, 20 Mar 2016 22:39:13 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E01A2822 for ; Sun, 20 Mar 2016 22:39:10 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1458506771.d14007c774e6d255e8a3fdc5890b06b1629f8348.vapier@gentoo> Subject: [gentoo-commits] proj/releng:master commit in: scripts/ X-VCS-Repository: proj/releng X-VCS-Files: scripts/copy_buildsync.sh X-VCS-Directories: scripts/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: d14007c774e6d255e8a3fdc5890b06b1629f8348 X-VCS-Branch: master Date: Sun, 20 Mar 2016 22:39:10 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 0d3d5242-de2d-4d2f-8797-6b7ef2a2cf5b X-Archives-Hash: 04c79d4a89a9243ded6c77418bcefddc commit: d14007c774e6d255e8a3fdc5890b06b1629f8348 Author: Mike Frysinger gentoo org> AuthorDate: Sun Mar 20 20:46:11 2016 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Sun Mar 20 20:46:11 2016 +0000 URL: https://gitweb.gentoo.org/proj/releng.git/commit/?id=d14007c7 copy_buildsync.sh: convert code to use arrays This makes it a bit cleaner to work with arguments. scripts/copy_buildsync.sh | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/scripts/copy_buildsync.sh b/scripts/copy_buildsync.sh index 69b08c9..6105197 100755 --- a/scripts/copy_buildsync.sh +++ b/scripts/copy_buildsync.sh @@ -1,8 +1,22 @@ #!/bin/bash -ARCHES="alpha amd64 arm hppa ia64 ppc s390 sh sparc x86" - #alpha amd64 arm hppa ia64 mips ppc s390 sh sparc x86 -RSYNC_OPTS="-aO --delay-updates" +ARCHES=( + alpha + amd64 + arm + hppa + ia64 + #mips + ppc + s390 + sh + sparc + x86 +) +RSYNC_OPTS=( + -aO + --delay-updates +) DEBUG= VERBOSE= EXTENSIONS="[.tar.xz,.tar.bz2,.tar.gz,.tar,.sfs]" @@ -16,11 +30,11 @@ DEBUGP= VERBOSEP= [ -n "$DEBUG" ] && DEBUGP=echo -[ -n "$DEBUG" ] && RSYNC_OPTS="${RSYNC_OPTS} -n" -[ -n "$VERBOSE" ] && RSYNC_OPTS="${RSYNC_OPTS} -v" +[ -n "$DEBUG" ] && RSYNC_OPTS+=( -n ) +[ -n "$VERBOSE" ] && RSYNC_OPTS+=( -v ) [ -n "$VERBOSEP" ] && VERBOSEP="-v" -for ARCH in $ARCHES; do +for ARCH in "${ARCHES[@]}"; do rc=0 fail=0 @@ -36,7 +50,7 @@ for ARCH in $ARCHES; do #echo "Doing $i" t="${outdir}/${i}" mkdir -p ${t} 2>/dev/null - rsync ${RSYNC_OPTS} --temp-dir=${tmpdir} --partial-dir=${tmpdir} ${indir}/ --filter "S *${i}*" --filter 'S **/' --filter 'H *' ${t} + rsync "${RSYNC_OPTS[@]}" --temp-dir=${tmpdir} --partial-dir=${tmpdir} ${indir}/ --filter "S *${i}*" --filter 'S **/' --filter 'H *' ${t} rc=$? if [ $rc -eq 0 ]; then find ${indir} -type f -name "*${i}*" -print0 | xargs -0 --no-run-if-empty $DEBUGP rm $VERBOSEP -f