From patchwork Wed Oct 22 16:20:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Porcedda X-Patchwork-Id: 402212 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 76968140081 for ; Thu, 23 Oct 2014 03:20:29 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 9E6489599C; Wed, 22 Oct 2014 16:20:28 +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 OfQZuRtwlCKe; Wed, 22 Oct 2014 16:20:27 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id BD049959C5; Wed, 22 Oct 2014 16:20:27 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 86E591C1081 for ; Wed, 22 Oct 2014 16:20:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 8071B959C2 for ; Wed, 22 Oct 2014 16:20:26 +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 UdaVinjk1BsE for ; Wed, 22 Oct 2014 16:20:25 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-la0-f46.google.com (mail-la0-f46.google.com [209.85.215.46]) by hemlock.osuosl.org (Postfix) with ESMTPS id 1AE1995859 for ; Wed, 22 Oct 2014 16:20:24 +0000 (UTC) Received: by mail-la0-f46.google.com with SMTP id gi9so3210895lab.19 for ; Wed, 22 Oct 2014 09:20:23 -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=7Ps9h4J6Wb13viWaM1HMO0oibivtqjT0s6cYPAgTcGg=; b=Xo4+6pzy2UUZwPnOjV9wGf/763bB05bP1Gu56pxIztCBdYIJmTXBaAmGNAGjLOGA1t FDW98G/LXiUgRM+4kTWiW/0IZWFvofVssba32BhS6+9tr0Zt1vevZ9ehh6OpQtGYn5Mg 2P9BBNrCs8pd3ABYyD6bVnOn5gj/l/X3xp0wqJkavftmS8eCZCBNmxhNjxwdlhuvH33W ppWMN/vjdAssnPJxixSwRI2G95l364oKZw0Bwi3gNcjlBs3iymPddaOmP60mn80MFo3W jRwaPR9NERnyi39FkJG9EeWDfpMAMoZ0cRtMyShnwvncN3STX2+dZysXK6GDZq5GhWE9 urMw== X-Received: by 10.112.142.33 with SMTP id rt1mr24219037lbb.85.1413994823099; Wed, 22 Oct 2014 09:20:23 -0700 (PDT) Received: from ld2077.tmt.telital.com ([213.205.6.118]) by mx.google.com with ESMTPSA id xe10sm5980786lbb.37.2014.10.22.09.20.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 22 Oct 2014 09:20:18 -0700 (PDT) From: Fabio Porcedda To: buildroot@uclibc.org Date: Wed, 22 Oct 2014 18:20:11 +0200 Message-Id: <1413994811-19452-3-git-send-email-fabio.porcedda@gmail.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1413994811-19452-1-git-send-email-fabio.porcedda@gmail.com> References: <1413994811-19452-1-git-send-email-fabio.porcedda@gmail.com> Cc: Thomas Petazzoni , "Yann E. MORIN" Subject: [Buildroot] [PATCH 2/2] apply-patches.sh: don't print anything when "make -s" is used 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" 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 907a0fc..c573740 100644 --- a/Makefile +++ b/Makefile @@ -202,6 +202,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 4a434ab..73767f1 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