From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,URIBL_SBL,URIBL_SBL_A autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7ACD2C433E0 for ; Fri, 12 Jun 2020 15:42:18 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 1726220838 for ; Fri, 12 Jun 2020 15:42:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=monjalon.net header.i=@monjalon.net header.b="cTJw6pfH"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="WWyupuNZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1726220838 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=monjalon.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F29571BFCD; Fri, 12 Jun 2020 17:42:16 +0200 (CEST) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 96A651BF9E for ; Fri, 12 Jun 2020 17:42:15 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 2759F5C01A7; Fri, 12 Jun 2020 11:42:15 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Fri, 12 Jun 2020 11:42:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm1; bh= DgHsdKUOxrM63RsejNS2C6DZMED3kx55kXMXOnaLdBc=; b=cTJw6pfH07R8GD6L yykDZD5NO1pzF3QN/U2yijE4JknT0+l7ZbO3A8u22OOwDd/ObzuXP8o6LEvULKly tlOZbnUh7CQ6SvAfDOT4CU6/hudmghhozCU67B/27Sr+M/Euac2LyccJoq9xI2xi 1ONh6Xyae30mwadPkAkZcEo++2jIJuDu/LNri12RLkcGlp8Ar7asf04bC5SwhAhb /viULGY6b3a1wrpovN6HiGRgWCRnTVUy2tTQ9B2XYCdEkpVgTBEGORf8yJgl9y5h iLm2eu8YibYKtVbinRVRuhZqoK35qJqfxQceAdqmRveFIEFEHSoe7hg7WKwtyXpx 0Pl38g== 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-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=DgHsdKUOxrM63RsejNS2C6DZMED3kx55kXMXOnaLd Bc=; b=WWyupuNZ/WByXFzGuPdfoJOTsgx7jj6m5xgTMxDd8tEDRApjay3xczhIq D9eeXS7sYdzGeCuag2DHwgVo3/JIJWegToh/YM9F2tQ+UM8zrVdviF2MN+644Txd m+Qsbdr09UMoYaYEQL6U327xh9KspqeOXKtn1G2ySXIMSZrpHXxS6tKRnkUzNPHe m3QliDlymE8qEr7WuZZcWy9zmU61rqJ8dJl1fp+RmKBNcQHaxri1DmGefrgBuEc+ IR70OXzU3z2200rWPw/pnvoUVc8y5RLYtxbm/sKEXu0Ci+vlxv1lrTrH6JiePzRc 5DT0TChaKZa5Cb0/nuUt4YZQHzKYA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudeiuddgledvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepkeevgfehjeeuudehjeffjedtfeelvdevtdetgfekkefhhfejheel feejgeffhfevnecuffhomhgrihhnpehgihhtrdgtihdpshhpugigrdhorhhgnecukfhppe ejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id A6522328005E; Fri, 12 Jun 2020 11:42:14 -0400 (EDT) From: Thomas Monjalon To: Stephen Hemminger Cc: dev@dpdk.org Date: Fri, 12 Jun 2020 17:42:13 +0200 Message-ID: <3800667.TsBKUvMEcr@thomas> In-Reply-To: <20200612075312.24299ddd@hermes.lan> References: <20200129155907.20556-1-stephen@networkplumber.org> <37903858.QyUTlBbKYA@thomas> <20200612075312.24299ddd@hermes.lan> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v4] devtools: add new SPDX license compliance checker 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 12/06/2020 16:53, Stephen Hemminger: > On Thu, 11 Jun 2020 23:39:55 +0200 > Thomas Monjalon wrote: > > > 24/02/2020 22:01, Stephen Hemminger: > > > +tmpfile=$(mktemp) > > > > Please check how other temp files are created in other scripts > > for consitency. > > > > > + git grep -L SPDX-License-Identifier -- \ > > > + ':^.git*' ':^.ci/*' ':^.travis.yml' \ > > > + ':^README' ':^MAINTAINERS' ':^VERSION' ':^ABI_VERSION' \ > > > + ':^*/Kbuild' ':^*/README' \ > > > + ':^license/' ':^doc/' ':^config/' ':^buildtools/' \ > > > > I think doc/ should be part of the license check, > > same for buildtools/. > > > > > + ':^*.cocci' ':^*.abignore' \ > > > + ':^*.def' ':^*.map' ':^*.ini' ':^*.data' ':^*.cfg' ':^*.txt' \ > > > + > $tmpfile > > > + > > > + errors=0 > > > + while read -r line > > > + do $quiet || echo $line > > > + errors=$((errors + 1)) > > > > I'm surprised this works for you. > > In general, "while" creates a subshell which makes impossible > > updating a variable. > > I recommend using "for" with IFS=$'\n'. > > > > > + done < $tmpfile > > > +} > > > + > > > +check_boilerplate() { > > > + if $verbose ; then > > > + echo > > > + echo "Files with redundant license text" > > > + echo "---------------------------------" > > > + fi > > > + > > > + git grep -l Redistribution -- \ > > > + ':^license/' ':^/devtools/check-spdx-tag.sh' | > > > + while read line > > > + do $quiet || echo $line > > > + warnings=$((warnings + 1)) > > > + done > > > > Same comment about "while" subshell. > > > > > + > > > + warnings=0 > > > + while read -r line > > > + do $quiet || echo $line > > > + warnings=$((errors + 1)) > > > > Here too > > > > > + done < $tmpfile > > > +} > > > > [...] > > > +Each file must begin with a special comment containing the > > > +`Software Package Data Exchange (SPDX) License Identfier `_. > > > > Typo: Identifier > > > > > + > > > +Generally this is the BSD License, except for code granted special exceptions. > > > > Is a verb missing? > > > > > +The SPDX licences identifier is sufficient, a file should not contain > > > +an additional text version of the license (boilerplate). > > Thanks for the feedback. > Text processing is simpler in python, will rewrite in next version? I don't see a need for rewrite. I think addressing the comments is simpler.