summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-07-05 00:48:20 +0200
committerLudovic Courtès <ludo@gnu.org>2019-07-05 00:51:17 +0200
commit728a4ab1019fda2f14a5c69d3f1b277fb5e09cda (patch)
treeaf3bcad6d519430c507d63ad373fd142ff75acc8
parentd74392a85cfd0992d034b903ca21180a6d73eaed (diff)
store: 'run-with-store' gracefully deals with #f store.
This is a followup to dd0ee954c4fa965023fd887452927c02edb8b52f, which introduced a failure in tests/graph.scm. * guix/store.scm (run-with-store): Check whether STORE and NEW-STORE are true before calling 'store-connection-object-cache' etc. Fixes a failure in tests/graph.scm related to %REVERSE-PACKAGE-NODE-TYPE, which uses #f as the store.
-rw-r--r--guix/store.scm11
1 files changed, 6 insertions, 5 deletions
diff --git a/guix/store.scm b/guix/store.scm
index 52940ff751..d7c603898c 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -1802,11 +1802,12 @@ connection, and return the result."
(call-with-values (lambda ()
(run-with-state mval store))
(lambda (result new-store)
- ;; Copy the object cache from NEW-STORE so we don't fully discard the
- ;; state.
- (let ((cache (store-connection-object-cache new-store)))
- (set-store-connection-object-cache! store cache)
- result)))))
+ (when (and store new-store)
+ ;; Copy the object cache from NEW-STORE so we don't fully discard
+ ;; the state.
+ (let ((cache (store-connection-object-cache new-store)))
+ (set-store-connection-object-cache! store cache)))
+ result))))
;;;