checkpatch: Use python3 to run spdxcheck.py
PATCH 1/1 checkpatch: Use python3 to run spdxcheck.py
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.
--- scripts/checkpatch.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/checkpatch.pl +2 -2
@@ -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; }
Signature · 1 line
2.32.0
Quoted 20 lines · Paul Barker
Since commit
d0259c42abff("spdxcheck.py: Use Python 3"), the shebang line inscripts/spdxcheck.pysays the script should run withpython3. However, checkpatch has been explicitly running this script withpythonso it needs updating to ensure that Python 3 is used on all distros.Signed-off-by Paul Barker <[email protected]>--- scripts/checkpatch.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)scripts/checkpatch.pl +0
-0@@ -1084,10 +1084,10 @@ sub is_maintained_obsolete { sub is_SPDX_License_valid { my ($license) = @_;
scripts/checkpatch.pl sub is_maintained_obsolete {
Quoted 10 lines
scripts/checkpatch.pl +2
-3- 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; } --
Hello,
This change was already added by Commit c739ec2da1ea ("checkpatch: scripts/spdxcheck.py now requires python3") in linux-next.
Thanks,
Dwaipayan.
Quoted 40 lines · On Wed, 16 Jun 2021 00:28:14 +0530 Dwaipayan Ray <[email protected]>…
Quoted 31 lines · Paul Barker
Since commit
d0259c42abff("spdxcheck.py: Use Python 3"), the shebang line inscripts/spdxcheck.pysays the script should run withpython3. However, checkpatch has been explicitly running this script withpythonso it needs updating to ensure that Python 3 is used on all distros.Signed-off-by Paul Barker <[email protected]>--- scripts/checkpatch.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)scripts/checkpatch.pl +2
-2@@ -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" | python3scripts/spdxcheck.py -`; return 0 if ($status ne ""); return 1;Quoted 2 lines
}
Hello,
This change was already added by Commitc739ec2da1ea("checkpatch:scripts/spdxcheck.pynow requires python3") in linux-next.
Quoted 2 lines
Thanks,
Dwaipayan.
So it is. Apologies for the noise.
Signature · 2 lines
Paul Barker https://pbarker.dev/