From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from [107.15.66.59] (helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1ebFEW-00030Q-5H; Mon, 15 Jan 2018 19:36:10 -0500 Date: Mon, 15 Jan 2018 19:36:06 -0500 From: Neil Horman To: Stephen Hemminger Cc: dev@dpdk.org, thomas@monjalon.net, john.mcnamara@intel.com, bruce.richardson@intel.com, Ferruh Yigit 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 Content-Disposition: inline In-Reply-To: <20180115142038.217d9a1e@xeon-e3> User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Score: -2.9 (--) X-Spam-Status: No Subject: Re: [dpdk-dev] [PATCH] checkpatches.sh: Add checks for ABI symbol addition X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 00:36:15 -0000 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 > > + > > +} > > + >