[PATCH v2] devtools: fix SPDX tag check

Thomas Monjalon thomas at monjalon.net
Fri May 1 07:52:09 CEST 2026


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.




More information about the stable mailing list