[PATCH] checkpatch: Use python3 to run spdxcheck.py

From: Paul Barker
Date: Tue Jun 15 2021 - 14:52:19 EST


Since commit d0259c42abff ("spdxcheck.py: Use Python 3"), the shebang
line in scripts/spdxcheck.py says the script should run with `python3`.
However, checkpatch has been explicitly running this script with
`python` so it needs updating to ensure that Python 3 is used on all
distros.

Signed-off-by: Paul Barker <paul@xxxxxxxxxxx>
---
scripts/checkpatch.pl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 23697a6b1eaa..5e5e3a53461b 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1084,10 +1084,10 @@ sub is_maintained_obsolete {
sub is_SPDX_License_valid {
my ($license) = @_;

- return 1 if (!$tree || which("python") eq "" || !(-e "$root/scripts/spdxcheck.py") || !(-e "$gitroot"));
+ return 1 if (!$tree || which("python3") eq "" || !(-e "$root/scripts/spdxcheck.py") || !(-e "$gitroot"));

my $root_path = abs_path($root);
- my $status = `cd "$root_path"; echo "$license" | python scripts/spdxcheck.py -`;
+ my $status = `cd "$root_path"; echo "$license" | python3 scripts/spdxcheck.py -`;
return 0 if ($status ne "");
return 1;
}
--
2.32.0