From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2] checkpatches.sh: Add checks for ABI symbol addition Date: Sun, 21 Jan 2018 21:29:18 +0100 Message-ID: <10549424.KHioEKbQpN@xps> References: <20180115190545.25687-1-nhorman@tuxdriver.com> <20180116182225.27133-1-nhorman@tuxdriver.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, john.mcnamara@intel.com, bruce.richardson@intel.com, Ferruh Yigit , Stephen Hemminger To: Neil Horman 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) In-Reply-To: <20180116182225.27133-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" 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.