aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2022-09-10 10:29:02 +0100
committerChristopher Baines <mail@cbaines.net>2022-09-10 10:29:02 +0100
commitb23eb30a16eaac73d7e1fd71b0070fd7bd68ffe8 (patch)
tree12921e68da07d3aa2d2576e70aa45f174241a222
parent75febb00a57b69d41e989af0487446105fae32a5 (diff)
downloadguix-b23eb30a16eaac73d7e1fd71b0070fd7bd68ffe8.tar
guix-b23eb30a16eaac73d7e1fd71b0070fd7bd68ffe8.tar.gz
WIP
-rw-r--r--guix/substitutes.scm34
1 files changed, 20 insertions, 14 deletions
diff --git a/guix/substitutes.scm b/guix/substitutes.scm
index 9014cf61ec..6d55d00ef7 100644
--- a/guix/substitutes.scm
+++ b/guix/substitutes.scm
@@ -302,21 +302,25 @@ for PATH."
(define* (lookup-narinfos cache paths
#:key (open-connection guix:open-connection-for-uri)
(make-progress-reporter
- (const progress-reporter/silent)))
+ (const progress-reporter/silent))
+ use-cache?)
"Return the narinfos for PATHS, invoking the server at CACHE when no
information is available locally."
(let-values (((cached missing)
- (fold2 (lambda (path cached missing)
- (let-values (((valid? value)
- (cached-narinfo cache path)))
- (if valid?
- (if value
- (values (cons value cached) missing)
- (values cached missing))
- (values cached (cons path missing)))))
- '()
- '()
- paths)))
+ (if use-cache?
+ (fold2 (lambda (path cached missing)
+ (let-values (((valid? value)
+ (cached-narinfo cache path)))
+ (if valid?
+ (if value
+ (values (cons value cached) missing)
+ (values cached missing))
+ (values cached (cons path missing)))))
+ '()
+ '()
+ paths)
+ (values '()
+ paths))))
(values (if (null? missing)
cached
(let ((missing (fetch-narinfos cache missing
@@ -330,7 +334,8 @@ information is available locally."
#:key (open-connection
guix:open-connection-for-uri)
(make-progress-reporter
- (const progress-reporter/silent)))
+ (const progress-reporter/silent))
+ use-cache?)
"Look up narinfos for PATHS on all of CACHES, a list of URLS, in that order.
That is, when a cache lacks an AUTHORIZED? narinfo, look it up in the next
cache, and so on.
@@ -365,7 +370,8 @@ AUTHORIZED? narinfo."
(let* ((narinfos (lookup-narinfos cache paths
#:open-connection open-connection
#:make-progress-reporter
- make-progress-reporter))
+ make-progress-reporter
+ #:use-cache? use-cache?))
(definite (map narinfo-path (filter authorized? narinfos)))
(missing (lset-difference string=? paths definite))) ;XXX: perf
(loop rest missing