DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: stable@dpdk.org, David Marchand <david.marchand@redhat.com>,
	Marat Khalili <marat.khalili@huawei.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	Hemant Agrawal <hemant.agrawal@nxp.com>
Subject: [PATCH v2] devtools: fix SPDX tag check
Date: Thu, 30 Apr 2026 15:15:09 +0200	[thread overview]
Message-ID: <20260430131600.329636-1-thomas@monjalon.net> (raw)
In-Reply-To: <20260429130935.3681177-1-thomas@monjalon.net>

If a file has no SPDX tag and is not filtered out by no_license_list,
there will be an error when using its path containing a slash
in the sed command delimited with slashes.

It could be fixed by using another character as sed command delimiter.
The chosen fix is to use grep instead of sed.

Fixes: b99a3b8aa989 ("license: standardize SPDX tag")
Cc: stable@dpdk.org

Reported-by: David Marchand <david.marchand@redhat.com>
Suggested-by: Marat Khalili <marat.khalili@huawei.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
v1: replace / with |
v2: use grep instead of sed (Marat's suggestion)
---
 devtools/check-spdx-tag.sh | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/devtools/check-spdx-tag.sh b/devtools/check-spdx-tag.sh
index 2390941c74..41fc1fe01d 100755
--- a/devtools/check-spdx-tag.sh
+++ b/devtools/check-spdx-tag.sh
@@ -39,10 +39,8 @@ check_spdx() {
     fi
 
     files_without_spdx=$(cat $tmpfile)
-    git grep -LE '(/\*|#|;|\.\.) *SPDX-License-Identifier: [A-Z(]' -- $no_license_list > $tmpfile
-    for file in $files_without_spdx ; do
-	sed -i "/^$file$/d" $tmpfile
-    done
+    git grep -LE '(/\*|#|;|\.\.) *SPDX-License-Identifier: [A-Z(]' -- $no_license_list |
+    grep -vF "$files_without_spdx" > $tmpfile
 
     warnings=$(($warnings + $(wc -l < $tmpfile)))
     $quiet || cat $tmpfile
-- 
2.53.0


  parent reply	other threads:[~2026-04-30 13:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29 13:09 [PATCH] devtools: fix SPDX tag check Thomas Monjalon
2026-04-29 14:10 ` Stephen Hemminger
2026-04-29 14:14 ` David Marchand
2026-04-29 16:17 ` Marat Khalili
2026-04-30 13:12   ` Thomas Monjalon
2026-04-30 13:15 ` Thomas Monjalon [this message]
2026-04-30 13:30   ` [PATCH v2] " Marat Khalili
2026-05-01  5:52     ` Thomas Monjalon
2026-05-01  9:55       ` Marat Khalili

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260430131600.329636-1-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=marat.khalili@huawei.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox