All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] checkpatch: Follow scripts/spdxcheck.py's switch to python3
@ 2021-07-08 10:29 Vincent Pelletier
  2021-07-08 17:25 ` Joe Perches
  0 siblings, 1 reply; 2+ messages in thread
From: Vincent Pelletier @ 2021-07-08 10:29 UTC (permalink / raw)
  To: Andy Whitcroft, Joe Perches, Dwaipayan Ray, Lukas Bulwahn,
	Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, linux-kernel, netdev, bpf

Since commit d0259c42abff ("spdxcheck.py: Use Python 3") spdxcheck.py
expects to be run using python3. "python" may still be a python2 alias.
Instead, obey scripts/spdxcheck.py's shebang by executing it without
pre-selecting an interpreter.
Also, test python3 presence in path.

Signed-off-by: Vincent Pelletier <plr.vincent@gmail.com>
---
 scripts/checkpatch.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 23697a6b1eaa..a1cbd5fd0856 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" | scripts/spdxcheck.py -`;
 	return 0 if ($status ne "");
 	return 1;
 }
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] checkpatch: Follow scripts/spdxcheck.py's switch to python3
  2021-07-08 10:29 [PATCH] checkpatch: Follow scripts/spdxcheck.py's switch to python3 Vincent Pelletier
@ 2021-07-08 17:25 ` Joe Perches
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2021-07-08 17:25 UTC (permalink / raw)
  To: Vincent Pelletier, Andy Whitcroft, Dwaipayan Ray, Lukas Bulwahn,
	Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, linux-kernel, netdev, bpf

On Thu, 2021-07-08 at 10:29 +0000, Vincent Pelletier wrote:
> Since commit d0259c42abff ("spdxcheck.py: Use Python 3") spdxcheck.py
> expects to be run using python3. "python" may still be a python2 alias.
> Instead, obey scripts/spdxcheck.py's shebang by executing it without
> pre-selecting an interpreter.
> Also, test python3 presence in path.

Thanks, but already done. See:

commit f9363b31d769245cb7ec8a660460800d4b466911
Author: Guenter Roeck <linux@roeck-us.net>
Date:   Wed Jun 30 18:56:19 2021 -0700

    checkpatch: scripts/spdxcheck.py now requires python3



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-08 17:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-08 10:29 [PATCH] checkpatch: Follow scripts/spdxcheck.py's switch to python3 Vincent Pelletier
2021-07-08 17:25 ` Joe Perches

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.