guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] guix: lint: Check for version-only origin file names.


From: Eric Bavier
Subject: Re: [PATCH] guix: lint: Check for version-only origin file names.
Date: Mon, 14 Sep 2015 18:11:37 -0500

On Sun, 13 Sep 2015 18:59:53 +0200
address@hidden (Ludovic Courtès) wrote:

> Eric Bavier <address@hidden> skribis:
> 
> > From 8db3e5978394b99ad14d69494b00343b70f918e1 Mon Sep 17 00:00:00 2001
> > From: Eric Bavier <address@hidden>
> > 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.
> 
> LGTM, but could you add a couple of tests (say one with a ‘file-name’
> field and one without) in tests/packages.scm?

Done.

> 
> > From 03c3f2b21a2467675092830aea2ddf192e133ff5 Mon Sep 17 00:00:00 2001
> > From: Eric Bavier <address@hidden>
> > 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 
> > *some*
> > -            ;; 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?

Correct.  Thanks for catching it.

> 
> > +(test-assert "source: file name"
> 
> s/source:/source-file-name:/ for consistency.
> 
> OK with these changes.

Pushed as 50f5c46 and 3b4d010.

`~Eric



reply via email to

[Prev in Thread] Current Thread [Next in Thread]