From patchwork Tue Dec 30 11:41:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Porcedda X-Patchwork-Id: 424621 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 96717140119 for ; Tue, 30 Dec 2014 22:41:19 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id C6AFD303C3; Tue, 30 Dec 2014 11:41:18 +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 NmYHnLWQ6CNq; Tue, 30 Dec 2014 11:41:17 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 432862FC15; Tue, 30 Dec 2014 11:41:17 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 966D71C1081 for ; Tue, 30 Dec 2014 11:41:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 9343187F39 for ; Tue, 30 Dec 2014 11:41:16 +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 7FrYokbzNA4f for ; Tue, 30 Dec 2014 11:41:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by fraxinus.osuosl.org (Postfix) with ESMTPS id BAFC787E43 for ; Tue, 30 Dec 2014 11:41:15 +0000 (UTC) Received: by mail-wi0-f175.google.com with SMTP id l15so23779643wiw.14 for ; Tue, 30 Dec 2014 03:41:14 -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=ofn5cKBBdIQ/fu/juO4f/uaZHu9xTFcGa/FmkYr6lCU=; b=azEJyMfu7Nh8mM3AeFnxqMdfZcBDmQRJULmr3r+/xqwEgR0ILJLfjKubfyZ+6+tlCt zFMo5sz0+slsN+W5KvM9Ba4YTaBHbMk+uKh1adjmtSBcVueK3f5S4fRmGWq/HcVDtf6x BVyLycL6a0advvUmN1SMgZfZxVUaCy/qwnbRmGNc6vOKWkZ8bWgcWQiOpSH2L6dl/tmv 2zj4NEeoJByGvPmvSZTIxiieoZKDyOr4daIU0yrsKPw2KJ1L/MwKnouCwlMuOiEwg3bn Jh1aJpPk26nSHlDKZdZMWQ2DUlYJ/LMQM9XrBvYQqHAn383ZwJdc2i8250GK/npUVMag bvOQ== X-Received: by 10.180.97.7 with SMTP id dw7mr107240955wib.6.1419939674339; Tue, 30 Dec 2014 03:41:14 -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 cs8sm43118763wib.1.2014.12.30.03.41.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Dec 2014 03:41:13 -0800 (PST) From: Fabio Porcedda To: buildroot@uclibc.org Date: Tue, 30 Dec 2014 12:41:06 +0100 Message-Id: <1419939667-27095-3-git-send-email-fabio.porcedda@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1419939667-27095-1-git-send-email-fabio.porcedda@gmail.com> References: <1419939667-27095-1-git-send-email-fabio.porcedda@gmail.com> Cc: Thomas Petazzoni , "Yann E. MORIN" Subject: [Buildroot] [PATCH v6 2/3] 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 --- package/pkg-download.mk | 1 + support/download/dl-wrapper | 11 ++++++++--- support/download/svn | 17 ++++++++++++++++- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/package/pkg-download.mk b/package/pkg-download.mk index ba72fc1..88d1437 100644 --- a/package/pkg-download.mk +++ b/package/pkg-download.mk @@ -147,6 +147,7 @@ define DOWNLOAD_SVN $(EXTRA_ENV) $(DL_WRAPPER) -b svn \ -o $(DL_DIR)/$($(PKG)_SOURCE) \ -H $(PKGDIR)/$($(PKG)_RAWNAME).hash \ + $(QUIET) \ -- \ $($(PKG)_SITE) \ $($(PKG)_DL_VERSION) \ diff --git a/support/download/dl-wrapper b/support/download/dl-wrapper index cced8f6..7cd8606 100755 --- a/support/download/dl-wrapper +++ b/support/download/dl-wrapper @@ -21,15 +21,16 @@ set -e main() { local OPT OPTARG - local backend output hfile + local backend output hfile quiet # Parse our options; anything after '--' is for the backend - while getopts :hb:o:H: OPT; do + while getopts :hb:o:H:q OPT; do case "${OPT}" in h) help; exit 0;; b) backend="${OPTARG}";; o) output="${OPTARG}";; H) hfile="${OPTARG}";; + q) quiet="-q";; :) error "option '%s' expects a mandatory argument\n" "${OPTARG}";; \?) error "unknown option '%s'\n" "${OPTARG}";; esac @@ -47,6 +48,10 @@ main() { error "no hash-file specified, use -H\n" fi + if [ "${backend}" != "svn" ]; then + quiet= + fi + # If the output file already exists, do not download it again if [ -e "${output}" ]; then if support/download/check-hash "${hfile}" "${output}" "${output##*/}"; then @@ -75,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}" ${quiet} "${tmpf}" "${@}"; then rm -rf "${tmpd}" exit 1 fi diff --git a/support/download/svn b/support/download/svn index a960f7d..90470dd 100755 --- a/support/download/svn +++ b/support/download/svn @@ -4,6 +4,8 @@ set -e # Download helper for svn, to be called from the download wrapper script +# Optional arguments: +# "-q": quiet flag # Expected arguments: # $1: output file # $2: svn repo @@ -12,11 +14,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}"