mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 13:58:15 -05:00
store: 'references/substitutes' really caches its result.
Until now the cache was always empty because 'for-each' was passed ITEMS as its second argument, and ITEMS was the empty list at that point. * guix/store.scm (references/substitutes): Add 'requested' variable. Use it as second argument of 'for-each' in base case.
This commit is contained in:
parent
2633bd324b
commit
b2fde4800d
1 changed files with 3 additions and 2 deletions
|
@ -1009,7 +1009,8 @@ (define (references/substitutes store items)
|
|||
length as ITEMS. Query substitute information for any item missing from the
|
||||
store at once. Raise a '&nix-protocol-error' exception if reference
|
||||
information for one of ITEMS is missing."
|
||||
(let* ((local-refs (map (lambda (item)
|
||||
(let* ((requested items)
|
||||
(local-refs (map (lambda (item)
|
||||
(or (hash-ref %reference-cache item)
|
||||
(guard (c ((nix-protocol-error? c) #f))
|
||||
(references store item))))
|
||||
|
@ -1040,7 +1041,7 @@ (define (references/substitutes store items)
|
|||
(()
|
||||
(let ((result (reverse result)))
|
||||
(for-each (cut hash-set! %reference-cache <> <>)
|
||||
items result)
|
||||
requested result)
|
||||
result))
|
||||
((item items ...)
|
||||
(match local-refs
|
||||
|
|
Loading…
Reference in a new issue