From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id F1B0AA00BE; Fri, 12 Jun 2020 16:53:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E62DF1BFF8; Fri, 12 Jun 2020 16:53:23 +0200 (CEST) Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by dpdk.org (Postfix) with ESMTP id 12C8D1BFB6 for ; Fri, 12 Jun 2020 16:53:22 +0200 (CEST) Received: by mail-pg1-f177.google.com with SMTP id h10so504216pgq.10 for ; Fri, 12 Jun 2020 07:53:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+OER+syXWB3JsS/AS6yMiTJbLnAB5HBtBL6lAswRTz0=; b=lLimjRWGWnW5VByI+zwV+Jgqnyp3jUSj/YQzSEawyRnjpUaOZPfFjkVrmgSV3zN8aD EEXifLgiZ3FHuLYHEzB5vuIw6gfHDrnzfwdIrloQL0+1rXrejfEskcASX5b3pQKQ6+LQ O2/fkFaQQ2W0OOveyNwGCQeHbaSWLs4fLOcR+XOO2TP1n7m8orrrD5dDRvNAiMBDNefY FkfjYy6oyVcGyzGKFt0lScOLWWZ1IlAj3GFZ+uEO79tfY7zabFB54z91qF6sizsNv70l q6xWHVkFI0ybsvkdyCD2Pc1Ql8xj2qB/I6HEMcwjrm/2KrNlwPYN9eMGxJTTL5/VlaPA cPpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+OER+syXWB3JsS/AS6yMiTJbLnAB5HBtBL6lAswRTz0=; b=IiBfoHpC2AsoNSuVWKiZ54ZZIOEx/3m4wzbfc2MWlIqkSpYiruK/E+XT2gqAzjDICg DCPIudvLtFgkz3pm79l2n7ZZBuFsZO/ix980aONs9pVG5iUWy4YhE8kmnhDDTj9zYckC FiideA0NH/wTHsgbSZMHGulGZ38IzTwEd/hSJ8fCFcHSKB2ECo+E8vBgYnqyBIijJT3W IOSxyM+kgdmAAlKpTOgRgtu80oy0TZzgMqQ1qvGP96CP8lGOjWqGK71sgU3y597DKQUh wRtc36nMmW34yEWNEEL5zm2uzP+inWZkzJmOBpnOjmfnfNUoIS8LByK2NOkqpp2XvTjb cjQA== X-Gm-Message-State: AOAM532+p7J7FnpT44WEccZfon6YWRDOHzOrf9L3jw73C2GtdGmmA9/O iUBRRZ2nd9c5D5nTw127ZwBo9Q== X-Google-Smtp-Source: ABdhPJz/fr5dqosK1wykYubL7JFmTxviI/vXptWfeGx6sVZbgnbg9pPYh9SqABXui6HmKKSubTl9KQ== X-Received: by 2002:a05:6a00:1490:: with SMTP id v16mr11678237pfu.173.1591973600964; Fri, 12 Jun 2020 07:53:20 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id k12sm5695793pgm.11.2020.06.12.07.53.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jun 2020 07:53:20 -0700 (PDT) Date: Fri, 12 Jun 2020 07:53:12 -0700 From: Stephen Hemminger To: Thomas Monjalon Cc: dev@dpdk.org Message-ID: <20200612075312.24299ddd@hermes.lan> In-Reply-To: <37903858.QyUTlBbKYA@thomas> References: <20200129155907.20556-1-stephen@networkplumber.org> <20200224210130.672-1-stephen@networkplumber.org> <37903858.QyUTlBbKYA@thomas> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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" 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?