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: Ludovic Courtès
Subject: Re: [PATCH] guix: lint: Check for version-only origin file names.
Date: Sun, 13 Sep 2015 18:59:53 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

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?

> 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?

> +(test-assert "source: file name"

s/source:/source-file-name:/ for consistency.

OK with these changes.

Thank you!

Ludo’.



reply via email to

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