From patchwork Tue Oct 21 17:20:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_Bie=C3=9Fmann?= X-Patchwork-Id: 401663 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id EDCBF140088 for ; Wed, 22 Oct 2014 04:52:20 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; q=dns; s=default; b=XmzRoGk86IghGegjQ/A94TFhQ+ZjdC7dpeRUSwMVybp SyLl6b0423b485dHF9y3QcpdZwyXaaYJJvzft7KKSRAG/O5I2WRQXFgxrSKlOz7g /jNPucYksWKFW6/hIQHCaYjNUPe084uoz50YTGP122Y6BUiaoKgHIMN2WGzlpE9s = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; s=default; bh=dW0yOUBuLrYGhnraqTMck3FogBs=; b=mnV2Oa74vepKppmRj QI0Nm8uSGjhZk1AR7RNN+b8+rUa7aHh1/OTbIuttANC5vtXTVfPPcy7q2aFAs5hi U523PMuB8GABauuZKtP/xRme54gfMBI5Nb0bVw16OgRJDlvmVjUqi9SBeOUIAINn v1WpEs4qHbsZkgwbF/7sPnkP+g= Received: (qmail 26561 invoked by alias); 21 Oct 2014 17:20:43 -0000 Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org Delivered-To: mailing list crossgcc@sourceware.org Received: (qmail 26522 invoked by uid 89); 21 Oct 2014 17:20:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: cyclops.biessmann.org Received: from cyclops.biessmann.org (HELO cyclops.biessmann.org) (134.0.25.77) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 21 Oct 2014 17:20:40 +0000 Received: from localhost (er.biessmann.org [80.81.14.92]) by cyclops.biessmann.org (Postfix) with ESMTPSA id BB343B62B1; Tue, 21 Oct 2014 19:20:37 +0200 (CEST) From: =?UTF-8?q?Andreas=20Bie=C3=9Fmann?= To: crossgcc@sourceware.org Cc: andreas@biessmann.de, "Jason T. Masker" Subject: [RESENT] [PATCH v2] scripts/crosstool-NG.sh.in: patch regex to work with BSD grep Date: Tue, 21 Oct 2014 19:20:22 +0200 Message-Id: <1413912022-25263-1-git-send-email-andreas@biessmann.de> In-Reply-To: References: MIME-Version: 1.0 X-IsSubscribed: yes From: "Jason T. Masker" BSD grep does not interpret a null alteration. It complains about an empty sub-expression, e.g.: $ grep --version && grep -E '^(# |)CT_' .config grep (BSD grep) 2.5.1-FreeBSD grep: empty (sub)expression This patch replaces the null alteration with a zero or once quantifier which works with both BSD & GNU grep. $ grep --version && grep -E '^(# )?CT_' .config grep (BSD grep) 2.5.1-FreeBSD CT_CONFIGURE_has_xz=y CT_CONFIGURE_has_svn=y ... $ ggrep --version && ggrep -E '^(# )?CT_' .config ggrep (GNU grep) 2.20 Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Mike Haertel and others, see . CT_CONFIGURE_has_xz=y CT_CONFIGURE_has_svn=y ... Signed-off-by: Jason T. Masker Tested-by: Andreas Bießmann --- This is just a resent cause the original message could not be applied properly. I also add my Tested-by, tested on OS X 10.10. since v1: * adopt commit message Jason's v2/v3 messge: * Updated patch to also fix change another occurrence, found in kconfig/kconfig.mk. kconfig/kconfig.mk | 2 +- scripts/crosstool-NG.sh.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kconfig/kconfig.mk b/kconfig/kconfig.mk index cb9f91c..06e022c 100644 --- a/kconfig/kconfig.mk +++ b/kconfig/kconfig.mk @@ -38,7 +38,7 @@ defconfig: # Always be silent, the stdout an be >.config extractconfig: @$(awk) 'BEGIN { dump=0; } \ - dump==1 && $$0~/^\[.....\][[:space:]]+(# |)CT_/ { \ + dump==1 && $$0~/^\[.....\][[:space:]]+(# )?CT_/ { \ $$1=""; \ gsub("^[[:space:]]",""); \ print; \ diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in index cd65d5b..53ac552 100644 --- a/scripts/crosstool-NG.sh.in +++ b/scripts/crosstool-NG.sh.in @@ -125,7 +125,7 @@ CT_DoLog INFO "Build started ${CT_STAR_DATE_HUMAN}" # We really need to extract from ,config and not .config.2, as we # do want the kconfig's values, not our mangled config with arrays. CT_DoStep DEBUG "Dumping user-supplied crosstool-NG configuration" -CT_DoExecLog DEBUG ${grep} -E '^(# |)CT_' .config +CT_DoExecLog DEBUG ${grep} -E '^(# )?CT_' .config CT_EndStep CT_DoLog DEBUG "Unsetting and unexporting MAKEFLAGS"