From patchwork Tue Dec 30 13:58:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Porcedda X-Patchwork-Id: 424637 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id EA07814011E for ; Wed, 31 Dec 2014 00:58:59 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 33E5088089; Tue, 30 Dec 2014 13:58:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oqNrCaSez6fL; Tue, 30 Dec 2014 13:58:56 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2A9548839D; Tue, 30 Dec 2014 13:58:55 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id B0D301BF9D3 for ; Tue, 30 Dec 2014 13:58:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id ADF052FA5A for ; Tue, 30 Dec 2014 13:58:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hKc+NmU5VKPu for ; Tue, 30 Dec 2014 13:58:50 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by silver.osuosl.org (Postfix) with ESMTPS id A53FA23FDE for ; Tue, 30 Dec 2014 13:58:49 +0000 (UTC) Received: by mail-wg0-f50.google.com with SMTP id a1so20741681wgh.37 for ; Tue, 30 Dec 2014 05:58:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZzWuECHOgyOPBUpgN3IKO6RS8kFucYO7vCtWd5eBlBY=; b=r9Q+IpeGUCCY7gz8EdEJiaWbC2yhHqC8QDs+IHqFUmEXUOv2ehPyYW73EcTz3vehB3 a7NvU7L9ZQYwcXN95fjpkyDkv01rgM2oOTLk6v7PGQu7YZZ+RsTQlOt4rbA2hX3mnOL+ 1zqdGzcaJW54WFzD0P+phwGIauwxHERrA1qXT04Ss4qdWYVwYHYVcEevNQFud8pE0IKS qP+QZd7eSXWGeHp7EPOFbfe2xu3ZQCdT7z2myYX6b22rmvj7Gnsp//6XG50FdSU8nQH5 bXifGnf6lPT3f6ss6vR/cu31E8rC7FYXUqyBIGFjcYR3Xx5hRf2NmznSNhgsI/lVWLr2 52tQ== X-Received: by 10.180.75.237 with SMTP id f13mr104386090wiw.69.1419947928248; Tue, 30 Dec 2014 05:58:48 -0800 (PST) Received: from mobeast.localdomain (dynamic-adsl-84-221-153-137.clienti.tiscali.it. [84.221.153.137]) by mx.google.com with ESMTPSA id f1sm42720169wjw.30.2014.12.30.05.58.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Dec 2014 05:58:47 -0800 (PST) From: Fabio Porcedda To: buildroot@uclibc.org Date: Tue, 30 Dec 2014 14:58:39 +0100 Message-Id: <1419947920-22047-4-git-send-email-fabio.porcedda@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1419947920-22047-1-git-send-email-fabio.porcedda@gmail.com> References: <1419947920-22047-1-git-send-email-fabio.porcedda@gmail.com> Cc: Thomas Petazzoni , "Yann E. MORIN" Subject: [Buildroot] [PATCH v7 3/4] support/download: silence svn if it is a silent build X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" If it is a silent build (make -s -> QUIET=-q) silence the svn download helper using "svn -q" just like others download helpers, e.g. wget. Signed-off-by: Fabio Porcedda Cc: Thomas Petazzoni Cc: Yann E. MORIN --- Notes: v7: - use "backend_quiet" instead of "quiet" in the dl-wrapper v6: - Use QUIET instead of BR_QUIET v5: - Use getopts v4: - Instead of changing the "SVN" variable pass the "-q" option to the download helper (Thomas P.) v3: - Add this patch support/download/dl-wrapper | 8 ++++++-- support/download/svn | 20 ++++++++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/support/download/dl-wrapper b/support/download/dl-wrapper index 337fc48..e9002fb 100755 --- a/support/download/dl-wrapper +++ b/support/download/dl-wrapper @@ -21,7 +21,7 @@ set -e main() { local OPT OPTARG - local backend output hfile quiet + local backend output hfile quiet backend_quiet # Parse our options; anything after '--' is for the backend while getopts :hb:o:H:q OPT; do @@ -48,6 +48,10 @@ main() { error "no hash-file specified, use -H\n" fi + if [ "${backend}" == "svn" ]; then + backend_quiet=${quiet} + fi + # If the output file already exists, do not download it again if [ -e "${output}" ]; then if support/download/check-hash ${quiet} "${hfile}" "${output}" "${output##*/}"; then @@ -76,7 +80,7 @@ main() { # If the backend fails, we can just remove the temporary directory to # remove all the cruft it may have left behind. Then we just exit in # error too. - if ! "${OLDPWD}/support/download/${backend}" "${tmpf}" "${@}"; then + if ! "${OLDPWD}/support/download/${backend}" ${backend_quiet} "${tmpf}" "${@}"; then rm -rf "${tmpd}" exit 1 fi diff --git a/support/download/svn b/support/download/svn index a960f7d..4873219 100755 --- a/support/download/svn +++ b/support/download/svn @@ -4,7 +4,10 @@ set -e # Download helper for svn, to be called from the download wrapper script -# Expected arguments: +# +# Optional arguments: +# "-q": quiet flag +# Required arguments: # $1: output file # $2: svn repo # $3: svn revision @@ -12,11 +15,24 @@ set -e # And this environment: # SVN : the svn command to call +quiet= +while getopts "q" opt; do + case $opt in + q) + quiet=-q + ;; + \?) + exit 1 + ;; + esac +done +shift $((OPTIND-1)) + output="${1}" repo="${2}" rev="${3}" basename="${4}" -${SVN} export "${repo}@${rev}" "${basename}" +${SVN} ${quiet} export "${repo}@${rev}" "${basename}" tar czf "${output}" "${basename}"