guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCHv2] lint: add 'source' checker.


From: Ludovic Courtès
Subject: Re: [PATCHv2] lint: add 'source' checker.
Date: Thu, 15 Jan 2015 22:58:34 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Cyril Roelandt <address@hidden> skribis:

> * guix/scripts/lint.scm (validate-uri?): New procedure.
>   (%checkers): Add 'home-page' checker
                      ^^^^^
Typo.

> +(define (check-source package)
> +  "Emit a warning if PACKAGE has an invalid 'source' field, or if that
> +'source' is not reachable."
> +  (let ((origin (package-source package)))
> +    (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)))))
> +       (for-each
> +         (match-lambda
> +          ((? uri? uri)
> +           (validate-uri uri package 'source))
> +          (_ (error "internal linter error")))

Just:

  (for-each (cut validate-uri <> package 'source) ...)

> +         (concatenate (map (lambda (uri)
> +                             (maybe-expand-mirrors uri %mirrors))
> +                           uris)))))))

Here:

  (append-map (cut maybe-expand-mirrors <> %mirrors) uris)

OK to push with these changes, thank you!

The next step is to improve ‘probe-uri’ to handle FTP.

Ludo’.



reply via email to

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