From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] guix: lint: Check for version-only origin file names. Date: Sun, 13 Sep 2015 18:59:53 +0200 Message-ID: <87egi26yra.fsf@gnu.org> References: <1440371134-2699-1-git-send-email-ericbavier@openmailbox.org> <87pp2cmgss.fsf@netris.org> <20150824191024.3da87f41@openmailbox.org> <87y4gvvonz.fsf@gnu.org> <20150910155058.0a7c99b0@openmailbox.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbAdE-00008w-OY for guix-devel@gnu.org; Sun, 13 Sep 2015 13:00:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbAd9-0004zN-PT for guix-devel@gnu.org; Sun, 13 Sep 2015 13:00:00 -0400 In-Reply-To: (Eric Bavier's message of "Thu, 10 Sep 2015 23:04:08 -0500") 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: Eric Bavier Cc: guix-devel@gnu.org Eric Bavier skribis: > From 8db3e5978394b99ad14d69494b00343b70f918e1 Mon Sep 17 00:00:00 2001 > From: Eric Bavier > Date: Thu, 10 Sep 2015 15:39:44 -0500 > Subject: [PATCH 1/2] guix: packages: Add origin-actual-file-name. > > * guix/scripts/graph.scm (uri->file-name, node-full-name): Move origin fi= le > name logic to... > * guix/packages.scm (origin-actual-file-name): ...here. LGTM, but could you add a couple of tests (say one with a =E2=80=98file-nam= e=E2=80=99 field and one without) in tests/packages.scm? > From 03c3f2b21a2467675092830aea2ddf192e133ff5 Mon Sep 17 00:00:00 2001 > From: Eric Bavier > Date: Thu, 10 Sep 2015 15:34:58 -0500 > Subject: [PATCH 2/2] guix: lint: Check for meaningful origin file names. > > * guix/scripts/lint.scm (check-source-file-name): New procedure. > (%checkers): Add 'source-file-name' checker. > * tests/lint.scm ("source: file name", "source: file name v") > ("source: file name valid", "source: file name bad checkout") > ("source: file name good checkout"): New tests. > * doc/guix.texi (Invoking guix lint): Mention file name check. [...] > - (when (and origin > - (eqv? (origin-method origin) url-fetch)) > - (let* ((strings (origin-uri origin)) > - (uris (if (list? strings) > - (map string->uri strings) > - (list (string->uri strings))))) > - > - ;; Just make sure that at least one of the URIs is valid. > - (call-with-values > - (lambda () (try-uris uris)) > - (lambda (success? warnings) > - ;; When everything fails, report all of WARNINGS, otherwise = don't > - ;; report anything. > - ;; > - ;; XXX: Ideally we'd still allow warnings to be raised if *s= ome* > - ;; URIs are unreachable, but distinguish that from the error= case > - ;; where *all* the URIs are unreachable. > - (unless success? > - (emit-warning package > - (_ "all the source URIs are unreachable:") > - 'source) > - (for-each (lambda (warning) > - (display warning (guix-warning-port))) > - (reverse warnings))))))))) > + (when origin > + (if (eqv? (origin-method origin) url-fetch) > + (let* ((strings (origin-uri origin)) > + (uris (if (list? strings) I think this hunk should be omitted, no? > +(test-assert "source: file name" s/source:/source-file-name:/ for consistency. OK with these changes. Thank you! Ludo=E2=80=99.