From patchwork Thu Oct 16 16:56:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Masker X-Patchwork-Id: 400331 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 7EC4014007D for ; Fri, 17 Oct 2014 03:57:25 +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:mime-version:from:date:message-id:subject:to :content-type; q=dns; s=default; b=CkJB93pvXvIKO24buve5lpuq9x5B4 isSL4KwONsSODSWdd63OAkkvZfVb8IkJFlaWTzpi3Vod6/jDbMp1gYjnfErWm+tY wzylG2d5GFi3Sn7lWkU3OhPADuRhR1ZV45Iigq9m6meyChAxYJMvKakhxXwb6x9q PK3famaEWVlz8g= 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:mime-version:from:date:message-id:subject:to :content-type; s=default; bh=DzlZL0t37OVJHQnG/pjt7mDQ5cs=; b=y2N m9E4qR8LzxnBFXzYmq0dn7cnvC4c0sjLAwq186h9klP3xKyFgx95Daj7Ek4/Fg/a SeRW3U9p7NLjK7ZJW9csl1d3bPOezLTZdiDmLvOJW69lv//KlupeENIiiNA8SPQy juaMFzsavM7k9IERSEukJ+SVV4deKA09VlEBfKYg= Received: (qmail 6823 invoked by alias); 16 Oct 2014 16:57:18 -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 6812 invoked by uid 89); 16 Oct 2014 16:57:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oi0-f48.google.com Received: from mail-oi0-f48.google.com (HELO mail-oi0-f48.google.com) (209.85.218.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 16 Oct 2014 16:57:16 +0000 Received: by mail-oi0-f48.google.com with SMTP id g201so2966851oib.35 for ; Thu, 16 Oct 2014 09:57:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type; bh=MmpMQtsqYy9BFJUJz9TyVCk73jCqY5A6ZXiA82S38EA=; b=VJRvdpYsq6lwGjWAe4bBPoL1iCYITVkEEuBf9rMaXYzhYyd1qpAfRGJzKOzjQh/YI5 Hu06+VKuYaAZP+R/Q88sPZr9Z1k3uds8wmn2CwmTOLM2y9loXxROALG9rXz5pfgykgQe wwrVPDU+qZBcgiXCEkR+UG9ZBYI45JasLBPqj3wc8JXZhtXuLz8fg93fut9mc79AdKtA HeMdBBPN60Uov1ha1Bi3gtnwKRK0B42Kts7/DJznzvFHRhOZNzx7XYsxDKx638Z/YQqR fo7tatCUGcAopUP9TkC0GRpEeeWsvRhV+N2EVZRvlfRK/GUKMjTcM9RLVHiQyZd1GJz1 ccCw== X-Gm-Message-State: ALoCoQmgnSjvbViR/Kiw3OykSSd0hAtBxeRtv5vsiHZ89eddcg/d5GesxnaQ1dIhyDZOCwaTjSj8 X-Received: by 10.182.245.225 with SMTP id xr1mr2049964obc.13.1413478634536; Thu, 16 Oct 2014 09:57:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.62.12 with HTTP; Thu, 16 Oct 2014 09:56:54 -0700 (PDT) From: "Jason T. Masker" Date: Thu, 16 Oct 2014 12:56:54 -0400 Message-ID: Subject: Re: [PATCH] [RESEND] scripts/crosstool-NG.sh.in: patch regex to work with BSD grep To: crossgcc Resending with sign off. Apologies. 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 Masker --- For unsubscribe information see http://sourceware.org/lists.html#faq 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"