From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 14:53:05 2016 Received: (at 24737) by debbugs.gnu.org; 22 Oct 2016 18:53:06 +0000 Received: from localhost ([127.0.0.1]:46563 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1by1Pl-0005Iv-Ns for submit@debbugs.gnu.org; Sat, 22 Oct 2016 14:53:05 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:58553) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1by1Pk-0005In-FK for 24737@debbugs.gnu.org; Sat, 22 Oct 2016 14:53:04 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id E0582205D8; Sat, 22 Oct 2016 14:53:03 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Sat, 22 Oct 2016 14:53:03 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h=cc :content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=ZN/+w zj7siUROYnMm5s0wrikGeE=; b=Ycd6dinRS9CWemZoAau+0+worJBysQBJItdZG ZYduZbYxbScLFssnphnyCsyBJM96/P3wCwNKwBj5dnDC/2h9i5LWFI3Xflixg+UT thMawMWwcLcQuyAgmK4bqioGFIro/PdXF8KaLcbYqGkZYexSM9XVrGralTC9An6m zItk14= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=ZN/+wzj7siUROYnMm5s0wrikGeE=; b=GI1Ga 109EdtoXhlZLQObOBNQVoZ7/dG6JgRTCmDRLlYY7+TRVpDtPoTJBq/QRNbl2QfoU M2YevfydpFJoHBGjPujKcCe+j64Ts0VyYOl+qz9YASttxbwxQsYSVlgQJmVhwF2J GBoz9/4u9cUPgD0Bdx1goNLKDKD+qz+qe4JXZ0= X-Sasl-enc: +/ACXg8s28LsWFKO0vAFe4/MsoXY/6eGTLSNj3uY38Cx 1477162383 Received: from localhost (169.243.187.81.in-addr.arpa [81.187.243.169]) by mail.messagingengine.com (Postfix) with ESMTPA id 8B69CF29CB; Sat, 22 Oct 2016 14:53:03 -0400 (EDT) From: Marius Bakke To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#24737: `guix lint` should not check patch-file-names on inherited sources In-Reply-To: <87eg3c5d8b.fsf@gnu.org> References: <87zim05tvp.fsf@duckhunt.i-did-not-set--mail-host-address--so-tickle-me> <87eg3c5d8b.fsf@gnu.org> Date: Sat, 22 Oct 2016 19:53:02 +0100 Message-ID: <87insk5i7l.fsf@duckhunt.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 24737 Cc: 24737@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > Marius Bakke skribis: > >> After patching 'notmuch', `guix lint -c patch-file-names` does not pass >> for 'python-notmuch' which inherits the source from 'notmuch'. > > I agree but that=E2=80=99s not quite possible: the =E2=80=9Cinheritance= =E2=80=9D relation (which > is really just a copy of a record) is not known at run time. > > So we=E2=80=99d need another trick to guess whether a patch is coming from > elsewhere and should consequently be ignored by =E2=80=98lint=E2=80=99. Here is a "RFC" patch that thwarts the warning if the source file name is different from the package name. Not sure how to properly make it part of the procedure, so that the checks are actually skipped as well. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-lint-Skip-patch-file-names-on-inherited-sources.patch From 160132bdc23b34c6331adf00af46af19dd8d737c Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sat, 22 Oct 2016 19:12:00 +0100 Subject: [PATCH] lint: Skip 'patch-file-names' on inherited sources. * guix/scripts/lint.scm (check-patch-file-names): Only report when the source file name matches the package name. --- guix/scripts/lint.scm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm index d6281ea..ba1bbc3 100644 --- a/guix/scripts/lint.scm +++ b/guix/scripts/lint.scm @@ -497,10 +497,13 @@ patch could not be found." (_ #f)) ;must be an or something like that. (or (and=> (package-source package) origin-patches) '())) - (emit-warning - package - (_ "file names of patches should start with the package name") - 'patch-file-names)))) + ;; Skip report when the source file name differs (i.e. inherited). + (and (string-prefix? (package-name package) + (origin-actual-file-name (package-source package))) + (emit-warning + package + (_ "file names of patches should start with the package name") + 'patch-file-names))))) (define (escape-quotes str) "Replace any quote character in STR by an escaped quote character." -- 2.10.1 --=-=-=--