From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH] checkpatches.sh: Add checks for ABI symbol addition Date: Mon, 15 Jan 2018 14:20:38 -0800 Message-ID: <20180115142038.217d9a1e@xeon-e3> References: <20180115190545.25687-1-nhorman@tuxdriver.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, thomas@monjalon.net, john.mcnamara@intel.com, bruce.richardson@intel.com, Ferruh Yigit To: Neil Horman Return-path: Received: from mail-pf0-f180.google.com (mail-pf0-f180.google.com [209.85.192.180]) by dpdk.org (Postfix) with ESMTP id 194E32BF4 for ; Mon, 15 Jan 2018 23:20:42 +0100 (CET) Received: by mail-pf0-f180.google.com with SMTP id 23so8683318pfp.3 for ; Mon, 15 Jan 2018 14:20:41 -0800 (PST) In-Reply-To: <20180115190545.25687-1-nhorman@tuxdriver.com> 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, 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. > + 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? > + /.*}/ {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 > + mv -f $mapdb.2 $mapdb > + > +} > +