From mboxrd@z Thu Jan 1 00:00:00 1970 From: Neil Horman Subject: Re: [PATCH] checkpatches.sh: Add checks for ABI symbol addition Date: Mon, 15 Jan 2018 19:36:06 -0500 Message-ID: <20180116003606.GA15433@neilslaptop.think-freely.org> References: <20180115190545.25687-1-nhorman@tuxdriver.com> <20180115142038.217d9a1e@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org, thomas@monjalon.net, john.mcnamara@intel.com, bruce.richardson@intel.com, Ferruh Yigit To: Stephen Hemminger Return-path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id B92822BF4 for ; Tue, 16 Jan 2018 01:36:15 +0100 (CET) Content-Disposition: inline In-Reply-To: <20180115142038.217d9a1e@xeon-e3> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, Jan 15, 2018 at 02:20:38PM -0800, Stephen Hemminger wrote: > On Mon, 15 Jan 2018 14:05:45 -0500 > Neil Horman wrote: > > > > > +build_map_changes() > > +{ > > + local fname=$1 > > + local mapdb=$2 > > + > > + cat $fname | filterdiff -i *.map | awk ' > > You don't need cat, use shell redirection same for later while loop. > This is likely moot given Thomas' request to put this in a separate script, but point taken > > + BEGIN {map="";sym="";ar="";sec=""; in_sec=0} > > + /[-+] a\/.*\.map/ {map=$2} > > + /+.*{/ {gsub("+","");sec=$1; in_sec=1} > Add some whitespace and indentation to awk? Yeah, I can document this block as a whole as well > > > + /.*}/ {in_sec=0} > > + /^+.*[^:*];/ {gsub(";","");sym=$2; > > + if (in_sec == 1) { > > + print map " " sym " " sec " add" > > + } > > + } > > + /^-.*[^:*];/ {gsub(";","");sym=$2; > > + if (in_sec == 1) { > > + print map " " sym " " sec " del" > > + } > > + }' > ./$mapdb > > + > > + sort $mapdb | uniq > ./$mapdb.2 > > sort -u Copy that. > > > + mv -f $mapdb.2 $mapdb > > + > > +} > > + >