From patchwork Fri Aug 1 11:24: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: 375714 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 992871400E0 for ; Fri, 1 Aug 2014 21:25:18 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id E126E8AE46; Fri, 1 Aug 2014 11:25:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TUWKN7ZMQHZr; Fri, 1 Aug 2014 11:25:10 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 960E28B3A8; Fri, 1 Aug 2014 11:25: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 3AA0E1BFA89 for ; Fri, 1 Aug 2014 11:25:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 35C288BEB4 for ; Fri, 1 Aug 2014 11:25:09 +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 WzhQS6huaNt7 for ; Fri, 1 Aug 2014 11:25:08 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pd0-f180.google.com (mail-pd0-f180.google.com [209.85.192.180]) by whitealder.osuosl.org (Postfix) with ESMTPS id C57D08BE62 for ; Fri, 1 Aug 2014 11:25:08 +0000 (UTC) Received: by mail-pd0-f180.google.com with SMTP id y13so5334227pdi.39 for ; Fri, 01 Aug 2014 04:25:07 -0700 (PDT) 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=ek7c70Dx7tM1fpRVbZSYUjLyRIaUY40c4iZiuO+5VbY=; b=KXzX+efKFJVUgAqA8Dci87OUGw5SP85m03MUq0zGIgIEKnbCULNvAy351fo1BSTeBV 2pQ/+eWg2u4BYKup7Pb4i1WR4mG2DhcxSP8gRdYnuPgmtfwJhwGiejOfsPzU6kwldO8H eBh3KUCzQ9qXoMWzRgvPRDH2Ou0NSZq8S4514vGr8ARkDEwG2DsXKD8TrbClnrRiNxIJ 64hQCd/zyw6r8YE/RiC0Jxup4p7KTS66JoXP6dgJannSwTNw9O8uuCReJl1++8JckW80 X+yI/vV0PH7AMviQQSMN91T4L0TEk7Wls8dvBTrNdSzFhIjVY3L15yJd/ay7gX10nCxk E3qQ== X-Received: by 10.66.226.100 with SMTP id rr4mr5230665pac.48.1406892307288; Fri, 01 Aug 2014 04:25:07 -0700 (PDT) Received: from ld2077.tmt.telital.com ([213.205.6.118]) by mx.google.com with ESMTPSA id fz10sm12655826pdb.48.2014.08.01.04.25.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 01 Aug 2014 04:25:06 -0700 (PDT) From: Fabio Porcedda To: buildroot@uclibc.org Date: Fri, 1 Aug 2014 13:24:58 +0200 Message-Id: <1406892298-9460-3-git-send-email-fabio.porcedda@gmail.com> X-Mailer: git-send-email 2.0.3 In-Reply-To: <1406892298-9460-1-git-send-email-fabio.porcedda@gmail.com> References: <1406892298-9460-1-git-send-email-fabio.porcedda@gmail.com> Cc: Thomas Petazzoni , "Yann E. MORIN" Subject: [Buildroot] [PATCH v4 2/2] apply-patches.sh: don't print anything when "make -s" is used X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 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-bounces@busybox.net The make "-s" option is used to enable the "Silent operation" so if that option is used don't print anything as far as there isn't any error. Add the "-s" option to "apply-patches.sh" to enable silent operation. Also add the "BR_SILENT" variable the contain "YES" when "make -s" is used so others parts can use it to silence the build as well. Signed-off-by: Fabio Porcedda Reviewed-by: "Yann E. MORIN" --- Makefile | 2 ++ package/Makefile.in | 2 +- support/scripts/apply-patches.sh | 17 ++++++++++++++--- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index c82b07f..73eb033 100644 --- a/Makefile +++ b/Makefile @@ -198,6 +198,8 @@ else Q = @ endif +BR_SILENT = $(if $(findstring s,$(MAKEFLAGS)),YES) + # we want bash as shell SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ else if [ -x /bin/bash ]; then echo /bin/bash; \ diff --git a/package/Makefile.in b/package/Makefile.in index d17115b..c00c4f3 100644 --- a/package/Makefile.in +++ b/package/Makefile.in @@ -218,7 +218,7 @@ FLEX := $(shell which flex || type -p flex) BISON := $(shell which bison || type -p bison) SED := $(shell which sed || type -p sed) -i -e -APPLY_PATCHES = support/scripts/apply-patches.sh +APPLY_PATCHES = support/scripts/apply-patches.sh $(if $(BR_SILENT),-s) HOST_CPPFLAGS = -I$(HOST_DIR)/usr/include HOST_CFLAGS ?= -O2 diff --git a/support/scripts/apply-patches.sh b/support/scripts/apply-patches.sh index 37f2d81..16e0b41 100755 --- a/support/scripts/apply-patches.sh +++ b/support/scripts/apply-patches.sh @@ -6,6 +6,8 @@ # (c) 2002 Erik Andersen # # Parameters: +# - "-s",optional. Silent operation, don't print anything if there +# isn't any error. # - the build directory, optional, default value is '.'. The place where are # the package sources. # - the patch directory, optional, default '../kernel-patches'. The place @@ -28,6 +30,13 @@ # applied. The list of the patches applied is stored in '.applied_patches_list' # file in the build directory. +silent= +if [ "$1" = "-s" ] ; then + # add option to be used by the patch tool + silent=-s + shift +fi + # Set directories from arguments, or use defaults. builddir=${1-.} patchdir=${2-../kernel-patches} @@ -77,14 +86,16 @@ function apply_patch { return 0 ;; esac - echo "" - echo "Applying $patch using ${type}: " + if [ -z "$silent" ] ; then + echo "" + echo "Applying $patch using ${type}: " + fi if [ ! -e "${path}/$patch" ] ; then echo "Error: missing patch file ${path}/$patch" exit 1 fi echo $patch >> ${builddir}/.applied_patches_list - ${uncomp} "${path}/$patch" | patch -g0 -p1 -E -d "${builddir}" -t -N + ${uncomp} "${path}/$patch" | patch $silent -g0 -p1 -E -d "${builddir}" -t -N if [ $? != 0 ] ; then echo "Patch failed! Please fix ${patch}!" exit 1