From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH 1/5] guix lint: make sure check-patches retrieves patch names. Date: Sun, 28 Sep 2014 12:08:13 +0200 Message-ID: <87mw9kawhe.fsf@gnu.org> References: <1411854568-11187-1-git-send-email-tipecaml@gmail.com> <1411854568-11187-2-git-send-email-tipecaml@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYBP2-00044Q-K9 for guix-devel@gnu.org; Sun, 28 Sep 2014 06:08:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XYBOt-0003Kf-IT for guix-devel@gnu.org; Sun, 28 Sep 2014 06:08:28 -0400 Received: from hera.aquilenet.fr ([2a01:474::1]:39913) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYBOt-0003KB-BG for guix-devel@gnu.org; Sun, 28 Sep 2014 06:08:19 -0400 In-Reply-To: <1411854568-11187-2-git-send-email-tipecaml@gmail.com> (Cyril Roelandt's message of "Sat, 27 Sep 2014 23:49:24 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Cyril Roelandt Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cyril Roelandt skribis: > * guix/lint (check-patches): Test the output of origin-patches. > --- > guix/scripts/lint.scm | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm > index 83dde9a..0fbec1b 100644 > --- a/guix/scripts/lint.scm > +++ b/guix/scripts/lint.scm > @@ -152,6 +152,7 @@ Run a set of checkers on the specified package; if no= ne is specified, run the ch > (name (package-name package)) > (full-name (package-full-name package))) > (if (and patches > + (every string? patches) > (any (lambda (patch) > (let ((filename (basename patch))) > (not (or (eq? (string-contains filename name) 0) Instead of requiring every item in =E2=80=98patches=E2=80=99 to be a file n= ame, what about testing each item individually: --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm index 83dde9a..b613737 100644 --- a/guix/scripts/lint.scm +++ b/guix/scripts/lint.scm @@ -152,10 +152,15 @@ Run a set of checkers on the specified package; if none is specified, run the ch (name (package-name package)) (full-name (package-full-name package))) (if (and patches - (any (lambda (patch) + (any (match-lambda + ((? string? patch) (let ((filename (basename patch))) (not (or (eq? (string-contains filename name) 0) - (eq? (string-contains filename full-name) 0))))) + (eq? (string-contains filename full-name) + 0))))) + (_ + ;; This must be an or something like that. + #f)) patches)) (emit-warning package "file names of patches should start with the package name" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 DQpUaGFua3MsDQpMdWRv4oCZLg0K --=-=-=--