From patchwork Mon Nov 24 13:56:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Porcedda X-Patchwork-Id: 413732 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id C1147140185 for ; Tue, 25 Nov 2014 00:57:14 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id F1C4D924D9; Mon, 24 Nov 2014 13:57:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ENDfl9vEoqZI; Mon, 24 Nov 2014 13:57:12 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 9D82C924C7; Mon, 24 Nov 2014 13:57:10 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 44A111C2236 for ; Mon, 24 Nov 2014 13:57:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 3ABD1924CB for ; Mon, 24 Nov 2014 13:57:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WmG6AmQ5F0uT for ; Mon, 24 Nov 2014 13:57:06 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by whitealder.osuosl.org (Postfix) with ESMTPS id C5B3592434 for ; Mon, 24 Nov 2014 13:57:05 +0000 (UTC) Received: by mail-wi0-f170.google.com with SMTP id bs8so8793163wib.1 for ; Mon, 24 Nov 2014 05:57:04 -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=itCFnrrsf9h5IoFF/wGQCSJzJdnYHDlOkYs1u7+Btpg=; b=ZgR6eE6124syRXyHWqF7SXDfe6HKWE0aU2fqhtt/JuVbph5hmR65374nwpgHdB7lI4 XI6S1TRfQg/xCkJk1csDy9m+jXP7cEdQ+lrAkT6oBfycj2WZ2GHovBU6Zy4/aOXOUmyB jk0+deJPzxpnqxf1Av/qtILsYm1vmXlfkdABrEwLuNPelrhR2CCzkEPKQoGSKS1DXoCJ 8YUUpKEz/ugIritJX9KmhSZPa7Vzo2gdPlIxKaiQcl8V8ZE5TjLp9MOotHMbq5IM3DYN dd7qhDcON7nBE9PbixXMKF7PcqL0mdMJq7NW5xO/oX/2U4D70fL7dbhHQJVfdePya2lR vXyQ== X-Received: by 10.194.110.161 with SMTP id ib1mr35522637wjb.78.1416837424462; Mon, 24 Nov 2014 05:57:04 -0800 (PST) Received: from ld2077.tmt.telital.com ([213.205.6.118]) by mx.google.com with ESMTPSA id mc10sm12114313wic.24.2014.11.24.05.57.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Nov 2014 05:57:03 -0800 (PST) From: Fabio Porcedda To: buildroot@uclibc.org Date: Mon, 24 Nov 2014 14:56:58 +0100 Message-Id: <1416837422-1977-2-git-send-email-fabio.porcedda@gmail.com> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1416837422-1977-1-git-send-email-fabio.porcedda@gmail.com> References: <1416837422-1977-1-git-send-email-fabio.porcedda@gmail.com> Cc: Thomas Petazzoni , "Yann E. MORIN" Subject: [Buildroot] [PATCH v4 next 1/5] support/download: silence git 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 git download helper using "git clone -q" just like others download helpers, e.g. wget. Signed-off-by: Fabio Porcedda --- Notes: v3: - add this patch package/pkg-download.mk | 3 ++- support/download/git | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/package/pkg-download.mk b/package/pkg-download.mk index f3409bd..95175d6 100644 --- a/package/pkg-download.mk +++ b/package/pkg-download.mk @@ -99,7 +99,8 @@ define DOWNLOAD_GIT $(DL_DIR)/$($(PKG)_SOURCE) \ $($(PKG)_SITE) \ $($(PKG)_DL_VERSION) \ - $($(PKG)_BASE_NAME) + $($(PKG)_BASE_NAME) \ + $(QUIET) endef # TODO: improve to check that the given PKG_DL_VERSION exists on the remote diff --git a/support/download/git b/support/download/git index 5d36ca4..4ce9030 100755 --- a/support/download/git +++ b/support/download/git @@ -9,6 +9,7 @@ set -e # $2: git repo # $3: git cset # $4: package's basename (eg. foobar-1.2.3) +# $5: "-q", optional quiet flag # And this environment: # GIT : the git command to call @@ -16,21 +17,26 @@ output="${1}" repo="${2}" cset="${3}" basename="${4}" +quiet="${5}" # Try to see if we can do a shallow clone, since it is faster # than a full clone. git_done=0 if [ -n "$(${GIT} ls-remote "${repo}" "${cset}" 2>&1)" ]; then - printf "Doing shallow clone\n" - if ${GIT} clone --depth 1 -b "${cset}" --bare "${repo}" "${basename}"; then + if [ -z "${quiet}" ]; then + printf "Doing shallow clone\n"; + fi + if ${GIT} clone ${quiet} --depth 1 -b "${cset}" --bare "${repo}" "${basename}"; then git_done=1 else printf "Shallow clone failed, falling back to doing a full clone\n" fi fi if [ ${git_done} -eq 0 ]; then - printf "Doing full clone\n" - ${GIT} clone --bare "${repo}" "${basename}" + if [ -z "${quiet}" ]; then + printf "Doing full clone\n"; + fi + ${GIT} clone ${quiet} --bare "${repo}" "${basename}" fi GIT_DIR="${basename}" \