From a89dde1ed89a53f33556ab12ec73bafe495a796c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 28 Oct 2015 11:48:27 +0100 Subject: [PATCH] substitute: 'lookup-narinfos' returns exactly a list of narinfos. * guix/scripts/substitute.scm (lookup-narinfos): Filter out #f values from CACHED, such that the end result is exactly a list of narinfos, not interspersed with #f. * guix/scripts/challenge.scm (discrepancies): Assume REMOTE is a list of narinfos. --- guix/scripts/challenge.scm | 6 ++---- guix/scripts/substitute.scm | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/guix/scripts/challenge.scm b/guix/scripts/challenge.scm index 19a9b061b8aae0ee2159e9eecc89c1c385386011..4a0c865b07ff2f6768c36413ad88efec896aae17 100644 --- a/guix/scripts/challenge.scm +++ b/guix/scripts/challenge.scm @@ -125,10 +125,8 @@ taken since we do not import the archives." servers)) ;; No 'assert-valid-narinfo' on purpose. (narinfos -> (fold (lambda (narinfo vhash) - (if narinfo - (vhash-cons (narinfo-path narinfo) narinfo - vhash) - vhash)) + (vhash-cons (narinfo-path narinfo) narinfo + vhash)) vlist-null remote))) (return (filter-map (lambda (item local) diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index 0377bb6abe5414f1fe70b9e826a5e96700eed96d..34fee5863f246b45231d10bf6c8526a0b318276a 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -598,7 +598,9 @@ information is available locally." (let-values (((valid? value) (cached-narinfo cache path))) (if valid? - (values (cons value cached) missing) + (if value + (values (cons value cached) missing) + (values cached missing)) (values cached (cons path missing))))) '() '()