From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Bavier Subject: Re: [PATCH] guix: lint: Check for version-only origin file names. Date: Mon, 14 Sep 2015 18:11:37 -0500 Message-ID: <20150914181137.33e4e4b8@openmailbox.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> <87egi26yra.fsf@gnu.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]:56192) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbhU3-0001jB-IF for guix-devel@gnu.org; Tue, 15 Sep 2015 00:04:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbhU0-0007xR-Ap for guix-devel@gnu.org; Tue, 15 Sep 2015 00:04:43 -0400 Received: from smtp28.openmailbox.org ([62.4.1.62]:52754) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbhU0-0007wM-2X for guix-devel@gnu.org; Tue, 15 Sep 2015 00:04:40 -0400 In-Reply-To: <87egi26yra.fsf@gnu.org> 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: Ludovic =?UTF-8?B?Q291cnTDqHM=?= Cc: guix-devel@gnu.org On Sun, 13 Sep 2015 18:59:53 +0200 ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > Eric Bavier skribis: >=20 > > 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 = file > > name logic to... > > * guix/packages.scm (origin-actual-file-name): ...here. >=20 > LGTM, but could you add a couple of tests (say one with a =E2=80=98file-n= ame=E2=80=99 > field and one without) in tests/packages.scm? Done. >=20 > > 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. >=20 > [...] >=20 > > - (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, otherwis= e don't > > - ;; report anything. > > - ;; > > - ;; XXX: Ideally we'd still allow warnings to be raised if = *some* > > - ;; URIs are unreachable, but distinguish that from the err= or 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) >=20 > I think this hunk should be omitted, no? Correct. Thanks for catching it. >=20 > > +(test-assert "source: file name" >=20 > s/source:/source-file-name:/ for consistency. >=20 > OK with these changes. Pushed as 50f5c46 and 3b4d010. `~Eric