[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/11: store: Add 'references/cached'.
From: |
guix-commits |
Subject: |
05/11: store: Add 'references/cached'. |
Date: |
Sun, 29 Mar 2020 09:37:07 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit c70cf1a724fb15e108dc842413db15a0b9f4bc10
Author: Ludovic Courtès <address@hidden>
AuthorDate: Sun Mar 29 01:21:32 2020 +0100
store: Add 'references/cached'.
* guix/store.scm (references/cached): New procedure.
---
guix/store.scm | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/guix/store.scm b/guix/store.scm
index b3641ef..ca8c0e5 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -135,6 +135,7 @@
built-in-builders
references
+ references/cached
references/substitutes
references*
query-path-info*
@@ -1393,6 +1394,13 @@ error if there is no such root."
;; would use a cache associated with the daemon connection instead (XXX).
(make-hash-table 100))
+(define (references/cached store item)
+ "Like 'references', but cache results."
+ (or (hash-ref %reference-cache item)
+ (let ((references (references store item)))
+ (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
- branch master updated (3b1886c -> 033df23), guix-commits, 2020/03/29
- 01/11: store: Add 'map/accumulate-builds'., guix-commits, 2020/03/29
- 02/11: guix build: Use 'map/accumulate-builds'., guix-commits, 2020/03/29
- 03/11: gexp: 'lower-inputs' uses 'mapm/accumulate-builds'., guix-commits, 2020/03/29
- 04/11: profiles: Use 'mapm/accumulate-builds'., guix-commits, 2020/03/29
- 06/11: grafts: Don't rely on substitute info for missing store items., guix-commits, 2020/03/29
- 05/11: store: Add 'references/cached'.,
guix-commits <=
- 11/11: packages: Change 'guile-for-grafts' back to 2.0., guix-commits, 2020/03/29
- 09/11: gnu: Add guile3.0-websocket., guix-commits, 2020/03/29
- 08/11: services: shepherd: Mark '.go' derivations as non-substitutable., guix-commits, 2020/03/29
- 10/11: gnu: guile3.0-websocket: Install .go files in the right place., guix-commits, 2020/03/29
- 07/11: '--dry-run' no longer implies '--no-grafts'., guix-commits, 2020/03/29