[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
06/10: lint: 'source' check no longer complains about unavailable mirror
From: |
guix-commits |
Subject: |
06/10: lint: 'source' check no longer complains about unavailable mirrors. |
Date: |
Fri, 19 Jul 2019 19:32:31 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 848ae71ea7131e78a7b728863eac1056c33b2679
Author: Ludovic Courtès <address@hidden>
Date: Sat Jul 20 01:13:46 2019 +0200
lint: 'source' check no longer complains about unavailable mirrors.
Fixes a regression introduced in
50fc2384feb3bb2677d074f8f0deb5ae3c56b4d8.
Previously, 'guix lint -c source coreutils' would complain if one of the
mirrors was unavailable. This is no longer the case.
* guix/lint.scm (check-source)[warnings-for-uris]: Use 'filter-map'.
Remove 'append-map' call.
Use 'append-map' here so that we can meaningfull compare the length or
URIS and that of WARNINGS.
Use '=' to compare lengths.
---
guix/lint.scm | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/guix/lint.scm b/guix/lint.scm
index 2542a81..12031c8 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -742,21 +742,21 @@ descriptions maintained upstream."
"Emit a warning if PACKAGE has an invalid 'source' field, or if that
'source' is not reachable."
(define (warnings-for-uris uris)
- (filter lint-warning?
- (map
- (lambda (uri)
- (validate-uri uri package 'source))
- (append-map (cut maybe-expand-mirrors <> %mirrors)
- uris))))
+ (filter-map (lambda (uri)
+ (match (validate-uri uri package 'source)
+ (#t #f)
+ ((? lint-warning? warning) warning)))
+ uris))
(let ((origin (package-source package)))
(if (and origin
(eqv? (origin-method origin) url-fetch))
- (let* ((uris (map string->uri (origin-uris origin)))
+ (let* ((uris (append-map (cut maybe-expand-mirrors <> %mirrors)
+ (map string->uri (origin-uris origin))))
(warnings (warnings-for-uris uris)))
;; Just make sure that at least one of the URIs is valid.
- (if (eq? (length uris) (length warnings))
+ (if (= (length uris) (length warnings))
;; When everything fails, report all of WARNINGS, otherwise don't
;; report anything.
;;
- branch master updated (dd9560a -> 3d33c93), guix-commits, 2019/07/19
- 01/10: gnu: python-jupyter-client: Patch file name of 'ip'., guix-commits, 2019/07/19
- 03/10: ui: 'warn-about-load-error' provides hints for unbound variables., guix-commits, 2019/07/19
- 02/10: ui: 'warn-about-load-error' warns about file/module name mismatches., guix-commits, 2019/07/19
- 04/10: gnu: Add emacs-zerodark-theme., guix-commits, 2019/07/19
- 05/10: lint: Update tests to (guix lint) migration., guix-commits, 2019/07/19
- 06/10: lint: 'source' check no longer complains about unavailable mirrors.,
guix-commits <=
- 08/10: lint: Remove unused imports., guix-commits, 2019/07/19
- 07/10: lint: Add test for 'source'., guix-commits, 2019/07/19
- 10/10: lint: Use the 'warning' procedure for messages., guix-commits, 2019/07/19
- 09/10: lint: source: Stop as soon as a valid URL is found., guix-commits, 2019/07/19