From patchwork Thu Aug 7 08:15:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Porcedda X-Patchwork-Id: 377787 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 3E5CD1400B6 for ; Thu, 7 Aug 2014 18:15:36 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id A513C8CD1C; Thu, 7 Aug 2014 08:15:34 +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 P1pZwJFtBI37; Thu, 7 Aug 2014 08:15:29 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 216668CB78; Thu, 7 Aug 2014 08:15:26 +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 E3D611BF83B for ; Thu, 7 Aug 2014 08:15:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id DE7198CA7E for ; Thu, 7 Aug 2014 08:15:24 +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 DHG-UU2Q2YwF for ; Thu, 7 Aug 2014 08:15:20 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wg0-f42.google.com (mail-wg0-f42.google.com [74.125.82.42]) by whitealder.osuosl.org (Postfix) with ESMTPS id 24B278CBE1 for ; Thu, 7 Aug 2014 08:15:17 +0000 (UTC) Received: by mail-wg0-f42.google.com with SMTP id l18so3755424wgh.1 for ; Thu, 07 Aug 2014 01:15:16 -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=ASpymljtoE3f2MyyTu9e8wblRmm031mti0Z57u0Q2JE=; b=hnbPSFrfOU5VwrY5ZowOLSsUv8zcmjN+iH5E5g4WEcBwh/PoXjnqU6aCjrwh3Aj/fO 1HUl/Lr86O1sNKRGHKf7sVEEhnVoOItm/CIF2pU1R98a/+Df3e1Jyk7PbFIHnywK560I kbBMAd/ybeypR23BgtvLqtzFDRtn1rC3Q9bba7VY3xvv6QJmc7sJyK5m/JGi1Gew4lpP 5d5iSvQC7a6bnhSn9K87t9lkUi2yHj9677jlOh2BABsDEG/r4+X/R00kyaOvQv6wRIqB oBTHaqk2ThcmWCnMORJvcbfLnU+4PT/phg/HRlG/foMGeaz/SLcKGss0PUfJQw2W8grg uh6A== X-Received: by 10.194.189.230 with SMTP id gl6mr22605099wjc.118.1407399316275; Thu, 07 Aug 2014 01:15:16 -0700 (PDT) Received: from ld2077.tmt.telital.com ([213.205.6.118]) by mx.google.com with ESMTPSA id a4sm26452688wie.21.2014.08.07.01.15.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Aug 2014 01:15:15 -0700 (PDT) From: Fabio Porcedda To: buildroot@uclibc.org Date: Thu, 7 Aug 2014 10:15:09 +0200 Message-Id: <1407399309-5926-3-git-send-email-fabio.porcedda@gmail.com> X-Mailer: git-send-email 2.0.4 In-Reply-To: <1407399309-5926-1-git-send-email-fabio.porcedda@gmail.com> References: <1407399309-5926-1-git-send-email-fabio.porcedda@gmail.com> Cc: Thomas Petazzoni , "Yann E. MORIN" Subject: [Buildroot] [PATCH v5 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..dfb49be 100644 --- a/Makefile +++ b/Makefile @@ -198,6 +198,8 @@ else Q = @ endif +BR_SILENT = $(if $(filter s -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 bf22123..6ef3c3d 100644 --- a/package/Makefile.in +++ b/package/Makefile.in @@ -222,7 +222,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