From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 3BD3FA84C for ; Sun, 21 Jan 2018 21:29:56 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 97668209F9; Sun, 21 Jan 2018 15:29:55 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Sun, 21 Jan 2018 15:29:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=SKaQmTaTnkt6ZgLAP4ESixjBmV FM0IfucaiRRx31Tzc=; b=okeapkOiI2/eUh+f9pmpVc9PpPzn7uptUmUohgLXZj Jo3WHkLqepapacTfvySIW9B5pp7YsiZPVfi9WCigIq20zEzs8qbRp0kmbQMgl+kp 2+P6DZ8tYAWT0VaAwkGZgP5hbpRirvRPmUms1G0BZk5DUOP3ZawajJP0dbW7ij8G w= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=SKaQmT aTnkt6ZgLAP4ESixjBmVFM0IfucaiRRx31Tzc=; b=rQH/zwoMJipYtRe2RTWc+y sYztGF/P0Ee6ZhIU4wxVQnys3BSCSKuDm+JBmkf0yTuk5WF2aGIGXMSlyJ67EXYQ B8jt8DIh7HJ5jLETx615aZTEPaVDMRUjJGrtT46QCqNFYXDDnS1hhH8Cfrc+RLon z21OXads6gv6n/ouSvVVh4GFDoqvLwchyWTRZi4nVKn8HeeXSSdvbLlduQWBC0fQ fdPMki5nyXdyiLadzPcE2DNl3J2/iTHkUpahALHrYdbjiG/BYUfriuhdOEAjjRXa xEdVSkNyjKJcaZ9smCV9xs/LZppTtRAMAh9Znc7eGbCMmf/8KuxVnjnPwuUD86xw == X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 44377240DE; Sun, 21 Jan 2018 15:29:55 -0500 (EST) From: Thomas Monjalon To: Neil Horman Cc: dev@dpdk.org, john.mcnamara@intel.com, bruce.richardson@intel.com, Ferruh Yigit , Stephen Hemminger Date: Sun, 21 Jan 2018 21:29:18 +0100 Message-ID: <10549424.KHioEKbQpN@xps> In-Reply-To: <20180116182225.27133-1-nhorman@tuxdriver.com> References: <20180115190545.25687-1-nhorman@tuxdriver.com> <20180116182225.27133-1-nhorman@tuxdriver.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v2] 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: Sun, 21 Jan 2018 20:29:56 -0000 Hi, 16/01/2018 19:22, Neil Horman: > --- a/MAINTAINERS > +++ b/MAINTAINERS > Developers and Maintainers Tools > M: Thomas Monjalon > +M: Neil Horman > F: MAINTAINERS > F: devtools/check-dup-includes.sh > F: devtools/check-maintainers.sh > @@ -52,6 +53,7 @@ F: devtools/get-maintainer.sh > F: devtools/git-log-fixes.sh > F: devtools/load-devel-config > F: devtools/test-build.sh > +F: devtools/validate-new-api.sh > F: license/ I really think it should be in the section "ABI versioning"" > --- a/devtools/checkpatches.sh > +++ b/devtools/checkpatches.sh > +export VALIDATE_NEW_API=$(dirname $(readlink -e $0))/validate-new-api.sh Why export? > print_usage () { > cat <<- END_OF_HELP > + $(dirname $0) > usage: $(basename $0) [-q] [-v] [-nX|patch1 [patch2] ...]] This dirname is a debug leftover? > @@ -96,9 +100,25 @@ check () { # > else > report=$($DPDK_CHECKPATCH_PATH $options - 2>/dev/null) > fi > - [ $? -ne 0 ] || return 0 > + reta=$? What means reta? > + > $verbose || printf '\n### %s\n\n' "$3" > printf '%s\n' "$report" | sed -n '1,/^total:.*lines checked$/p' > + > + echo > + echo "Checking API additions/removals:" You should respect $verbose before printing such header. > + if [ -n "$1" ] ; then > + report=$($VALIDATE_NEW_API $1) > + elif [ -n "$2" ] ; then > + report=$(git format-patch \ > + --find-renames --no-stat --stdout -1 $commit | > + $VALIDATE_NEW_API -) > + else > + report=$($VALIDATE_NEW_API -) > + fi > + [ $? -ne 0 -o $reta -ne 0 ] || return 0 > + printf '%s\n' "$report" | sed -n '1,/^total:.*lines checked$/p' > + > status=$(($status + 1)) > } > --- /dev/null > +++ b/devtools/validate-new-api.sh About the file name, is it only for new API? You don't like check-symbol-change.sh ? It may be stupid, but I thought "validate" is more related to full test, like validate-abi.sh does for the ABI, and "check" can be a partial test like done in checkpatches.sh. > + }' > ./$mapdb > + > + sort -u $mapdb > ./$mapdb.2 > + mv -f $mapdb.2 $mapdb [...] > +mapfile=`mktemp mapdb.XXXXXX` [...] > +rm -f $mapfile If you create temporary file, you should remove it in a trap cleanup, in case of interrupted processing. The best is to avoid temp file, but use variables instead.