From patchwork Fri Aug 29 09:20:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Porcedda X-Patchwork-Id: 384114 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 5AE9214013B for ; Fri, 29 Aug 2014 19:20:24 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 6F546A1009; Fri, 29 Aug 2014 09:20:23 +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 YxyHZg1FKIbD; Fri, 29 Aug 2014 09:20:21 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4A063A0FE9; Fri, 29 Aug 2014 09:20:21 +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 1C2BA1C24B4 for ; Fri, 29 Aug 2014 09:20:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0F65B914C6 for ; Fri, 29 Aug 2014 09:20:20 +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 evpqjBgZ-tzA for ; Fri, 29 Aug 2014 09:20:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com [209.85.217.170]) by whitealder.osuosl.org (Postfix) with ESMTPS id 3DA8F914A6 for ; Fri, 29 Aug 2014 09:20:15 +0000 (UTC) Received: by mail-lb0-f170.google.com with SMTP id w7so2308128lbi.29 for ; Fri, 29 Aug 2014 02:20:13 -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=Kvd59yaKwk5GsI9KkgQXtD2Mz5b2YoCQSC/7Ad3Vx24=; b=j7Rjc3lkKZtpz7fEtr+srtRTtlnp6hDHXp8YVrMpObjNxbYleWIA1m1pfzYYfZano8 3qls7+eYXW99Wnu1d5T5uQIHVOifcoKVVYmFzswDIoKVGKcAtXDY7kmKngfXHLGtPmYS 2k4HgvW6jzuMKDIy9meC5CmjYFPL+LJxY/XfySiJPSCoV0BajcjT8QqhaMlLyg22icE6 1w1ZXWDBEcsmygW1+FN3zkL2RcDHVqDKFftzBdV7mJhoyFJxkOmRKJIO4bU+O060c24F omSvhMpbeg3h6SiA2HfI9Jd8bbyPTCIFLZS049AlepBhOmGG/tXjJ++lgDPCdyTkYwAo eNmQ== X-Received: by 10.152.7.212 with SMTP id l20mr10051173laa.7.1409304013404; Fri, 29 Aug 2014 02:20:13 -0700 (PDT) Received: from ld2077.tmt.telital.com ([213.205.6.118]) by mx.google.com with ESMTPSA id n6sm10360602lbr.38.2014.08.29.02.20.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Aug 2014 02:20:12 -0700 (PDT) From: Fabio Porcedda To: buildroot@uclibc.org Date: Fri, 29 Aug 2014 11:20:05 +0200 Message-Id: <1409304005-10318-3-git-send-email-fabio.porcedda@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1409304005-10318-1-git-send-email-fabio.porcedda@gmail.com> References: <1409304005-10318-1-git-send-email-fabio.porcedda@gmail.com> Cc: Thomas Petazzoni , "Yann E. MORIN" Subject: [Buildroot] [PATCH v6 branch/next 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 46b2128..dc7f085 100644 --- a/Makefile +++ b/Makefile @@ -198,6 +198,8 @@ else Q = @ endif +BR_SILENT = $(if $(findstring s, $(filter-out --%, $(MAKEFLAGS))), y) + # 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..91cb3b8 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..b32d592 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 -g0 -p1 -E -d "${builddir}" -t -N $silent if [ $? != 0 ] ; then echo "Patch failed! Please fix ${patch}!" exit 1