From: Nabih Estefan <[email protected]>

When running the license check, if we are updating a license it is
possible for the checkpatch script to test against old license lines
instead of newer ones, since the removal lines appear before the
addition lines in a .patch file.

Fix this by skipping over lines that start with "-" in the checkpatch
script.

Signed-off-by: Nabih Estefan <[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Alex Bennée <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-ID: <[email protected]>

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 91616c974f2..40b6955c698 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1816,7 +1816,8 @@ sub process {
                }
 
 # Check SPDX-License-Identifier references a permitted license
-               if ($rawline =~ m,SPDX-License-Identifier: (.*?)(\*/)?\s*$,) {
+               if (($rawline =~ m,SPDX-License-Identifier: (.*?)(\*/)?\s*$,) &&
+                       $rawline !~ /^-/) {
                        $fileinfo->{facts}->{sawspdx} = 1;
                        &checkspdx($realfile, $1);
                }
-- 
2.47.3


Reply via email to