* [PATCH] devtools: fix SPDX tag check
@ 2026-04-29 13:09 Thomas Monjalon
2026-04-29 14:10 ` Stephen Hemminger
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Thomas Monjalon @ 2026-04-29 13:09 UTC (permalink / raw)
To: dev; +Cc: stable, David Marchand, Bruce Richardson, Hemant Agrawal
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 is fixed by using the pipe character as sed command delimiter.
Fixes: b99a3b8aa989 ("license: standardize SPDX tag")
Cc: stable@dpdk.org
Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
devtools/check-spdx-tag.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/devtools/check-spdx-tag.sh b/devtools/check-spdx-tag.sh
index 2390941c74..f0fcddf0d3 100755
--- a/devtools/check-spdx-tag.sh
+++ b/devtools/check-spdx-tag.sh
@@ -41,7 +41,7 @@ check_spdx() {
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
+ sed -i "\|^$file$|d" $tmpfile
done
warnings=$(($warnings + $(wc -l < $tmpfile)))
--
2.53.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH] devtools: fix SPDX tag check
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
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Stephen Hemminger @ 2026-04-29 14:10 UTC (permalink / raw)
To: Thomas Monjalon
Cc: dev, stable, David Marchand, Bruce Richardson, Hemant Agrawal
On Wed, 29 Apr 2026 15:09:35 +0200
Thomas Monjalon <thomas@monjalon.net> wrote:
> 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 is fixed by using the pipe character as sed command delimiter.
>
> Fixes: b99a3b8aa989 ("license: standardize SPDX tag")
> Cc: stable@dpdk.org
>
> Reported-by: David Marchand <david.marchand@redhat.com>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH] devtools: fix SPDX tag check
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:15 ` [PATCH v2] " Thomas Monjalon
3 siblings, 0 replies; 9+ messages in thread
From: David Marchand @ 2026-04-29 14:14 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev, stable, Bruce Richardson, Hemant Agrawal
On Wed, 29 Apr 2026 at 15:10, Thomas Monjalon <thomas@monjalon.net> wrote:
>
> 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 is fixed by using the pipe character as sed command delimiter.
>
> Fixes: b99a3b8aa989 ("license: standardize SPDX tag")
> Cc: stable@dpdk.org
>
> Reported-by: David Marchand <david.marchand@redhat.com>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: David Marchand <david.marchand@redhat.com>
--
David Marchand
^ permalink raw reply [flat|nested] 9+ messages in thread* RE: [PATCH] devtools: fix SPDX tag check
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 ` [PATCH v2] " Thomas Monjalon
3 siblings, 1 reply; 9+ messages in thread
From: Marat Khalili @ 2026-04-29 16:17 UTC (permalink / raw)
To: Thomas Monjalon, dev@dpdk.org
Cc: stable@dpdk.org, David Marchand, Bruce Richardson, Hemant Agrawal
Patch definitely improves the situation, but after a quick prompt Gemini suggested `| grep -vF "$files_without_spdx"` for safe filtering (man page confirms that patterns can be separated with newlines).
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] devtools: fix SPDX tag check
2026-04-29 16:17 ` Marat Khalili
@ 2026-04-30 13:12 ` Thomas Monjalon
0 siblings, 0 replies; 9+ messages in thread
From: Thomas Monjalon @ 2026-04-30 13:12 UTC (permalink / raw)
To: Marat Khalili
Cc: dev@dpdk.org, stable@dpdk.org, David Marchand, Bruce Richardson,
Hemant Agrawal
29/04/2026 18:17, Marat Khalili:
> Patch definitely improves the situation, but after a quick prompt Gemini suggested `| grep -vF "$files_without_spdx"` for safe filtering (man page confirms that patterns can be separated with newlines).
Yes grep looks simpler than sed for this filter.
I'll send a v2 with your suggestion.
Thank you
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2] devtools: fix SPDX tag check
2026-04-29 13:09 [PATCH] devtools: fix SPDX tag check Thomas Monjalon
` (2 preceding siblings ...)
2026-04-29 16:17 ` Marat Khalili
@ 2026-04-30 13:15 ` Thomas Monjalon
2026-04-30 13:30 ` Marat Khalili
3 siblings, 1 reply; 9+ messages in thread
From: Thomas Monjalon @ 2026-04-30 13:15 UTC (permalink / raw)
To: dev; +Cc: stable, David Marchand, Marat Khalili, Bruce Richardson,
Hemant Agrawal
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
^ permalink raw reply related [flat|nested] 9+ messages in thread* RE: [PATCH v2] devtools: fix SPDX tag check
2026-04-30 13:15 ` [PATCH v2] " Thomas Monjalon
@ 2026-04-30 13:30 ` Marat Khalili
2026-05-01 5:52 ` Thomas Monjalon
0 siblings, 1 reply; 9+ messages in thread
From: Marat Khalili @ 2026-04-30 13:30 UTC (permalink / raw)
To: Thomas Monjalon, dev@dpdk.org
Cc: stable@dpdk.org, David Marchand, Bruce Richardson, Hemant Agrawal
> 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
Sorry for forgetting to mention it right away, some kind of sentinel or if
condition is needed if $files_without_spdx can be empty, don't know how
realistic it is in practice and whether other parts are ready to handle this
case. E.g. `files_without_spdx=$(echo //sentinel; cat $tmpfile)`. I hope it
won't make the whole thing too complicated and not worth it.
Otherwise,
Acked-by: Marat Khalili <marat.khalili@huawei.com>
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH v2] devtools: fix SPDX tag check
2026-04-30 13:30 ` Marat Khalili
@ 2026-05-01 5:52 ` Thomas Monjalon
2026-05-01 9:55 ` Marat Khalili
0 siblings, 1 reply; 9+ messages in thread
From: Thomas Monjalon @ 2026-05-01 5:52 UTC (permalink / raw)
To: Marat Khalili
Cc: dev@dpdk.org, stable@dpdk.org, David Marchand, Bruce Richardson,
Hemant Agrawal
30/04/2026 15:30, Marat Khalili:
> > 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
>
> Sorry for forgetting to mention it right away, some kind of sentinel or if
> condition is needed if $files_without_spdx can be empty, don't know how
> realistic it is in practice and whether other parts are ready to handle this
> case. E.g. `files_without_spdx=$(echo //sentinel; cat $tmpfile)`. I hope it
> won't make the whole thing too complicated and not worth it.
Sorry I don't understand the need for a sentinel.
The script is working fine with an empty files_without_spdx.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-05-01 9:55 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH v2] " Thomas Monjalon
2026-04-30 13:30 ` Marat Khalili
2026-05-01 5:52 ` Thomas Monjalon
2026-05-01 9:55 ` Marat Khalili
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox