aboutsummaryrefslogtreecommitdiff
path: root/guix/store.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2021-05-31 22:28:43 +0200
committerLudovic Courtès <ludo@gnu.org>2021-06-08 09:25:50 +0200
commit2725f0463421dfb446bce393b87a13139922f1cc (patch)
tree0adee7f91ee70e29e3cc6d3669aa99692d324347 /guix/store.scm
parent4a93fb05954a6067bac8f8021dd0072e0824831e (diff)
downloadguix-2725f0463421dfb446bce393b87a13139922f1cc.tar
guix-2725f0463421dfb446bce393b87a13139922f1cc.tar.gz
store: Remove 'references/substitutes'.
This procedure lost its only user in commit 710854304b1ab29332edcb76f3de532e0724c197. * guix/store.scm (references/substitutes): Remove. * tests/store.scm ("references/substitutes missing reference info") ("references/substitutes with substitute info"): Remove.
Diffstat (limited to 'guix/store.scm')
-rw-r--r--guix/store.scm55
1 files changed, 1 insertions, 54 deletions
diff --git a/guix/store.scm b/guix/store.scm
index 38d12ac5d7..ea784a33d2 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -148,7 +148,6 @@
built-in-builders
references
references/cached
- references/substitutes
references*
query-path-info*
requisites
@@ -1481,7 +1480,7 @@ error if there is no such root."
;; Brute-force cache mapping store items to their list of references.
;; Caching matters because when building a profile in the presence of
;; grafts, we keep calling 'graft-derivation', which in turn calls
- ;; 'references/substitutes' many times with the same arguments. Ideally we
+ ;; 'references/cached' many times with the same arguments. Ideally we
;; would use a cache associated with the daemon connection instead (XXX).
(make-hash-table 100))
@@ -1492,58 +1491,6 @@ error if there is no such root."
(hash-set! %reference-cache item references)
references)))
-(define (references/substitutes store items)
- "Return the list of list of references of ITEMS; the result has the same
-length as ITEMS. Query substitute information for any item missing from the
-store at once. Raise a '&store-protocol-error' exception if reference
-information for one of ITEMS is missing."
- (let* ((requested items)
- (local-refs (map (lambda (item)
- (or (hash-ref %reference-cache item)
- (guard (c ((store-protocol-error? c) #f))
- (references store item))))
- items))
- (missing (fold-right (lambda (item local-ref result)
- (if local-ref
- result
- (cons item result)))
- '()
- items local-refs))
-
- ;; Query all the substitutes at once to minimize the cost of
- ;; launching 'guix substitute' and making HTTP requests.
- (substs (if (null? missing)
- '()
- (substitutable-path-info store missing))))
- (when (< (length substs) (length missing))
- (raise (condition (&store-protocol-error
- (message "cannot determine \
-the list of references")
- (status 1)))))
-
- ;; Intersperse SUBSTS and LOCAL-REFS.
- (let loop ((items items)
- (local-refs local-refs)
- (result '()))
- (match items
- (()
- (let ((result (reverse result)))
- (for-each (cut hash-set! %reference-cache <> <>)
- requested result)
- result))
- ((item items ...)
- (match local-refs
- ((#f tail ...)
- (loop items tail
- (cons (any (lambda (subst)
- (and (string=? (substitutable-path subst) item)
- (substitutable-references subst)))
- substs)
- result)))
- ((head tail ...)
- (loop items tail
- (cons head result)))))))))
-
(define* (fold-path store proc seed paths
#:optional (relatives (cut references store <>)))
"Call PROC for each of the RELATIVES of PATHS, exactly once, and return the