mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 23:46:13 -05:00
lint: source: Stop as soon as a valid URL is found.
This restores the behavior of 'guix lint' prior to commit
50fc2384fe
.
* guix/lint.scm (check-source)[warnings-for-uris]: Rewrite to stop as
soon as one of URIS is valid.
This commit is contained in:
parent
6dc28adf72
commit
674b9df37d
1 changed files with 12 additions and 5 deletions
|
@ -740,11 +740,18 @@ (define (check-source package)
|
|||
"Emit a warning if PACKAGE has an invalid 'source' field, or if that
|
||||
'source' is not reachable."
|
||||
(define (warnings-for-uris uris)
|
||||
(filter-map (lambda (uri)
|
||||
(match (validate-uri uri package 'source)
|
||||
(#t #f)
|
||||
((? lint-warning? warning) warning)))
|
||||
uris))
|
||||
(let loop ((uris uris)
|
||||
(warnings '()))
|
||||
(match uris
|
||||
(()
|
||||
(reverse warnings))
|
||||
((uri rest ...)
|
||||
(match (validate-uri uri package 'source)
|
||||
(#t
|
||||
;; We found a working URL, so stop right away.
|
||||
'())
|
||||
((? lint-warning? warning)
|
||||
(loop rest (cons warning warnings))))))))
|
||||
|
||||
(let ((origin (package-source package)))
|
||||
(if (and origin
|
||||
|
|
Loading…
Reference in a new issue