From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 5A22E2A9 for ; Fri, 28 Nov 2014 12:36:25 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 28 Nov 2014 03:35:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,476,1413270000"; d="scan'208";a="615437974" Received: from bricha3-mobl3.ger.corp.intel.com ([10.243.20.19]) by orsmga001.jf.intel.com with SMTP; 28 Nov 2014 03:35:36 -0800 Received: by (sSMTP sendmail emulation); Fri, 28 Nov 2014 11:35:35 +0025 Date: Fri, 28 Nov 2014 11:35:35 +0000 From: Bruce Richardson To: David Marchand Message-ID: <20141128113535.GA10024@bricha3-MOBL3> References: <1417087745-9004-1-git-send-email-david.marchand@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1417087745-9004-1-git-send-email-david.marchand@6wind.com> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] scripts: fix symbol overriding in configuration files X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Nov 2014 11:36:27 -0000 On Thu, Nov 27, 2014 at 12:29:05PM +0100, David Marchand wrote: > When redefining the same symbol in configuration (basically after an inclusion), > we need to undefine the previous symbol to avoid "redefined" errors. > > Signed-off-by: David Marchand Though I see this patch is already replied, my comment on the below is that it may be best as two separate patches, since you are doing two things there that makes the actual change hard to see. One patch should move the "|" from the start of the next line to end of the previous, and the second patch should then add the undef statements. As it is, I had to stare at this for a while to work out why the grep lines were changing to undefine previously defined values. :-) /Bruce > --- > scripts/gen-config-h.sh | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/scripts/gen-config-h.sh b/scripts/gen-config-h.sh > index efd7667..2fac08c 100755 > --- a/scripts/gen-config-h.sh > +++ b/scripts/gen-config-h.sh > @@ -33,11 +33,11 @@ > > echo "#ifndef __RTE_CONFIG_H" > echo "#define __RTE_CONFIG_H" > -grep CONFIG_ $1 \ > -| grep -v '^[ \t]*#' \ > -| sed 's,CONFIG_\(.*\)=y.*$,#define \1 1,' \ > -| sed 's,CONFIG_\(.*\)=n.*$,#undef \1,' \ > -| sed 's,CONFIG_\(.*\)=\(.*\)$,#define \1 \2,' \ > -| sed 's,\# CONFIG_\(.*\) is not set$,#undef \1,' > +grep CONFIG_ $1 | > +grep -v '^[ \t]*#' | > +sed 's,CONFIG_\(.*\)=y.*$,#undef \1\n#define \1 1,' | > +sed 's,CONFIG_\(.*\)=n.*$,#undef \1,' | > +sed 's,CONFIG_\(.*\)=\(.*\)$,#undef \1\n#define \1 \2,' | > +sed 's,\# CONFIG_\(.*\) is not set$,#undef \1,' > echo "#endif /* __RTE_CONFIG_H */" > > -- > 1.7.10.4 >