From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92660C433EF for ; Tue, 7 Dec 2021 21:13:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241942AbhLGVRR (ORCPT ); Tue, 7 Dec 2021 16:17:17 -0500 Received: from mga01.intel.com ([192.55.52.88]:13049 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241840AbhLGVRK (ORCPT ); Tue, 7 Dec 2021 16:17:10 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10191"; a="261759127" X-IronPort-AV: E=Sophos;i="5.87,295,1631602800"; d="scan'208";a="261759127" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2021 13:13:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,295,1631602800"; d="scan'208";a="515825470" Received: from irvmail001.ir.intel.com ([10.43.11.63]) by fmsmga007.fm.intel.com with ESMTP; 07 Dec 2021 13:13:37 -0800 Received: from newjersey.igk.intel.com (newjersey.igk.intel.com [10.102.20.203]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id 1B7LDakT022373; Tue, 7 Dec 2021 21:13:36 GMT From: Alexander Lobakin To: Andy Whitcroft , Joe Perches Cc: Alexander Lobakin , Dwaipayan Ray , Lukas Bulwahn , linux-kernel@vger.kernel.org Subject: [PATCH] checkpatch: explicitly require python3 for codespell Date: Tue, 7 Dec 2021 22:13:16 +0100 Message-Id: <20211207211316.566692-1-alexandr.lobakin@intel.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix a bug where checkpatch couldn't automatically find dictionary.txt. "Unversioned" `which python` might be not present in a system with Python 3 and codespell installed and working. SPDX check already refers to `which python3`, do the same for codespell. Signed-off-by: Alexander Lobakin --- scripts/checkpatch.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 1784921c645d..6943f1e507f1 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -334,7 +334,7 @@ if ($user_codespellfile) { } elsif (!(-f $codespellfile)) { # If /usr/share/codespell/dictionary.txt is not present, try to find it # under codespell's install directory: /data/dictionary.txt - if (($codespell || $help) && which("codespell") ne "" && which("python") ne "") { + if (($codespell || $help) && which("codespell") ne "" && which("python3") ne "") { my $python_codespell_dict = << "EOF"; import os.path as op @@ -344,7 +344,7 @@ codespell_file = op.join(codespell_dir, 'data', 'dictionary.txt') print(codespell_file, end='') EOF - my $codespell_dict = `python -c "$python_codespell_dict" 2> /dev/null`; + my $codespell_dict = `python3 -c "$python_codespell_dict" 2> /dev/null`; $codespellfile = $codespell_dict if (-f $codespell_dict); } } -- 2.33.1