Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4101967imm; Mon, 30 Jul 2018 08:42:10 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc/U/z0CRatqi4waSonhEouk0aNfjQqnBipg/Enh3NNApNNMUECFhATFejB/PpWFWuv4+py X-Received: by 2002:a62:225d:: with SMTP id i90-v6mr18177024pfi.246.1532965330779; Mon, 30 Jul 2018 08:42:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532965330; cv=none; d=google.com; s=arc-20160816; b=Jy5J3FCuFpSStIbclwO4Yk8VEdCguDDkrN9qGuGSi14lTyUHcPU+ugWRFsrzhSzeZ0 7/y2rnCNInrZi3meZzKkC13TMOhcUrOnyqYSeKwYxG0Y7dfsr2TSrvrQOPrjwlBAwoDm Pe8BredZoKNYHIVt6QwoVABaHVtNWb8tSLLUgCIIbQVWGx2dMNcajrI1DpEkqH6eL5LW dig/q/m/WCLajUwZj8Gp613vf47348TZm0WjClt11pR0OG0n8szIueJZXRJkNfcwV/p5 dku3i8sVEWF0rEtL3aQxdUNqgdNpYRRa/EVgAPyQWMBnTx301l/g0VJmhoJeYTuvTMfr ITQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=OLYmbqBstJ3uz+SXbb5FNqcOcYaUZTQHgblRzIZlf08=; b=Kwlt8Hwq/S4+2/silo9t6BvBrxZaFJTJZxq9bAikk9meoDYq/0Ax+qUCHbVMKXR5sy 2h8HViYiR7sK2TgNaKS74k9DJa2bvgcY7hbd4BqYXC4El062i3cq63n8kD9GFMvJvR4i 4QA/sJOr5E1ZBSW5Pgrdo6S+bzLMKItRuCZe+SCrvANZzNvgoZ/FjPEghlRYBpvjsEMl QChrg1w+NUXTjBPVyEcf4+ELjg3DJMd6tmAklqwk5pY4p5mTVMH2g8+tuVU3lyLDicGY e5pIZbHGePP4gzrg4HlPTsE7aH5b/0iqLY3hu+hZgMTrioer5xDqtXql+ZHdbbU2xni7 0TXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t5-v6si11503510pgs.52.2018.07.30.08.41.55; Mon, 30 Jul 2018 08:42:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726808AbeG3RQg (ORCPT + 99 others); Mon, 30 Jul 2018 13:16:36 -0400 Received: from smtprelay0183.hostedemail.com ([216.40.44.183]:48426 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726651AbeG3RQf (ORCPT ); Mon, 30 Jul 2018 13:16:35 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay02.hostedemail.com (Postfix) with ESMTP id E820B815C; Mon, 30 Jul 2018 15:41:02 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:355:379:541:599:960:982:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1566:1593:1594:1711:1714:1730:1747:1777:1792:2198:2199:2393:2559:2562:2828:3138:3139:3140:3141:3142:3622:3653:3865:3868:3870:3871:3873:4184:4321:5007:6119:7901:8660:8957:10004:10400:10848:11026:11232:11658:11914:12043:12438:12555:12663:12740:12760:12895:13069:13148:13230:13311:13357:13439:14180:14181:14659:14721:21060:21080:21627:21740:30046:30054:30091,0,RBL:47.151.153.53:@perches.com:.lbl8.mailshell.net-62.14.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:25,LUA_SUMMARY:none X-HE-Tag: nerve56_260a06c2ee443 X-Filterd-Recvd-Size: 2453 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf12.hostedemail.com (Postfix) with ESMTPA; Mon, 30 Jul 2018 15:41:01 +0000 (UTC) Message-ID: <14f411527d551411defdd73a2507a13b7f07e789.camel@perches.com> Subject: Re: checkpatch: SPDX integration breaks --root From: Joe Perches To: Charlemagne Lasse Cc: Rob Herring , Gleixner , Greg Kroah-Hartman , Andrew Morton , Stephen Rothwell , LKML Date: Mon, 30 Jul 2018 08:40:59 -0700 In-Reply-To: References: Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.28.1-2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2018-07-30 at 10:53 +0200, Charlemagne Lasse wrote: > Hi, > > I am now getting python errors when using --root with checkpatch.pl > and not being inside the linux repository. > > $ ./linux-next/scripts/checkpatch.pl --root=/usr/src/linux-next > --strict -f linux-next/Makefile > FAIL: /usr/src > Traceback (most recent call last): > File /usr/src/linux-next/scripts/spdxcheck.py", line 230, in > repo = git.Repo(os.getcwd()) > File "/usr/lib/python2.7/dist-packages/git/repo/base.py", line 156, in __init__ > raise InvalidGitRepositoryError(epath) > InvalidGitRepositoryError: /usr/src > > total: 0 errors, 0 warnings, 0 checks, 1726 lines checked > > linux-next/Makefile has no obvious style problems and is ready for submission. Does this work for you: --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index f25f708cd2a7..f0e6913c5cc1 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -852,7 +852,7 @@ sub is_maintained_obsolete { sub is_SPDX_License_valid { my ($license) = @_; - return 1 if (!$tree || which("python") eq "" || !(-e "$root/scripts/spdxcheck.py")); + return 1 if (!$tree || which("python") eq "" || !(-e "$root/scripts/spdxcheck.py") || !(-e "$root/.git")); my $status = `echo "$license" | python $root/scripts/spdxcheck.py -`; return 0 if ($status ne "");